setup: uma_holds_experts is never true on a Mac (the signed Mac plans stay exactly as they were); test

This commit is contained in:
Niko1221 committed 2026-11-05 12:29:14 +01:00
1 parent 86ffdbeb17
commit 0c0b7b8751
2 files changed
+7 -2

No files matched your search

+2 -2
View File
@@ -3680,8 +3680,8 @@ def uma_holds_experts(model, ram, gpu) -> bool:
"""A unified-memory GPU whose shared pool holds every expert of `model` beside everything else the engine keeps there (strata_control/uma_pool.py: the
measured fixed part, the experts, a margin) and whose RAM holds them with UNSLOTH_RESIDENT_BESIDE_GB more. Only for a set that asks ("uma_pool_auto"):
the sets measured under the budget mode (UD-IQ4_XS, UD-Q4_K_XL, ...) keep their plans."""
if not MODELS.get(model, {}).get("uma_pool_auto") or not (gpu or {}).get("uma"):
return False
if sys.platform == "darwin" or not MODELS.get(model, {}).get("uma_pool_auto") or not (gpu or {}).get("uma"):
return False # (a Mac never reaches this: metal/setup_mac.py and mac_control_setup have their own plans; the check keeps it so)
shared = float((gpu or {}).get("vram_gb") or 0.0)
if shared <= 0:
return False
+5
View File
@@ -669,6 +669,11 @@ class StrixHaloCache(Base):
asked = self.run_halo(63.7, ("--context", "8192", "--resident-budget-gib", "24"), amd=self.HALO64, m="UD-IQ2_XS", version="0.1.57")[2]["args"]
self.assertIn("--resident-budget-gib", asked) # the budget the person asked for is written (setup's own pool check may lower it, as before)
def test_a_mac_is_never_touched(self):
with mock.patch.object(setup.sys, "platform", "darwin"):
self.assertFalse(setup.uma_holds_experts("UD-IQ2_XS", 63.7, self.HALO64[0]))
self.assertTrue(setup.unsloth_budget("UD-IQ2_XS", 63.7, self.HALO64[0])) # the answer it gave before round 0214
def test_the_spark_profile(self):
"""A DGX Spark (GB10, unified memory, 128 GB): the old sets keep the budget plan, a v3.1 set that fits the pool has all of its experts in it."""
spark = {"vram_gb": 119.0, "uma": True, "arch": "121"}