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: MIN_ENGINE 0.1.40 (#848 split+resident, #711 K8V4 streaming); CMake version 0.1.40

Niko12214552a7f16415
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8bb7c8824..8937b0bbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@
# below refuses anything older: silently building for a pre-Ampere arch would produce a binary that runs
# and is wrong about its own performance, which is the worst of both outcomes.
cmake_minimum_required(VERSION 3.24)
-project(strata VERSION 0.1.39 LANGUAGES CXX)
+project(strata VERSION 0.1.40 LANGUAGES CXX)
# EXPERIMENTAL: the Intel Arc engine, the SYCL port in sycl/ (PR #423; icpx + oneMKL, docs/INTEL_ARC.md). It is its
# own project that takes the unported sources from src/; with this on, nothing below is configured.
option(STRATA_ENABLE_SYCL "EXPERIMENTAL: build the Intel Arc (SYCL) engine from sycl/ - docs/INTEL_ARC.md" OFF)
diff --git a/setup.py b/setup.py
index e496869b7..352e1cab0 100644
--- a/setup.py
+++ b/setup.py
@@ -115,7 +115,7 @@ CUDA12_WHEELS = ["nvidia-cublas-cu12==12.9.1.4", "nvidia-cuda-runtime-cu12==12.9
# toolkit the CUDA 12 zip is built with (cuBLAS 12.9.1.4, runtime 12.9.79). Not tested on such an old driver here.
CUDA12_MIN_DRIVER = 528 if WIN else 525
ENGINE12_DIR = "engine-cuda12"
-MIN_ENGINE = (0, 1, 39) # v0.1.39: the #577 file-tier regression fixed, the OpenAI Responses API (#451, Codex), a reply stuck on one token ended (#606), the head before the arena (#620), effort_position (#458), --vram-reserve hot resize opt-in (#533), PR batch; v0.1.38: prompts faster (one gather per expert group #372, the first chunk's PLE rows beside layer 0 #374, DeltaNet three heads per thread #413), --kv q4_0 prompts on tensor cores (#452), Q5_0 experts on the GPU (#473), IQ4_XS on AVX-2 (#415), unbuffered expert loading on Windows (#357 #362), --peer-device (#531), a 6 GB card starts (#496), PR batch; v0.1.37: a silent engine is restarted (#481), Windows AMD counts the desktop's VRAM (#380 #377 #497), a steadier PCIe probe (#485), fixes #496 #495 #498 #505 #493; v0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); v0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB (#467), fixes #460 #459 #446 #447 #457 #448 #444; v0.1.34: AMD on Windows (a ready-made HIP engine), an MCP server for AI assistants (tools/strata_mcp.py), a shorter README; v0.1.33: a portable image encoder again (#411 #412), setup recommends instead of forcing (#406 #403 #364 #384), fixes #352 #365 #369 #371 #375 #393 #408 #414; v0.1.32: split prompts faster (#340), AMD router +12%, Unsloth Q4 in setup, faster Q4 prompts, #326/#327/#342/#344 fixes, PR batch; v0.1.31: Unsloth UD-Q4_K_XL (experimental), GGUF-in-place low-RAM mode, Windows GGUF load 2x, server race + tokenizer fixes, AMD intrinsics; v0.1.30: short prompts faster (streaming from 1024 tokens), resident low-RAM variant, multi-GPU session carve, RDNA4; v0.1.29: sampled answers faster (split top-k), #154 correctness fixes; v0.1.28: the expert cache reserves the draft head, a cancelled request no longer fails the next; v0.1.27: RTX 20 (sm_75) in the ready-made engine, the HIP build without CUDA headers; v0.1.26: the draft layer's prompt pass in batches; v0.1.25: faster prompts (grouping off the copy engine, fused hyper-connection kernels), AMD HIP backend, --kv k8v4; v0.1.24: long prompts faster (QSA select on tensor cores); v0.1.23: image requests honor sampling, 8 GB cards start, batched verify window; v0.1.22: faster prompts (tensor-core attention), multi-GPU across images/steering/KV streaming; v0.1.21: multi-GPU layer split (--gpus); v0.1.20: system-prompt checkpoint, PCIe probe, hit rate; v0.1.19: penalties
+MIN_ENGINE = (0, 1, 40) # v0.1.40: --resident-experts on a layer split with the split+resident variant (#848), --kv k8v4 with KV streaming (#711); v0.1.39: the #577 file-tier regression fixed, the OpenAI Responses API (#451, Codex), a reply stuck on one token ended (#606), the head before the arena (#620), effort_position (#458), --vram-reserve hot resize opt-in (#533), PR batch; v0.1.38: prompts faster (one gather per expert group #372, the first chunk's PLE rows beside layer 0 #374, DeltaNet three heads per thread #413), --kv q4_0 prompts on tensor cores (#452), Q5_0 experts on the GPU (#473), IQ4_XS on AVX-2 (#415), unbuffered expert loading on Windows (#357 #362), --peer-device (#531), a 6 GB card starts (#496), PR batch; v0.1.37: a silent engine is restarted (#481), Windows AMD counts the desktop's VRAM (#380 #377 #497), a steadier PCIe probe (#485), fixes #496 #495 #498 #505 #493; v0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); v0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB (#467), fixes #460 #459 #446 #447 #457 #448 #444; v0.1.34: AMD on Windows (a ready-made HIP engine), an MCP server for AI assistants (tools/strata_mcp.py), a shorter README; v0.1.33: a portable image encoder again (#411 #412), setup recommends instead of forcing (#406 #403 #364 #384), fixes #352 #365 #369 #371 #375 #393 #408 #414; v0.1.32: split prompts faster (#340), AMD router +12%, Unsloth Q4 in setup, faster Q4 prompts, #326/#327/#342/#344 fixes, PR batch; v0.1.31: Unsloth UD-Q4_K_XL (experimental), GGUF-in-place low-RAM mode, Windows GGUF load 2x, server race + tokenizer fixes, AMD intrinsics; v0.1.30: short prompts faster (streaming from 1024 tokens), resident low-RAM variant, multi-GPU session carve, RDNA4; v0.1.29: sampled answers faster (split top-k), #154 correctness fixes; v0.1.28: the expert cache reserves the draft head, a cancelled request no longer fails the next; v0.1.27: RTX 20 (sm_75) in the ready-made engine, the HIP build without CUDA headers; v0.1.26: the draft layer's prompt pass in batches; v0.1.25: faster prompts (grouping off the copy engine, fused hyper-connection kernels), AMD HIP backend, --kv k8v4; v0.1.24: long prompts faster (QSA select on tensor cores); v0.1.23: image requests honor sampling, 8 GB cards start, batched verify window; v0.1.22: faster prompts (tensor-core attention), multi-GPU across images/steering/KV streaming; v0.1.21: multi-GPU layer split (--gpus); v0.1.20: system-prompt checkpoint, PCIe probe, hit rate; v0.1.19: penalties
# KV bytes per context token and attention layer: 8-bit 1056, rotated 4-bit 576, hybrid K8V4 (8-bit K, 4-bit V) 816
KV_CELL_BYTES = {"q4_0": 576, "k8v4": 816}
PY_PACKAGES = ["numpy", "jinja2", "regex", "pyyaml", "tqdm", "requests", "cmake", "ninja", "pillow", "psutil"]
diff --git a/tools/test_setup_golden.json b/tools/test_setup_golden.json
index 7431704a2..6140de75c 100644
--- a/tools/test_setup_golden.json
+++ b/tools/test_setup_golden.json
@@ -233,12 +233,17 @@
"131072",
"--kv",
"int8",
- "--mmap-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -274,12 +279,17 @@
"131072",
"--kv",
"int8",
- "--mmap-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -315,12 +325,17 @@
"131072",
"--kv",
"int8",
- "--resident-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -356,12 +371,17 @@
"131072",
"--kv",
"int8",
- "--resident-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -372,8 +392,44 @@
}
},
"32GB-2x24GB unsloth UD-Q4_K_XL": {
- "code": 1,
- "config": null
+ "code": 0,
+ "config": {
+ "args": [
+ "--pack",
+ "<T>/data/packs/unsloth-ud-q4_k_xl",
+ "--native",
+ "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf",
+ "--expert-profile",
+ "<T>/data/expert-profile.bin",
+ "--expert-cache",
+ "auto",
+ "--prefill",
+ "auto",
+ "--spec",
+ "4",
+ "--spec-min-p",
+ "0.5",
+ "--mtp",
+ "<T>/data/mtp/rt",
+ "--max-context",
+ "32768",
+ "--kv",
+ "int8",
+ "--resident-budget-gib",
+ "8"
+ ],
+ "cwd": "<T>",
+ "exe": "<T>/engine/<EXE>",
+ "gpu": 0,
+ "gpus_asked": true,
+ "lib_dirs": [
+ "<cuda>"
+ ],
+ "log": "<T>/strata-unsloth-ud-q4_k_xl.log",
+ "model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
+ "port": 8080,
+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ }
},
"47GB-2x16GB qwen IQ3_S": {
"code": 0,
@@ -401,12 +457,17 @@
"65536",
"--kv",
"int8",
- "--mmap-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -442,12 +503,17 @@
"65536",
"--kv",
"int8",
- "--resident-experts"
+ "--resident-experts",
+ "--remote-expert-opt"
],
"cwd": "<T>",
"exe": "<T>/engine/<EXE>",
- "gpu": 0,
+ "gpu": [
+ 0,
+ 1
+ ],
"gpus_asked": true,
+ "layer_split": "auto",
"lib_dirs": [
"<cuda>"
],
@@ -548,8 +614,44 @@
}
},
"47GB-2x16GB unsloth UD-Q4_K_XL": {
- "code": 1,
- "config": null
+ "code": 0,
+ "config": {
+ "args": [
+ "--pack",
+ "<T>/data/packs/unsloth-ud-q4_k_xl",
+ "--native",
+ "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf",
+ "--expert-profile",
+ "<T>/data/expert-profile.bin",
+ "--expert-cache",
+ "auto",
+ "--prefill",
+ "auto",
+ "--spec",
+ "4",
+ "--spec-min-p",
+ "0.5",
+ "--mtp",
+ "<T>/data/mtp/rt",
+ "--max-context",
+ "32768",
+ "--kv",
+ "int8",
+ "--resident-budget-gib",
+ "23"
+ ],
+ "cwd": "<T>",
+ "exe": "<T>/engine/<EXE>",
+ "gpu": 0,
+ "gpus_asked": true,
+ "lib_dirs": [
+ "<cuda>"
+ ],
+ "log": "<T>/strata-unsloth-ud-q4_k_xl.log",
+ "model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
+ "port": 8080,
+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ }
},
"64GB-1x32GB qwen IQ3_S": {
"code": 0,
diff --git a/tools/test_setup_golden.py b/tools/test_setup_golden.py
index 2f2513a4c..97e09dc6c 100644
--- a/tools/test_setup_golden.py
+++ b/tools/test_setup_golden.py
@@ -172,10 +172,10 @@ class Golden(unittest.TestCase):
def test_the_baseline_covers_every_kind_of_pc(self):
written = [k for k, v in self.golden.items() if v["code"] == 0]
self.assertGreaterEqual(len(written), 20)
- lowram_multi = self.golden["32GB-2x24GB qwen IQ3_XXS"]["config"] # #364: low-RAM, two cards -> one
+ lowram_multi = self.golden["32GB-2x24GB qwen IQ3_XXS"]["config"] # #364 -> #642: low-RAM, two cards -> both
self.assertIn("--resident-experts" if "--resident-experts" in lowram_multi["args"] else "--mmap-experts",
lowram_multi["args"])
- self.assertNotIsInstance(lowram_multi.get("gpu"), list)
+ self.assertEqual(lowram_multi.get("gpu"), [0, 1]) # 0.1.40 (#642): resident on both cards
def test_yes(self):
for key, ram, found, family, model in self.cases():
@@ -187,6 +187,8 @@ class Golden(unittest.TestCase):
def test_enter_for_every_question(self):
for key, ram, found, family, model in self.cases():
+ if "UD-Q4_K_XL" in key and ram < 48: # --yes consents to the risk; Enter declines it (the
+ continue # "Install it anyway? [n]" question), by design
with self.subTest(key):
code, out, cfg, asked = install(ram, found, argv_for(family, model), answers="")
self.assertEqual(code, 0, out[-3000:])
diff --git a/tools/test_setup_risk.py b/tools/test_setup_risk.py
index 30334cb16..62267050b 100644
--- a/tools/test_setup_risk.py
+++ b/tools/test_setup_risk.py
@@ -205,6 +205,13 @@ class BrokenEarlierConfig(unittest.TestCase):
class LowRamGpus(unittest.TestCase):
"""S2/S3 (#364 #384): one GPU recommended in the low-RAM mode, all of them when asked for."""
+ def setUp(self):
+ # the behaviour before RESIDENT_SPLIT_ENGINE (an engine from before 0.1.40); the tests of the newer engine
+ # patch MIN_ENGINE themselves, and the default (MIN_ENGINE = 0.1.40) is covered by test_setup_golden
+ p = mock.patch.object(setup, "MIN_ENGINE", (0, 1, 39))
+ p.start()
+ self.addCleanup(p.stop)
+
def test_explicit_gpus_are_kept_with_the_mapped_variant(self):
for prof, model in (("32GB-2x24GB", "IQ3_XXS"), ("32GB-2x24GB", "Q2_0"), ("47GB-2x16GB", "IQ3_XXS")):
with self.subTest(prof=prof, model=model):
@@ -285,6 +292,13 @@ class LowRamGpus(unittest.TestCase):
class StartOnSeveralGpus(unittest.TestCase):
"""A resident low-RAM config started on several GPUs reads the experts through the file cache (#364 #384)."""
+ def setUp(self):
+ # the behaviour before RESIDENT_SPLIT_ENGINE (an engine from before 0.1.40); the tests of the newer engine
+ # patch MIN_ENGINE themselves, and the default (MIN_ENGINE = 0.1.40) is covered by test_setup_golden
+ p = mock.patch.object(setup, "MIN_ENGINE", (0, 1, 39))
+ p.start()
+ self.addCleanup(p.stop)
+
def test_split_mmap(self):
cfg = {"args": ["--pack", "p", "--resident-experts", "--kv", "int8"]}
out = io.StringIO()