Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

setup: NVFP4 below its RAM need takes the RAM-budget mode (--resident-budget-gib, RAM less 24 GB), not the mapped experts

Niko1221de9ea19baea5
diff --git a/setup.py b/setup.py
index dad9b2f10..4e8ecfab8 100644
--- a/setup.py
+++ b/setup.py
@@ -5515,7 +5515,7 @@ def main() -> int:
# with a warning when they do not fit the RAM it finds free). mmap: they are read through the OS file cache.
# The GPU's share: its VRAM less the dense weights and buffers, this context's KV cache and the image encoder's room.
resident = False
- if low_ram:
+ if low_ram and not fam.get("ready"): # NVFP4's packs: the RAM-budget mode instead (step 7)
arena = MODELS[model]["arena_gb"]
vram = low_ram_vram(gpu) - (VISION[vision]["reserve_mib"] / 1024 if vision != "none" else 0)
share = low_ram_gpu_share(model, vram, ctx, kv)
@@ -5794,7 +5794,16 @@ def main() -> int:
resident = False # an engine from before --resident-experts would refuse it
ok(f"low-RAM mode: engine {meta.get('version')} has no resident variant yet; the experts are read through "
"the OS file cache (run setup again after the next engine update)")
- if low_ram: # the experts from the pack's experts.bin: the ones the GPU does not hold copied into RAM, or mapped
+ if low_ram and ready:
+ # NVFP4 (68 GB of experts) on a PC whose RAM does not hold them: the RAM-budget mode, as Unsloth's files - the
+ # most-used experts outside VRAM pinned within RAM less 24 GB, the rest read from experts.bin. Mapped
+ # (--mmap-experts) on a 64 GB Windows PC, the experts it read stayed in the engine's working set: free RAM
+ # fell to 0.6 GB on the RTX 5070 PC (2026-10-13), where the budget mode kept 22 GB free
+ rb = resident_budget_gib(model, ram)
+ args += ["--resident-budget-gib", str(rb)]
+ ok(f"low-RAM mode: {rb} GiB of {model}'s experts kept in RAM (the most used), the rest read from the pack's "
+ "experts.bin on the SSD as needed")
+ elif low_ram: # the experts from the pack's experts.bin: the ones the GPU does not hold copied into RAM, or mapped
args += ["--resident-experts" if resident else "--mmap-experts"]
disk = None if is_wsl() else rotational_disk(ple) # #605 (WSL's virtual disk says rotational)
if disk:
diff --git a/tools/test_setup_nvfp4.py b/tools/test_setup_nvfp4.py
index 1163c970d..bf811e114 100644
--- a/tools/test_setup_nvfp4.py
+++ b/tools/test_setup_nvfp4.py
@@ -147,13 +147,15 @@ class MockedInstall(unittest.TestCase):
self.assertIn("NVIDIA-NVFP4-Strata/pack", self.flag(cfg["args"], "--pack"))
self.assertIn("NVIDIA Open Model License", out)
- def test_96gb_keeps_every_expert_in_ram_64gb_takes_the_low_ram_mode(self):
+ def test_96gb_keeps_every_expert_in_ram_64gb_takes_the_ram_budget(self):
code, out, cfg, _ = self.run_install("96GB-1x16GB") # 68 GB of experts + 10 GB beside them fit 95.8
self.assertEqual(code, 0, out[-2000:])
self.assertFalse({"--mmap-experts", "--resident-experts"} & set(cfg["args"]))
- code, out, cfg, _ = self.run_install("64GB-1x32GB") # the experts outside a 32 GB card's cache fit the RAM
+ code, out, cfg, _ = self.run_install("64GB-1x32GB") # 64 GB: the RAM-budget mode (RAM less 24 GB)
self.assertEqual(code, 0, out[-2000:])
- self.assertIn("--resident-experts", cfg["args"])
+ a = cfg["args"]
+ self.assertFalse({"--mmap-experts", "--resident-experts"} & set(a))
+ self.assertEqual(a[a.index("--resident-budget-gib") + 1], "40")
def test_amd_is_refused_with_a_recommendation(self):
import test_setup_golden as G