diff --git a/README.de.md b/README.de.md
index fbc44a60..7724df1f 100644
--- a/README.de.md
+++ b/README.de.md
@@ -133,9 +133,10 @@ stark komprimiert. Kleinere Größen sind schneller. Größere sind etwas klüge
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** die ~4-Bit-Version von Unsloth, in der Qualität
zwischen IQ3_S und UD-Q4_K_XL. 94 GB Download. Mit weniger als ~80 GB RAM liest Strata einen Teil davon während
der Antwort von der SSD, dort ist es also langsamer (eine NVMe-SSD hilft).
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (experimentell): am nächsten am vollen
- Modell. Aber Strata liest das meiste davon während der Antwort von der SSD, deshalb schreibt es auf einem PC mit
- 64 GB nur 7-8.5 Tokens/s.
+- **[Unsloth UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL und Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):** 4 bis 8 Bit, näher am vollen Modell
+ (93-95 % das gleiche nächste Token wie Q8_0). Schnell, wenn alle Experten in den RAM passen (~88 GB für UD-Q4_K_XL
+ bis ~136 GB für Q8_0); mit weniger RAM liest Strata einen Teil davon während der Antwort von der SSD, was viel
+ langsamer ist (7-8.5 Tokens/s für UD-Q4_K_XL auf einem PC mit 64 GB).
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** Das richtest du von Hand
ein. Es steht nicht im Menü des Installers.
diff --git a/README.es.md b/README.es.md
index e8fa744d..76f108bc 100644
--- a/README.es.md
+++ b/README.es.md
@@ -130,9 +130,10 @@ tamaños pequeños son más rápidos. Los grandes son algo más inteligentes.
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** la versión de ~4 bits de Unsloth, entre IQ3_S y
UD-Q4_K_XL en calidad. Una descarga de 94 GB. Con menos de ~80 GB de RAM, Strata lee una parte desde el SSD
mientras responde, así que ahí es más lento (un SSD NVMe ayuda).
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (experimental): el más parecido al modelo
- completo. Pero Strata lee la mayor parte desde el SSD mientras responde, así que solo escribe 7-8.5 tokens/s en un
- PC con 64 GB.
+- **[Unsloth UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL y Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):** de 4 a 8 bits, más cerca del modelo completo
+ (93-95 % el mismo token siguiente que Q8_0). Rápidos cuando todos los expertos caben en la RAM (~88 GB para
+ UD-Q4_K_XL hasta ~136 GB para Q8_0); con menos RAM, Strata lee una parte desde el SSD mientras responde, lo que es
+ mucho más lento (7-8.5 tokens/s para UD-Q4_K_XL en un PC con 64 GB).
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** se instala a mano. No está en
el menú del instalador.
diff --git a/README.fr.md b/README.fr.md
index b6cccce9..4d0d3001 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -130,9 +130,10 @@ compressées. Les petites tailles sont plus rapides. Les grandes sont un peu plu
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs)** : la version ~4 bits d'Unsloth, entre IQ3_S et
UD-Q4_K_XL en qualité. Un téléchargement de 94 Go. Avec moins de ~80 Go de RAM, Strata en lit une partie depuis
le SSD pendant qu'il répond, il y est donc plus lent (un SSD NVMe aide).
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (expérimental) : le plus proche du modèle
- complet. Mais Strata en lit la plus grande partie depuis le SSD pendant qu'il répond, donc il n'écrit que
- 7-8.5 tokens/s sur un PC avec 64 Go.
+- **[Unsloth UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL et Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0) :** de 4 à 8 bits, plus proches du modèle
+ complet (93-95 % le même token suivant que Q8_0). Rapides quand tous les experts tiennent dans la RAM (~88 Go pour
+ UD-Q4_K_XL jusqu'à ~136 Go pour Q8_0) ; avec moins de RAM, Strata en lit une partie depuis le SSD pendant qu'il
+ répond, ce qui est bien plus lent (7-8.5 tokens/s pour UD-Q4_K_XL sur un PC avec 64 Go).
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs) :** vous l'installez à la main.
Il n'est pas dans le menu de l'installateur.
diff --git a/README.ja.md b/README.ja.md
index 9e9764ab..b39a47e1 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -128,8 +128,10 @@ NVIDIA でも AMD でも手順は同じです。インストーラーがカー
回答の品質をほぼ保ったまま、より短い時間で答えが返ってきます。
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** Unsloth による約 4-bit のモデルです。回答の品質は IQ3_S と UD-Q4_K_XL の中間です。
ダウンロード容量は 94 GB です。RAM が約 80 GB 未満の場合、回答の生成中にモデルの一部を SSD から読み込むため、速度が落ちます(NVMe SSD を使うと改善します)。
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)**(試験的):回答の品質がフルモデルに最も近いモデルです。
- ただし、回答の生成中にモデルの大部分を SSD から読み込むため、RAM が 64 GB の PC では毎秒 7-8.5 トークン程度の速度になります。
+- **[Unsloth UD-Q4_K_XL / UD-Q5_K_XL / UD-Q6_K_XL / Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):** 4〜8 ビットで、フルモデルにより近いモデルです
+ (次のトークンが Q8_0 と一致する割合は 93〜95%)。すべてのエキスパートが RAM に収まる場合(UD-Q4_K_XL で約 88 GB、
+ Q8_0 で約 136 GB)は高速です。RAM が足りない場合は回答の生成中に一部を SSD から読み込むため、大幅に遅くなります
+ (RAM が 64 GB の PC で UD-Q4_K_XL は毎秒 7-8.5 トークン程度)。
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** 手動でのセットアップが必要です。
インストーラーのメニューからは選べません。
diff --git a/README.md b/README.md
index fa44a160..b6f76920 100644
--- a/README.md
+++ b/README.md
@@ -131,8 +131,10 @@ sizes are faster. Larger sizes are a bit smarter.
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** Unsloth's ~4-bit version, between IQ3_S and
UD-Q4_K_XL in quality. A 94 GB download. With less than ~80 GB of RAM, Strata reads part of it from the SSD
while it answers, so it is slower there (an NVMe SSD helps).
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (experimental): the closest to the full
- model. But Strata reads most of it from the SSD while it answers, so it writes only 7-8.5 tokens/s on a 64 GB PC.
+- **[Unsloth UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL and Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):**
+ 4- to 8-bit, closer to the full model (93-95% the same next token as Q8_0). Fast where every expert fits in RAM
+ (~88 GB for UD-Q4_K_XL up to ~136 GB for Q8_0); with less RAM Strata reads part of them from the SSD while it
+ answers, which is much slower (7-8.5 tokens/s for UD-Q4_K_XL on a 64 GB PC).
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** you set it up by hand. It is
not in the installer's menu.
diff --git a/README.pt-BR.md b/README.pt-BR.md
index aa0b0ee6..0ee23f88 100644
--- a/README.pt-BR.md
+++ b/README.pt-BR.md
@@ -130,9 +130,10 @@ Os tamanhos menores são mais rápidos. Os maiores são um pouco mais inteligent
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** a versão de ~4 bits da Unsloth, entre IQ3_S e
UD-Q4_K_XL em qualidade. Um download de 94 GB. Com menos de ~80 GB de RAM, o Strata lê uma parte dele do SSD
enquanto responde, então ali ele fica mais lento (um SSD NVMe ajuda).
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (experimental): o mais próximo do modelo
- completo. Mas o Strata lê a maior parte dele do SSD enquanto responde, então ele escreve só 7-8.5 tokens/s num PC
- com 64 GB.
+- **[Unsloth UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL e Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):** de 4 a 8 bits, mais próximos do modelo
+ completo (93-95% o mesmo próximo token que o Q8_0). Rápidos quando todos os especialistas cabem na RAM (~88 GB para
+ o UD-Q4_K_XL até ~136 GB para o Q8_0); com menos RAM, o Strata lê uma parte do SSD enquanto responde, o que é bem
+ mais lento (7-8.5 tokens/s para o UD-Q4_K_XL num PC com 64 GB).
- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** você configura à mão. Ele
não está no menu do instalador.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index a54a2188..ccfc6667 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -122,8 +122,9 @@ NVIDIA 和 AMD 的步骤完全一样。安装程序会识别你的显卡,并
- **[Swift 1.5](docs/MODELS.md#swift-15):** 一个微调版本,回答前思考的时间短得多。你能更早拿到答案,质量基本不变。
- **[Unsloth UD-IQ4_XS](docs/MODELS.md#unsloth-ud-iq4_xs):** Unsloth 的约 4-bit 版本,质量介于 IQ3_S 和 UD-Q4_K_XL 之间。
下载 94 GB。内存少于约 80 GB 时,Strata 回答时要从 SSD 读取其中一部分,所以会更慢(NVMe SSD 有帮助)。
-- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)**(实验性):最接近完整模型。但 Strata
- 回答时要从 SSD 读取其中大部分内容,所以在 64 GB 的电脑上每秒只能写 7-8.5 个 token。
+- **[Unsloth UD-Q4_K_XL、UD-Q5_K_XL、UD-Q6_K_XL 和 Q8_0](docs/MODELS.md#unsloths-files-ud-iq4_xs-to-q8_0):** 4 到 8 位,更接近完整模型(下一个 token
+ 与 Q8_0 相同的比例为 93-95%)。所有专家都能放进内存时速度很快(UD-Q4_K_XL 约需 88 GB,Q8_0 约需 136 GB);内存不够时,
+ Strata 回答时要从 SSD 读取一部分,会慢很多(64 GB 的电脑上 UD-Q4_K_XL 每秒 7-8.5 个 token)。
- **[OrcaRouter 的 Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs):** 需要手动设置,不在安装程序的菜单里。
规格、下载以及各配置能装下什么:[docs/MODELS.md](docs/MODELS.md)。以后想再添加模型,运行
diff --git a/docs/MODELS.md b/docs/MODELS.md
index ee750362..ebfeb100 100644
--- a/docs/MODELS.md
+++ b/docs/MODELS.md
@@ -14,7 +14,8 @@ The installer recommends one for your PC; this page explains the choice. Back to
| **32 GB** | **Coder** | it fits 32 GB; best at code, weaker at everything else ([why](#coder)). With a 24 GB card, Q2_0 and IQ2_XS run too ([low-RAM mode](#a-big-graphics-card-and-little-ram)) and are the better pick for general use |
| **48 GB** | **IQ2_XS** (or Q2_0, the fastest) | the larger sizes do not fit |
| **64 GB** | **IQ2_XS** (recommended), or IQ3_XXS / IQ3_S | every size fits (IQ3_S with little else open) |
-| **96 GB or more** | **IQ3_S**, or [Unsloth's UD-IQ4_XS](#unsloth-ud-iq4_xs) (~4-bit) | room for the largest sizes |
+| **96 GB or more** | **IQ3_S**, or [Unsloth's UD-IQ4_XS or UD-Q4_K_XL](#unsloths-files-ud-iq4_xs-to-q8_0) (~4-bit) | room for the largest sizes |
+| **128-192 GB** | [Unsloth's UD-Q5_K_XL, UD-Q6_K_XL or Q8_0](#unsloths-files-ud-iq4_xs-to-q8_0) | every expert of the 5-8-bit files in RAM |
Not sure? Take **IQ2_XS**. The **Coder** is the one that fits a 32 GB PC, but it keeps only 256 of the 512 experts,
chosen on code data, so it is weaker outside code and in languages other than English. For general use, or whenever
@@ -117,34 +118,32 @@ More: [details](DETAILS.md#or-swift-15-a-fine-tune-that-thinks-shorter).
START-HERE.bat --setup --family swift --model IQ2_XS
```
-### Unsloth UD-IQ4_XS
+
-**Unsloth's UD-IQ4_XS** (~4-bit) is the fourth version in setup's menu (`--family unsloth`, its first size), a
-regular choice from 0.1.39: a 94 GB download with 59.5 GB of experts (IQ3_S and IQ4_NL), between IQ3_S and UD-Q4_K_XL
-in quality. Strata keeps your RAM minus 24 GB of the experts in RAM and reads the rest from the SSD while it answers:
-on a 64 GB PC part of them come from the SSD (slower; an NVMe SSD helps), from ~80 GB of RAM all of them stay in RAM.
-It needs 48 GB of RAM or more and engine 0.1.38 or newer; images are an option, as with the other models.
-Details: [UD-IQ4_XS](UNSLOTH_Q4.md#ud-iq4_xs-setup-from-0139-621).
+### Unsloth's files: UD-IQ4_XS to Q8_0
+
+The fourth version in setup's menu (`--family unsloth`) is **Unsloth's quantizations** of the same model, from ~4 to 8
+bits. They keep the original's experts at more bits than the 2-3-bit sizes above, so they need more RAM. Setup keeps
+every expert in RAM where they and 16 GB more fit (the fastest way); with less RAM it keeps as many as fit and reads
+the rest from the SSD while it answers (much slower), and for the bigger files it asks first. Images are on by default
+on an NVIDIA card of 16 GB or more (and on AMD with the CPU encoder where the experts fit in RAM).
+
+| Size | Download | Experts | RAM for all of them in RAM | Same top token as Q8_0 | AMD R9700 (32 GB): story / code / 32K prompt |
+| --- | ---: | ---: | ---: | ---: | --- |
+| **UD-IQ4_XS** (setup's first) | 94 GB | 55 GiB | ~72 GB | 88.9% | - |
+| **UD-Q4_K_XL** | 111 GB | 72 GiB | ~88 GB | 93.1% | 63 / 87 tok/s / 1,110-1,320 tok/s |
+| **UD-Q5_K_XL** | 158 GB | 92 GiB | ~108 GB | 94.6% | 57-60 / 82 / 810-1,260 |
+| **UD-Q6_K_XL** | 169 GB | 102 GiB | ~118 GB | 94.6% | 54 / 76 / 1,020 |
+| **Q8_0** | 188 GB | 120 GiB | ~136 GB | 100% (the reference) | 53-57 / 66-74 / 1,230-1,300 |
+
+For comparison, IQ3_S on the same card: 75 / 95 tok/s, 87.7% the same top token as Q8_0. The quality numbers, the
+speed bound and NVIDIA/AMD/Intel details: [QUANTS.md](QUANTS.md); the files: [UD-Q4_K_XL](UNSLOTH_Q4.md),
+[UD-Q6_K_XL](UNSLOTH_Q6.md).
```
-START-HERE.bat --setup --family unsloth --model UD-IQ4_XS
+START-HERE.bat --setup --family unsloth --model UD-Q5_K_XL
```
-### Unsloth UD-Q4_K_XL (experimental)
-
-**Unsloth's 4-bit UD-Q4_K_XL** (experimental) is the second size of the same family (`--family unsloth`): the closest
-to the full model, but a 111 GB download whose 77 GB of experts do not fit in RAM. Strata keeps your RAM minus 24 GB
-of them in RAM and reads the rest from the SSD while it answers: 7-8.5 tokens/s on a 64 GB PC with a 12 GB GPU, several
-times slower than the sizes above, and long prompts are slow. It needs 48 GB of RAM or more, an NVMe SSD and one
-NVIDIA GPU (no images yet). Details and measurements: [UD-Q4_K_XL](UNSLOTH_Q4.md).
-
-```
-START-HERE.bat --setup --family unsloth --model UD-Q4_K_XL
-```
-
-**Unsloth's 6-bit UD-Q6_K_XL** (experimental, not in setup's menu) trades more bytes per expert for less precision
-loss against the same files: 169.2 GB together, its PLE table Q8_0 (read by the engine since 0.1.38). High RAM
-machines run it without a RAM budget. Manual workflow: [UD-Q6_K_XL](UNSLOTH_Q6.md).
### OrcaRouter Uncensored IQ3_XXS
For **OrcaRouter's Flash-Next Uncensored IQ3_XXS**, see the [manual compatibility setup](ORCA.md). It needs an
diff --git a/docs/QUANTS.md b/docs/QUANTS.md
index 88c6785f..1e07626b 100644
--- a/docs/QUANTS.md
+++ b/docs/QUANTS.md
@@ -72,10 +72,107 @@ run: byte-identical rows):
| Quant | Same top token as Q8_0 | Mean KL | KL p99 | Perplexity (Q8_0: 4.052) |
|---|---:|---:|---:|---:|
+| UD-Q6_K_XL | 94.61% | 0.033 | 0.494 | 4.020 |
| UD-Q5_K_XL | 94.55% | 0.038 | 0.636 | 4.024 |
| UD-Q4_K_XL | 93.09% | 0.056 | 0.829 | 4.068 |
+| UD-IQ4_XS | 88.91% | 0.101 | 1.596 | 4.120 |
| IQ3_S | 87.69% | 0.144 | 1.975 | 4.097 |
| IQ3_XXS | 84.46% | 0.202 | 2.433 | 4.119 |
| Q2_0 | 80.60% | 0.315 | 3.643 | 4.475 |
-UD-Q6_K_XL and UD-IQ4_XS follow.
+The same file on another backend is not the same answers: UD-Q4_K_XL on an RTX A4000 (CUDA, the RAM
+budget mode of a 62 GB PC) against UD-Q4_K_XL on the R9700 is 94.5% the same top token (KL 0.038), mostly near-ties.
+
+**The prompt path:** `tools/quant_quality.py prompt` / `pcompare` score the batched prompt path the same way (20 prompts
+of 256-1,000 tokens of the set, the full vocabulary's KL of the next token's distribution against Q8_0's): every
+quant above picks Q8_0's top token after all 20 prompts. The K-quants' MMQ kernels (`STRATA_MMQ_KQ=1`) against the FP16
+path on the R9700: UD-Q4_K_XL mean KL 0.095 / median 0.0027 (FP16: 0.081 / 0.0047), UD-Q5_K_XL 0.038 / 0.00055 (FP16:
+0.025 / 0.0016), UD-Q6_K_XL 0.028 / 0.00029 (FP16: 0.029 / 0.00069) - a better median everywhere, a worse mean on Q4/Q5
+(a few prompts), so it stays opt-in.
+
+## Speed, and the bound
+
+Measured on the AMD box: one Radeon AI PRO R9700 (32 GB, capped at 225 W), EPYC 7452 (32 cores, 8 channels of
+DDR4-2400: 106 GB/s read by `rdbw` at 32 threads), every expert in RAM (setup's rule below), `--expert-cache auto`,
+40K context, 8-bit K/V, MTP drafts; `rbench.py` cases, the second of two requests; prompt speed varies between runs on
+this box by up to 2x (the range is given).
+
+| File | Short story (tok/s) | Code (tok/s) | After a 6K document | Prompt 32K (tok/s) | llama.cpp 8bb3cf0d2 (same card, `-ngl 99 --n-cpu-moe 38-48`): decode / prompt 4K |
+|---|---:|---:|---:|---:|---:|
+| IQ3_S (for comparison) | 75 | 95 | 77 | 1,555 | - |
+| UD-Q4_K_XL | 63-64 | 85-88 | 70-72 | 1,110-1,320 | 18-20 / 198-257 |
+| UD-Q5_K_XL | 57-60 | 81-83 | 62 | 810-1,260 | 17-18 / 226-270 |
+| UD-Q6_K_XL | 54 | 76 | 61 | 1,020 | - |
+| Q8_0 | 53-57 | 66-74 | 54-55 | 1,230-1,300 | 16-18 / 186-225 |
+
+**Where a decode window goes** (`STRATA_DECODE_TIMING=1 STRATA_VERIFY_PROFILE=1`, UD-Q4_K_XL, the short story, 2.0
+tokens per window, 34.3 ms per window): the bandwidth bound of what a window must read is ~12.5 ms - the routed
+experts in VRAM (~2.7 GB at 644 GB/s: 4.2 ms bound, 6.0 measured), the dense Q8_0 projections (2.84 GB: 4.4 ms bound,
+7.2 measured), the hyper-connections (0.67 GB: 1.0 ms bound, 4.0 measured), router and shared expert (0.5 GB: 0.8 ms
+bound, 3.7 measured), the head (1.05 bound, 1.26 measured), the CPU pool's experts at RAM bandwidth in parallel
+(1.2 ms), plus the MTP draft (5.8 ms measured). Decode runs at ~35-40% of that bound for every file, IQ3_S included:
+the formats' own kernels are near their bandwidth (VRAM-resident experts ~70%, the CPU pool 84-97% of RAM bandwidth,
+the head 83%); the rest is the per-window latency of the small kernels and the draft, the same for every model.
+
+The CPU pool's expert rows (`kq_cpu_bench`, the engine's own calls on T threads over 4 GB of experts):
+
+| Pair | EPYC 7452, 32 threads, 1 token per expert | 3 tokens | Ryzen 5600X, 6 threads, 1 token | 3 tokens | Xeon E5-2643 v3, 12 threads, 1 token | 3 tokens |
+|---|---:|---:|---:|---:|---:|---:|
+| Q4_K / Q5_1 | 97% of RAM bandwidth | 80% | 100% | 85% | 94% | 36% |
+| Q5_K / Q8_0 | 97% | 89% | 100% | 95% | 98% | 47% |
+| Q6_K / Q8_0 | 97% | 93% | 100% | 100% | 99% | 63% |
+| Q8_0 / Q8_0 | 96% | 90% | 100% | 100% | 99% | 64% |
+
+One token per expert (most of decode) is at the RAM bound on all three; older CPUs fall behind with several tokens per
+expert (ggml's dot decodes the weights once per token; `STRATA_KQ256=1`, bit-exact, takes 11-20% off Q4_K at 3-4
+tokens).
+
+**Dense Q8_0 GEMVs** (`q8_gemv_bench`, the engine's shapes, 2-4 columns): one row per block where it was measured
+faster, the same bits as two (R9700: 2560 -> 10240 / 6144 / 12288 at 76-86% of 644 GB/s instead of 51-80%; RTX A4000:
++1-4%, and 6144 -> 2560 at 6 columns 70% -> 76%). UD-Q4_K_XL decode +1.0-2.7% on the R9700, the same text.
+
+**NVIDIA with the RAM budget** (RTX A4000 16 GB, Xeon E5-2643 v3, 62 GB: UD-Q4_K_XL with 39 GiB of its experts in RAM,
+the rest read from an NVMe SSD at 2.1 GB/s): 14-20 tokens/s and a 4K prompt at 134-144 tokens/s, bound by the SSD;
+llama.cpp on the same PC and file 14.8-16.5 / 117-123. `STRATA_PROMPT_DIRECT=1` (Linux, opt-in) reads the prompt
+path's experts unbuffered while decode keeps the file cache: the same output (6 of 6 prompts identical with fixed
+flags), the 4K prompt 152 -> 315 tokens/s, a 20K prompt 217 -> 500, decode +2-15% (5 interleaved pairs, page cache
+dropped before each run). On a second PC with more file-cache room (the R9700 box held to 64 GB) it was mixed: a 6K
+document's prompt +8%, a 4K prompt -15% and the answer after the document -38%, because the buffered reads had left
+the document's experts in the file cache. So it stays opt-in. Reading everything unbuffered (`STRATA_UNBUFFERED_LOAD=1`) doubled the prompt too but cost
+decode 9-13%; a larger or smaller RAM budget, more fetch threads, a deeper read-ahead or a wider look-ahead did not
+help.
+
+**Several cards** (R9700 box, every expert in RAM, layer split, 2 runs each): UD-Q4_K_XL on 1 / 2 / 3 / 4 cards writes
+63 / 64 / 55 / 52 tokens/s on the short story and 88 / 96 / 123 / 96 on code, and reads a 32K prompt at 1,110 /
+1,275 / 1,987 / 2,381 tokens/s; UD-Q5_K_XL 57 / 60 / 62 / 46 and 83 / 94 / 101 / 89, prompt 1,264 / 1,177 / 1,767 /
+2,067. llama.cpp on 3 / 4 cards: 24.5 / 28.2 tokens/s and 497 / 800 (4K prompt) for UD-Q4_K_XL. More cards read
+prompts faster; for short answers the split's per-stage cost outweighs the experts it keeps in VRAM, since one card with
+every expert in RAM is already fast (`--pipeline-windows 0` helps short answers at 3-4 cards, x1.3, and costs code
+6-20%).
+
+**Every expert in RAM against the old RAM budget** (setup's new rule, R9700 box, UD-Q4_K_XL, 5 interleaved pairs, the
+old config's `--resident-budget-gib 71` holding the same experts read from the GGUF in place): decode x1.34-1.40 (short
+story 39.5 -> 53.3 tok/s, code 60.1 -> 80.4, after a 6K document 49.0 -> 68.8, 5/5 each), prompt 4K x2.07, 6K x1.58,
+32K x1.03.
+
+**The route tail skip** (`STRATA_ROUTE_TAIL_SKIP=7`, the default since 0.1.42: a missed expert every token of a window
+routes at rank 7 or lower is skipped) costs these files more than the 2-3-bit packs: UD-Q4_K_XL's yardstick KL against
+Q8_0 goes from 0.056 to 0.086 with every expert in RAM (R9700, the auto cache) and from 0.053 to 0.115 in the RAM
+budget mode (A4000, 1,500 GPU slots), for +4-10% decode in RAM and +26-67% in the budget mode (5 pairs each).
+`STRATA_ROUTE_TAIL_SKIP=0` in a config's `"env"` turns it off.
+
+**The hyper-connections on NVIDIA:** the pack's `--compat-bf16` copy of the Q8_0 HC projections rounds them to BF16
+(and doubles their bytes). `STRATA_HC_Q8=1` reads the file's own Q8_0 instead (on AMD gfx12 it is the default): on the
+A4000 UD-Q4_K_XL then comes closer to Q8_0 (yardstick KL 0.0562 -> 0.0526, p99 0.925 -> 0.716) and to the same file on
+AMD (KL 0.038 -> 0.033). Opt-in until decided.
+
+## Images
+
+Every Unsloth file reads pictures with the model's own encoder: setup's `mmproj-Qwen3.8-Flash-Next-BF16.gguf` (from
+ISTA-DASLab's repository) has the same 334 tensors, byte for byte, as Unsloth's `mmproj-BF16.gguf`. Run end to end
+with a test picture (a line of text and three coloured shapes), two questions through `/v1/chat/completions`: on an RTX
+A4000 with the GPU encoder (UD-Q4_K_XL, IQ3_XXS) and on an R9700 with the CPU encoder (UD-Q4_K_XL, UD-Q5_K_XL,
+IQ3_XXS), every answer had the text and the three shapes right, as llama.cpp's `mtmd-cli` did on the same GGUF and
+mmproj. The GPU encoder keeps ~1.3 GB of VRAM free (UD-Q4_K_XL on 16 GB: 2,331 expert slots instead of 2,741); the CPU
+encoder takes none. Setup turns images on by default for these files on an NVIDIA card of 16 GB or more, and on AMD
+(Linux, the CPU encoder) where every expert stays in RAM.
diff --git a/docs/UNSLOTH_Q4.md b/docs/UNSLOTH_Q4.md
index 1f32bc38..eb833aae 100644
--- a/docs/UNSLOTH_Q4.md
+++ b/docs/UNSLOTH_Q4.md
@@ -1,8 +1,9 @@
-# Unsloth UD-Q4_K_XL (experimental)
+# Unsloth UD-Q4_K_XL
-**Experimental.** Setup offers it from engine 0.1.32 ([below](#setup)); the manual workflow after that section works
-with engine 0.1.31 or newer. Validated on one PC: Windows 10, an RTX 5070 (12 GB), 64 GB of RAM and an AVX-512 CPU,
-on 2026-10-01.
+A regular size since MODEL-UPDATE Phase 2 (it was experimental): setup offers it from engine 0.1.32
+([below](#setup)); the manual workflow after that section works with engine 0.1.31 or newer. First validated on
+Windows 10, an RTX 5070 (12 GB), 64 GB of RAM and an AVX-512 CPU (2026-10-01); since then on an R9700 (AMD, every
+expert in RAM) and an RTX A4000 (62 GB, the RAM budget) - quality, speed and images in [QUANTS.md](QUANTS.md).
The target is Unsloth's 4-bit quantization of the same model the other packs use:
[unsloth/Qwen3.8-Flash-Next-GGUF, `UD-Q4_K_XL`, revision `38bb39e`](https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF/tree/38bb39ee97821de2c9009abb7e93950eec396e66/UD-Q4_K_XL).
@@ -13,8 +14,7 @@ the 3-bit models'.
## Setup
-`START-HERE.bat --setup` (Linux: `./setup.sh --setup`) and choose **Qwen3.8-Flash-Next (Unsloth)**, marked
-`[experimental]`; or directly:
+`START-HERE.bat --setup` (Linux: `./setup.sh --setup`) and choose **Qwen3.8-Flash-Next (Unsloth)**; or directly:
```sh
START-HERE.bat --setup --family unsloth --model UD-Q4_K_XL
@@ -22,12 +22,13 @@ START-HERE.bat --setup --family unsloth --model UD-Q4_K_XL
What setup does differently for this model:
-- It needs 48 GB of RAM or more (with less it asks, default no; `--model UD-Q4_K_XL --yes` installs it anyway) and
- engine 0.1.32 or newer (checked before anything is downloaded), and an NVIDIA
- GPU: it has not been run on AMD cards (its prompt kernels for the Q4_K / Q5_K experts are NVIDIA-only), so with
- `--backend hip` setup says so and asks before the download (#429; `--model UD-Q4_K_XL --yes` tries it). One GPU
- by default (the tested setup); on several, see the next point. No
- experimental speed projection (not tested with it). Images (#967) are an option, with a warning that this file is untested with them (reported working, #971).
+- Every expert in RAM where its 72 GiB of experts and 16 GiB more fit the RAM (~88 GB: no `--resident-budget-gib`;
+ the rule is sergqwer's fork's, MIT), else the RAM budget below. It needs 48 GB of RAM or more (with less it asks,
+ default no; `--model UD-Q4_K_XL --yes` installs it anyway) and engine 0.1.32 or newer (checked before anything is
+ downloaded). NVIDIA or AMD: it ran on an R9700 too (#429's question is gone). One GPU by default in the budget mode
+ (the tested setup); on several, see the next point. No experimental speed projection (not tested with it). Images
+ (#967) are on by default on an NVIDIA card of 16 GB or more and on AMD (CPU encoder) where every expert fits in RAM;
+ run end to end on CUDA and HIP (QUANTS.md).
- Several GPUs, with an engine that keeps the resident RAM copy on a layer split (0.1.40 and newer, #642): the RAM
budget is kept on the split. Each card caches the experts of its own layers, and the budget holds the hottest of
the rest by the whole expert profile (the experts no card holds), so any RAM works as on one card. Setup asks (one
@@ -46,8 +47,8 @@ What setup does differently for this model:
checks each one's size and SHA-256 against the table below; the check takes a few minutes once and is remembered
in the file's finish mark. A file with the wrong hash is deleted, so the next run downloads it again.
- It packs with `--compat-bf16` and never writes `experts.bin` (`--low-ram` does not apply).
-- The RAM budget is the PC's RAM less 24 GB: `--resident-budget-gib 40` on 64 GB, at most all 71 GiB of experts on
- 96 GB or more. From a 64K context up, where the KV cache moves to RAM, its size comes out of the budget. Setup's
+- The RAM budget (below ~88 GB of RAM) is the PC's RAM less 24 GB: `--resident-budget-gib 40` on 64 GB, at most all 71 GiB of experts on
+ a PC that asks for a budget. From a 64K context up, where the KV cache moves to RAM, its size comes out of the budget. Setup's
`--resident-budget-gib N` sets another one (a bigger one is kept, with a note on what it risks).
- It recommends an 8K context on a GPU under 14 GB (every GB of KV cache is a GB less of cached experts).
diff --git a/docs/UNSLOTH_Q6.md b/docs/UNSLOTH_Q6.md
index e52f639b..03094911 100644
--- a/docs/UNSLOTH_Q6.md
+++ b/docs/UNSLOTH_Q6.md
@@ -1,7 +1,9 @@
-# Unsloth UD-Q6_K_XL (experimental)
+# Unsloth UD-Q6_K_XL
-**Experimental; manual workflow only — setup does not offer this model yet.** This is Unsloth's 6-bit file of the
-same model the other packs use:
+**In setup since MODEL-UPDATE Phase 2** (`START-HERE.bat --setup --family unsloth --model UD-Q6_K_XL`, engine 0.1.44 or
+newer: every expert in RAM from ~118 GB, else it asks and keeps a RAM budget; quality, speed and images in
+[QUANTS.md](QUANTS.md); UD-Q5_K_XL and Q8_0 likewise). The manual workflow below still works. This is Unsloth's 6-bit
+file of the same model the other packs use:
[unsloth/Qwen3.8-Flash-Next-GGUF, `UD-Q6_K_XL`, revision `38bb39e`](https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF/tree/38bb39ee97821de2c9009abb7e93950eec396e66/UD-Q6_K_XL).
Build it for engine 0.1.38 or newer (earlier engines read `per_layer_token_embd.weight` in IQ4_NL, Q5_0 or FP8 only,
below). UD-Q4_K_XL's manual workflow asks nothing of setup, and neither does this one.
diff --git a/include/strata/core/expert_source.hpp b/include/strata/core/expert_source.hpp
index 9ea48175..4f80972a 100644
--- a/include/strata/core/expert_source.hpp
+++ b/include/strata/core/expert_source.hpp
@@ -660,6 +660,10 @@ public:
/// expert bytes outside it; switches either way (startup only, nothing reading). Returns whether unbuffered.
bool recheck_unbuffered(std::string& why);
bool unbuffered() const { return !direct_.empty(); }
+ /// MODEL-UPDATE round 2 (Linux, opt-in STRATA_PROMPT_DIRECT=1): with the file tier read through the file cache (the
+ /// decode's choice: re-routed experts come back from it), the prompt path's batched stager reads (copy_blobs) go
+ /// unbuffered instead - the same bytes, read in merged O_DIRECT requests. False when not opened (and why).
+ bool open_prompt_direct(std::string& why);
/// pp-opt (Windows, experts.bin, unbuffered): close the mapped view once startup no longer needs it. NTFS runs
/// the unbuffered reads of a mapped file one at a time - on a PCIe 4 NVMe (WD SN580) 2 MiB reads at queue depth
/// 32 measured 2.35 GB/s with experts.bin mapped and 3.57 GB/s without. After this every file read goes through
@@ -765,6 +769,7 @@ private:
/// Windows: experts.bin mapped again as `open` maps it (begin/end_startup_unbuffered).
bool map_view(std::string& why);
std::vector paths_; ///< the mapped files, as maps_
+ std::vector pdirect_; ///< open_prompt_direct: O_DIRECT fds for copy_blobs only
std::vector direct_; ///< #286: per file, an unbuffered handle (Windows) or O_DIRECT fd (Linux)
std::vector role_file_; ///< 3 x n_layers: index into maps_ / direct_
/// blobs assembled in the stage buffers (`blob` hands those out): the GGUF in place, or any unbuffered source
diff --git a/setup.py b/setup.py
index 98848c48..8b80704e 100644
--- a/setup.py
+++ b/setup.py
@@ -227,9 +227,9 @@ MODELS = {
# the quality yardstick and the decode/prompt numbers in docs/QUANTS.md), so it is no longer NVIDIA-only (#429).
"UD-Q4_K_XL": {"about": "4-bit (Unsloth Dynamic): K-quant experts, between UD-IQ4_XS and UD-Q5_K_XL in quality",
"download_gb": 111.3, "ram_gb": 48, "arena_gb": 77.0, "families": ("unsloth",), "budget": True,
- # #967: images are allowed (the same base model and image encoder as UD-IQ4_XS), with a warning:
- # reported working by hand (#967, #971), not tested by us on this file
- "vision": True, "vision_untested": True},
+ # #967 / MODEL-UPDATE: images run end to end with this file (CUDA: RTX A4000, GPU encoder; HIP:
+ # R9700, CPU encoder; the test picture's text and shapes as the IQ3_XXS pack answers them)
+ "vision": True},
# MODEL-UPDATE: Unsloth's larger files (docs/QUANTS.md). The same GGUF-in-place mode: every expert in RAM where it
# fits with UNSLOTH_RESIDENT_BESIDE_GB more (unsloth_budget), else a RAM budget of them and the rest read from the
# SSD while it answers - so "ram_gb" is the all-in-RAM need, and below it setup asks first (default no). Their
@@ -1733,6 +1733,22 @@ def unsloth_budget(model, ram, gpu=None, asked=None) -> bool:
ram < MODELS[model]["arena_gb"] / 1.073741824 + UNSLOTH_RESIDENT_BESIDE_GB
+UNSLOTH_IMAGES_MIN_VRAM_GB = 15.5 # a 16 GB card: the GPU encoder's ~1.4 GB is under a tenth of it
+
+
+def unsloth_images_default(model, family, ram, gpu=None) -> bool:
+ """MODEL-UPDATE: is "images on" setup's default answer for this choice: Unsloth's files (the same base model and
+ image encoder as ISTA's, run end to end on CUDA and on HIP), on an NVIDIA card of 16 GB or more (the GPU encoder
+ keeps ~1.4 GB free) or, on AMD, wherever every expert stays in RAM (the CPU encoder takes no VRAM). Smaller cards
+ keep "no" as the default (asked, as for the other families)."""
+ if family != "unsloth" or not MODELS.get(model, {}).get("budget") or MODELS[model].get("vision") is False:
+ return False
+ g = gpu or {}
+ if str(g.get("arch", "")).startswith("gfx"):
+ return not unsloth_budget(model, ram, g) and not WIN
+ return g.get("vram_gb", 0.0) >= UNSLOTH_IMAGES_MIN_VRAM_GB
+
+
UMA_EXPERTS = 24576 # the Flash-Next model's experts (48 layers x 512): the most an expert cache can hold
@@ -5504,14 +5520,19 @@ def main() -> int:
if a.vision not in (None, "no", "none"):
warn(f"images are not available with {model} yet: off")
elif hip:
- vision = hip_vision(a.vision)
+ # MODEL-UPDATE: Unsloth's files on AMD (Linux) read images with the CPU encoder by default where their experts
+ # all stay in RAM (it takes no VRAM; measured on an R9700 with UD-Q4_K_XL and UD-Q5_K_XL, docs/QUANTS.md)
+ vision = hip_vision(a.vision if a.vision is not None or not unsloth_images_default(model, family, ram, gpu)
+ else "cpu")
elif a.vision:
vision = {"yes": "gpu", "no": "none"}.get(a.vision, a.vision)
else:
say()
say(" Images: the model can also read pictures (screenshots, photos, scanned pages). This adds a 0.9 GB")
say(" download and keeps ~1.4 GB of VRAM free for the image encoder, so text is a few % slower.")
- vision = "gpu" if ask("Do you want images?", ["y", "n"], "n", a.yes) == "y" else "none"
+ # MODEL-UPDATE: on by default for Unsloth's files on a card with room for the encoder (16 GB and more)
+ default = "y" if unsloth_images_default(model, family, ram, gpu) else "n"
+ vision = "gpu" if ask("Do you want images?", ["y", "n"], default, a.yes) == "y" else "none"
ok("images: " + {"none": "off", "gpu": "on", "cpu": "on (encoder on the CPU)"}[vision])
if vision != "none" and MODELS[model].get("vision_untested"):
warn(f"images with {model} are untested: users report them working, but we have not run this file with "
diff --git a/src/core/expert_source.cpp b/src/core/expert_source.cpp
index 16b67702..f8d9212b 100644
--- a/src/core/expert_source.cpp
+++ b/src/core/expert_source.cpp
@@ -1033,6 +1033,8 @@ void FileExpertSource::close() {
paths_.clear();
for (void* h : direct_) close_direct(h);
direct_.clear();
+ for (void* h : pdirect_) close_direct(h);
+ pdirect_.clear();
{
std::lock_guard lk(stage_mu_);
// the buffers' last copies end before they are freed (#1237)
@@ -1631,6 +1633,28 @@ bool FileExpertSource::open_direct(std::string& why) {
#endif
}
+bool FileExpertSource::open_prompt_direct(std::string& why) {
+#if defined(__linux__)
+ if (base_ == nullptr || paths_.empty()) { why = "no expert files open"; return false; }
+ if (!direct_.empty()) { why = "the file tier reads unbuffered already"; return false; }
+ if (!pdirect_.empty()) return true;
+ for (const std::string& path : paths_) {
+ const int fd = ::open(path.c_str(), O_RDONLY | O_DIRECT | O_CLOEXEC);
+ if (fd < 0) {
+ why = "cannot open " + path + " with O_DIRECT (" + std::strerror(errno) + ")";
+ for (void* d : pdirect_) close_direct(d);
+ pdirect_.clear();
+ return false;
+ }
+ pdirect_.push_back((void*) (intptr_t) fd);
+ }
+ return true;
+#else
+ why = "Linux only (NTFS serves unbuffered reads of a mapped file one at a time)";
+ return false;
+#endif
+}
+
bool FileExpertSource::set_unbuffered(uint64_t ram_bytes, std::string& why) {
#if defined(_WIN32) || defined(__linux__)
if (base_ == nullptr || paths_.empty() || !direct_.empty()) {
@@ -2041,7 +2065,7 @@ bool FileExpertSource::read_direct(const Fill* fills, size_t n) const {
continue;
}
}
- sc.req.push_back({(int) (intptr_t) direct_[(size_t) x.file], x.a0, x.size, total});
+ sc.req.push_back({(int) (intptr_t) (direct_.empty() ? pdirect_ : direct_)[(size_t) x.file], x.a0, x.size, total});
total += x.size;
last_file = x.file;
x.req = sc.req.size() - 1;
@@ -2499,7 +2523,7 @@ bool FileExpertSource::copy_blob(int64_t layer, int64_t expert, uint8_t* dst) {
// copy_blob made one ~2 MB request each - and NTFS serves the unbuffered reads of a mapped file one at a time, so the
// request size is what sets the rate (see read_direct). The blobs the RAM copy holds are copied as before.
bool FileExpertSource::copy_blobs(const int32_t* layers, const int32_t* experts, uint8_t* const* dst, size_t n) {
- if (direct_.empty() || n <= 1) return ExpertSource::copy_blobs(layers, experts, dst, n);
+ if ((direct_.empty() && pdirect_.empty()) || n <= 1) return ExpertSource::copy_blobs(layers, experts, dst, n);
thread_local std::vector fills;
fills.clear();
uint64_t bytes = 0;
diff --git a/src/kernels/cuda/iq_kernels.cu b/src/kernels/cuda/iq_kernels.cu
index 439119f5..c1542473 100644
--- a/src/kernels/cuda/iq_kernels.cu
+++ b/src/kernels/cuda/iq_kernels.cu
@@ -5,6 +5,7 @@
// MIT license, third_party/ggml/LICENSE). The block structs and codebook grids come from its ggml-common.h,
// included unchanged.
#include "strata/kernels/iq_kernels.hpp"
+#include "strata/kernels/gfx_arch.hpp"
#include "strata/kernels/dp4a.hpp"
#include "strata/kernels/q8_1_finite.hpp"
#include "s26_tsum.cuh"
@@ -3480,7 +3481,23 @@ void native_expert_grouped(const NativeExpertLayout& L, const unsigned long long
return;
}
// stream B: UD-Q4_K_XL's Q4_K / Q5_K gate/up and Q5_1 / Q8_0 down (see S27 above)
- static const bool v2k = [] { const char* v = std::getenv("STRATA_EXPERT_V2K"); return v && v[0] == '1'; }();
+ // MODEL-UPDATE: on by default on gfx12 (every output the old kernels' bits; R9700, UD-Q4_K_XL decode, 5 interleaved
+ // pairs: story +1.2% 5/5, code +0.8% 5/5, after 6K +0.2% 4/5); STRATA_EXPERT_V2K=0 turns it off, =1 turns it on
+ // elsewhere (not measured on other cards)
+ static const bool v2k = [] {
+ const char* v = std::getenv("STRATA_EXPERT_V2K");
+ if (v != nullptr && v[0] != '\0') return v[0] == '1';
+#if defined(__HIPCC__) && !defined(STRATA_HIP_GFX906)
+ int dev = 0;
+ cudaDeviceProp p;
+ const bool g12 = cudaGetDevice(&dev) == cudaSuccess && cudaGetDeviceProperties(&p, dev) == cudaSuccess &&
+ strata::kernels::gfx_arch_is_gfx12(p.gcnArchName);
+ (void) cudaGetLastError();
+ return g12;
+#else
+ return false;
+#endif
+ }();
if (v2k && (L.gu_type == 12 || L.gu_type == 13) && (L.d_type == 7 || L.d_type == 8) && L.n_embd == 2560 &&
L.n_ff == 640) {
static const bool ts = [] { const char* v = std::getenv("STRATA_TSUM"); return v && v[0] == '1'; }();
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index d328928f..75955c55 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -7011,6 +7011,15 @@ int main(int argc, char** argv) {
const bool ub = src.recheck_unbuffered(why);
std::fprintf(stderr, "strata generate: the file tier reads %s%s (%s)\n",
ub ? "unbuffered" : "through the file cache", ub == was ? "" : " (changed)", why.c_str());
+ // MODEL-UPDATE round 2 (opt-in STRATA_PROMPT_DIRECT=1): the prompt path's batched reads unbuffered while
+ // decode keeps the file cache (z440, UD-Q4_K_XL, 39 GiB budget: all-unbuffered doubled the 6K prompt but
+ // cost decode 9-13%). The same bytes either way.
+ if (!ub && [] { const char* v = std::getenv("STRATA_PROMPT_DIRECT"); return v != nullptr && v[0] == '1'; }()) {
+ std::string pw;
+ const bool pd = src.open_prompt_direct(pw);
+ std::fprintf(stderr, "strata generate: the prompt path's expert reads %s\n",
+ pd ? "go unbuffered (STRATA_PROMPT_DIRECT=1)" : ("stay buffered: " + pw).c_str());
+ }
}
#endif
}
diff --git a/tools/quant_quality.py b/tools/quant_quality.py
index 07bf1789..10065e3a 100644
--- a/tools/quant_quality.py
+++ b/tools/quant_quality.py
@@ -41,7 +41,7 @@ FIXED_ENV = {"STRATA_ROUTE_TAIL_SKIP": "0", "STRATA_PREFILL_CPU_SHARE": "0", "ST
# config args the yardstick replaces (value-taking) or drops (flags)
DROP_VALUE = {"--expert-cache", "--adapt-every", "--pcie-frac", "--suffix-draft", "--prompt-cache", "--max-context",
"--prefill", "--prompt-cache-every", "--short-read", "--conversation-cache-mib", "--eos-ids",
- "--resident-budget-gib", "--kv", "--kv-resident"}
+ "--kv", "--kv-resident"} # (--resident-budget-gib stays: a PC whose RAM does not hold the experts)
DROP_FLAG = {"--serve", "--vision", "--resident-experts", "--resident-cpu-experts"}
@@ -81,7 +81,7 @@ def mem_available_gb() -> float:
return float("inf")
-def engine_args(cfg: dict, gpu_experts: bool, seg_tokens: int) -> list[str]:
+def engine_args(cfg: dict, gpu_experts, seg_tokens: int) -> list[str]:
base, out, i = list(cfg["args"]), [], 0
while i < len(base):
x = base[i]
@@ -95,7 +95,7 @@ def engine_args(cfg: dict, gpu_experts: bool, seg_tokens: int) -> list[str]:
i += 1
fixed = list(FIXED)
if gpu_experts:
- fixed[1] = "1500"
+ fixed[1] = gpu_experts if isinstance(gpu_experts, str) else "1500"
return [cfg["exe"], "--serve", *out, *fixed, "--max-context", str(seg_tokens + 512),
"--short-read", str(seg_tokens + 64), "--prefill", "512"]
@@ -351,7 +351,8 @@ def main() -> int:
p.add_argument("--out", required=True)
p.add_argument("--ids", default=str(SET_DIR / "set.ids.json"))
p.add_argument("--env", action="append")
- p.add_argument("--gpu-experts", action="store_true", help="--expert-cache 1500 instead of one slot (the experts on the GPU kernels)")
+ p.add_argument("--gpu-experts", nargs="?", const=True, default=False,
+ help="--expert-cache 1500 (or the N given, e.g. auto) instead of one slot (the experts on the GPU kernels)")
p.add_argument("--min-free-gb", type=float, default=16)
p.add_argument("--wrap", help="a command prefix for the engine, e.g. 'systemd-run --user --scope -p MemoryMax=200G'")
p = sub.add_parser("prompt", help="the batched prompt path's next-token logits after 20 prompts (a directory)")
diff --git a/tools/test_setup_golden.json b/tools/test_setup_golden.json
index 39bb0672..a3b089d4 100644
--- a/tools/test_setup_golden.json
+++ b/tools/test_setup_golden.json
@@ -192,7 +192,10 @@
"--kv",
"int8",
"--kv-resident",
- "32768"
+ "32768",
+ "--vision",
+ "--vram-reserve-mib",
+ "700"
],
"cwd": "",
"exe": "/engine/",
@@ -204,7 +207,14 @@
"log": "/strata-unsloth-ud-q4_k_xl.log",
"model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
"port": 8080,
- "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer",
+ "vision": {
+ "exe": "/engine/strata-vision.exe",
+ "gpu": true,
+ "max_tokens": 1024,
+ "mmproj": "/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"
+ }
}
},
"32GB-2x24GB qwen IQ3_S": {
@@ -412,7 +422,10 @@
"--kv",
"int8",
"--resident-budget-gib",
- "8"
+ "8",
+ "--vision",
+ "--vram-reserve-mib",
+ "700"
],
"cwd": "",
"exe": "/engine/",
@@ -424,7 +437,14 @@
"log": "/strata-unsloth-ud-q4_k_xl.log",
"model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
"port": 8080,
- "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer",
+ "vision": {
+ "exe": "/engine/strata-vision.exe",
+ "gpu": true,
+ "max_tokens": 1024,
+ "mmproj": "/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"
+ }
}
},
"47GB-2x16GB qwen IQ3_S": {
@@ -630,7 +650,10 @@
"--kv",
"int8",
"--resident-budget-gib",
- "23"
+ "23",
+ "--vision",
+ "--vram-reserve-mib",
+ "700"
],
"cwd": "",
"exe": "/engine/",
@@ -642,7 +665,14 @@
"log": "/strata-unsloth-ud-q4_k_xl.log",
"model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
"port": 8080,
- "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer",
+ "vision": {
+ "exe": "/engine/strata-vision.exe",
+ "gpu": true,
+ "max_tokens": 1024,
+ "mmproj": "/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"
+ }
}
},
"64GB-1x32GB qwen IQ3_S": {
@@ -836,7 +866,10 @@
"--kv",
"int8",
"--resident-budget-gib",
- "40"
+ "40",
+ "--vision",
+ "--vram-reserve-mib",
+ "700"
],
"cwd": "",
"exe": "/engine/",
@@ -848,7 +881,14 @@
"log": "/strata-unsloth-ud-q4_k_xl.log",
"model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
"port": 8080,
- "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer",
+ "vision": {
+ "exe": "/engine/strata-vision.exe",
+ "gpu": true,
+ "max_tokens": 1024,
+ "mmproj": "/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"
+ }
}
},
"96GB-1x16GB qwen IQ3_S": {
@@ -1044,7 +1084,10 @@
"--kv",
"int8",
"--kv-resident",
- "32768"
+ "32768",
+ "--vision",
+ "--vram-reserve-mib",
+ "700"
],
"cwd": "",
"exe": "/engine/",
@@ -1056,7 +1099,14 @@
"log": "/strata-unsloth-ud-q4_k_xl.log",
"model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
"port": 8080,
- "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer"
+ "tokenizer": "/data/packs/unsloth-ud-q4_k_xl/tokenizer",
+ "vision": {
+ "exe": "/engine/strata-vision.exe",
+ "gpu": true,
+ "max_tokens": 1024,
+ "mmproj": "/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"
+ }
}
}
}
diff --git a/tools/test_setup_unsloth.py b/tools/test_setup_unsloth.py
index 5acb150b..59a403d8 100644
--- a/tools/test_setup_unsloth.py
+++ b/tools/test_setup_unsloth.py
@@ -336,13 +336,13 @@ class Main(Base):
self.assertIsNone(cfg)
def test_one_gpu_and_images_with_a_warning(self):
- """#967: images are allowed with UD-Q4_K_XL, said to be untested."""
+ """#967: images are allowed with UD-Q4_K_XL (tested end to end since MODEL-UPDATE)."""
code, out, cfg = self.main(["--context", "8192", "--vision", "yes", "--low-ram", "on"], n_gpus=2)
self.assertEqual(code, 0, out)
self.assertIn("(NVIDIA GeForce RTX 5070, 12 GB) only (--gpus 0,1 shares it across", out)
self.assertNotIn("images are not available", out)
self.assertIn("images: on", out)
- self.assertIn("images with UD-Q4_K_XL are untested", out)
+ self.assertNotIn("are untested", out) # MODEL-UPDATE: run end to end (CUDA, HIP)
self.assertIn("--low-ram on does not apply", out)
self.assertNotIn("layer_split", cfg)
self.assertIn("--vision", cfg["args"])