setup_intel: a layer split whose experts will likely not fit writes STRATA_VERIFY_NO_HOST=0 and says so (#1980)

The stock split shape (STRATA_STAGE_TRIM=1, 1024 MiB reserve, NO_HOST=1 from strata-sycl.sh) is
refused at the start on a 2x Arc Pro B60 24 GB pair with IQ3_XXS: the second stage is 2230-3731
experts short and the host mirror covers the first stage only. The same config with NO_HOST=0
runs at 39-50 tok/s with 0 faults (jds1-ai in #1980). When the model's experts take more than
80% of the split cards' VRAM, setup now writes NO_HOST=0 into the config (a value the user set
is kept) and prints why and how to turn it back. IQ2_XS on the same pair (74%) keeps NO_HOST=1.
Test: tools/test_setup_sycl.py test_split_short_rule.
This commit is contained in:
Niko1221 committed 2026-10-13 04:12:24 +02:00
1 parent 1955774783
commit 23db5f9555
2 files changed
+34

No files matched your search

+24
View File
@@ -131,6 +131,20 @@ def small_card(vram_gb: float, driver: str) -> bool:
return 0 < vram_gb < SMALL_CARD_GB or driver == "i915"
# #1980: on a layer split the host mirror covers the first stage only, so with STRATA_VERIFY_NO_HOST=1 (strata-sycl.sh's
# default) a later stage that cannot hold all of its layers' experts is REFUSED at the start. Measured on 2x Arc Pro B60
# 24 GB with the trim and a 1024 MiB reserve: IQ3_XXS (42.9 GB of experts, 89% of the 48 GB) stage 1 2230-3731 experts
# short and refused; NO_HOST=0 runs it at 39-50 tok/s with 0 faults. IQ2_XS (35.5 GB, 74%) loads 100% resident.
SPLIT_SHORT_FRACTION = 0.80
def split_likely_short(arena_gb: float, vram_gbs: list) -> bool:
"""True when the model's experts take so much of the split cards' VRAM that a later stage will not hold all of its
layers' experts (the dense weights, the KV, the prompt buffers, the drafter and the reserve take the rest)."""
total = sum(v for v in vram_gbs if v and v > 0)
return arena_gb > 0 and total > 0 and arena_gb > SPLIT_SHORT_FRACTION * total
def to_sycl(cfg: dict, exe: Path, ram: float, keep: dict, vram_gb: float = 0.0, driver: str = "xe",
devid: str = "") -> dict:
"""setup's config (written for its HIP path) -> the SYCL port's: the container's paths, experts streamed from the
@@ -295,6 +309,16 @@ def install(argv) -> None:
# #1980: without it every card keeps a full copy of the dense weights (1.4 GiB each on Flash-Next IQ2_XS) and the
# load stops at 96-97% resident; the later stage's missing experts have no host mirror (STRATA_VERIFY_NO_HOST)
cfg.setdefault("env", {}).setdefault("STRATA_STAGE_TRIM", "1")
# #1980: a later stage short of VRAM is refused under NO_HOST=1; with the host path on it runs (the host
# computes those experts). Only when the experts will likely not fit; a value the user set is kept.
cards = [intel[i]["vram_gb"] for i in gsel if isinstance(i, int) and 0 <= i < len(intel)]
arena = S.MODELS.get(model, {}).get("arena_gb", 0)
if split_likely_short(arena, cards) and "STRATA_VERIFY_NO_HOST" not in cfg["env"]:
cfg["env"]["STRATA_VERIFY_NO_HOST"] = "0"
S.say(f" {model}'s {arena:.0f} GB of experts will likely not all fit the {len(cards)} cards' "
f"{sum(cards):.0f} GB of VRAM: the config sets STRATA_VERIFY_NO_HOST=0, so the CPU computes the "
"experts the later card does not hold instead of the start being refused (#1980). Set it to 1 "
"in the config's env if your cards hold everything; a smaller model fits fully (docs/INTEL_ARC.md)")
need = S.MODELS.get(model, {}).get("ram_gb", 0)
sel_alch = sel["driver"] == "i915" or sel.get("devid") in ALCHEMIST_IDS
if sel_alch and need and real_ram < need:
+10
View File
@@ -206,6 +206,16 @@ class ToSycl(unittest.TestCase):
self.assertEqual(c["env"]["STRATA_VERIFY_NO_HOST"], "0")
self.assertEqual(c["env"]["STRATA_SYCL_BIN"], "build-sycl/strata")
def test_split_short_rule(self):
# #1980: 2x B60 24 GB - IQ3_XXS (42.9 GB) was refused under NO_HOST=1, IQ2_XS (35.5 GB) loads fully
m = self.mod()
self.assertTrue(m.split_likely_short(42.9, [24.0, 24.0]))
self.assertFalse(m.split_likely_short(35.5, [24.0, 24.0]))
self.assertFalse(m.split_likely_short(50.3, [32.0, 32.0])) # IQ3_S on 2x B70: 79%
self.assertTrue(m.split_likely_short(77.0, [32.0, 32.0]))
self.assertFalse(m.split_likely_short(0, [24.0]))
self.assertFalse(m.split_likely_short(40.0, []))
def test_small_card_rule(self):
m = self.mod()
self.assertTrue(m.small_card(8.0, "i915"))