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++
docs: QUANTS.md speed, bound, CPU pool, dense GEMV, HC and images; MODELS.md one table for Unsloth's five files (old anchors kept); UNSLOTH_Q4/Q6 status; README
Niko1221dd5f09a50ec2
diff --git a/README.md b/README.mdindex fa44a1601..b6f769208 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 andUD-Q4_K_XL in quality. A 94 GB download. With less than ~80 GB of RAM, Strata reads part of it from the SSDwhile 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 isnot in the installer's menu.diff --git a/docs/MODELS.md b/docs/MODELS.mdindex ee750362b..ee33cf918 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+<a id="unsloth-ud-iq4_xs"></a><a id="unsloth-ud-q4_k_xl-experimental"></a>-**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-```-START-HERE.bat --setup --family unsloth --model UD-IQ4_XS-```+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).-### Unsloth UD-Q4_K_XL (experimental)+| 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 | (measured next) | - |+| **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 |-**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).+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-Q4_K_XL+START-HERE.bat --setup --family unsloth --model UD-Q5_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_XXSFor **OrcaRouter's Flash-Next Uncensored IQ3_XXS**, see the [manual compatibility setup](ORCA.md). It needs andiff --git a/docs/QUANTS.md b/docs/QUANTS.mdindex 88c6785fe..2ada1c2b0 100644--- a/docs/QUANTS.md+++ b/docs/QUANTS.md@@ -72,10 +72,79 @@ 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 || 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.+UD-IQ4_XS follows. 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) - a better median, a worse mean (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.++**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.mdindex 1f32bc387..eb833aae1 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:```shSTART-HERE.bat --setup --family unsloth --model UD-Q4_K_XL@@ -22,12 +22,13 @@ START-HERE.bat --setup --family unsloth --model UD-Q4_K_XLWhat 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 RAMbudget is kept on the split. Each card caches the experts of its own layers, and the budget holds the hottest ofthe 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 rememberedin 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.mdindex e52f639ba..03094911f 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.