REGINA-106 (step5-1080ti): on the 1080 Ti host every expert miss computed
by the CPU pool degraded the logits (iq3-test20 at --expert-cache 2000
--pcie-frac 0: 51/64 top-1, mean KL 0.84; Q4 54/64, KL 0.23), DMA misses
were correct, one worker reproduced it bit for bit, --spec 1 changed it.
expert_pool_dispatch_multi (expert_source.cpp) pulled in the canonical
widths and read token t's activation at t * H (2560) and wrote its output
row at i * H, while the verify window publishes both at the layer's width
(2048): every token after the first of a group used another token's
activation and landed in another row. The dispatch now takes the width
from the layer's NativeFmt (the canonical pack keeps H), refuses a layer
the pack lacks or a width above the compiled buffers. After the fix on
VM 211 (Pascal, Zen 1): iq3-test20 / prime / psim with CPU misses 64/64,
64/64, 64/64, mean KL 1.4e-3 / 4.8e-3 / 2.0e-3; q4-test20 62/64 KL 6e-3,
q4-prime 64/64 KL 8e-4. The Codex review of 22d72e6 named this spot
(the pool test covers the pool phases, not this dispatcher).
The VRAM planner (generate.cpp), also from that review: without a
draft_vocab.bin the drafter scores with the target's head and allocates no
copy (mtp.cpp), so only its logits are charged (515 MiB returned to the
expert cache at Q4); under --kv k8v4 the drafter keeps plain INT8 K/V and
is charged as such; a context the plan lowered is now the context the
engine allocates for, said in the log.
The RAM tier: when the resident arena exceeds the host's memory limit or
available RAM (the plan's 12 GiB rung: the 4090 sweep's --ram-cap 12
points died in ArenaExpertSource), the engine takes the mapped mode with
the hottest experts copied into RAM by profile rank (--resident-experts)
itself, which is the split its plan line already assumed. The multi-GPU
expert helpers (--peer-device, --remote-expert-opt) keep the canonical
width and are refused for this model with a message.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
UnbiasedStrata
Strata's inference engine and llama.cpp's tokenizer, chat-template and
HTTP code, built into one binary that serves Qwen3.8-Flash-Next (one 24 GB+ card, 128 GB RAM) and
Qwen3.6-35B-A3B (any single NVIDIA card from 6 to 32 GB, Pascal or newer) over an OpenAI-style API. No
network is needed to build or run it: rsync the source, run make build, start the binary. No Python, no
installer.
Requirements
| Build | Run | |
|---|---|---|
| Network access | no | no |
| CMake 3.24+, C++20 compiler (tested: g++ 13.3) | yes | no |
| CUDA | toolkit 12.x (tested: 12.4 and 12.8; 12.8+ for RTX 50; CUDA 13 dropped Pascal and Volta) | libcudart.so.12, libcublas.so.12, libcublasLt.so.12 and the NVIDIA driver |
Hardware: Linux, x86-64 with AVX2, one NVIDIA card.
| Model | Card | RAM |
|---|---|---|
| Qwen3.8-Flash-Next | 24 GB or more (RTX 30, 40 or 50) | 128 GB |
| Qwen3.6-35B-A3B | 6 to 32 GB, Pascal (GTX 10 series, sm_61) or newer, one card | 12 GB at 11 GB of VRAM; less VRAM needs more RAM or a faster disk (the sizing rule below) |
The model can be on a local disk or on a network volume; what the card does not hold is read into RAM at start, and what RAM does not hold is read from the file on a miss, so a slow store costs start-up time and, on the small cards, decode speed.
Build
rsync -a UnbiasedStrata/ host:UnbiasedStrata/ # or: git clone, then git submodule update --init
ssh host 'cd UnbiasedStrata && make build' # produces build/unbiased-strata
The tree is 6 MB plus the pinned llama.cpp submodule in third_party/ (about 170 MB checked out). The
build fetches nothing. make build JOBS=N sets the job count; CUDA_ARCHS defaults to
61;70;75;86;89;120, one binary for every card from Pascal up, minus any architecture the installed
nvcc cannot compile (12.4 has no 120, 13 has no 61 or 70; the build says what it dropped). make build CUDA_ARCHS=61 builds for one card in about 3 minutes. An architecture below 75 in the list turns on
STRATA_EXPERIMENTAL_SM60, the Pascal/Volta build (FP32 and dp4a paths; no tensor cores). The
chat-parser patch in patches/ is applied to the submodule at configure time.
Run
# Qwen3.8-Flash-Next
./unbiased-strata --model /models/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf \
--pack /models/pack-iq3-xxs --mtp /models/mtp
# Qwen3.6-35B-A3B at the full 262,144-token context (the engine sizes itself to the card; see Sizing)
./unbiased-strata --model /models/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf \
--pack /models/qwen36-q4 --mtp /models/qwen36-mtp-draft --ctx 262144 -- --kv q4_0
| Endpoints | POST /v1/chat/completions (streaming or not), GET /v1/models, GET /health, on 127.0.0.1:8080 |
| Options | --ctx N (32768), --threads N (default: physical cores, or half the CPU quota in a container), --host, --port, --mmproj PATH, --vision-tokens N (1024); engine flags after --: --kv fp16|q4_0|int8, --vram-cap MiB and --ram-cap GiB (plan as a smaller card or host), --expert-cache N, --prompt-cache N (checkpoints kept between requests) |
| Sampling | greedy unless temperature > 0 |
| Reasoning | returned as reasoning_content; "reasoning_effort": "none" turns it off |
| Tools | OpenAI format (tools, tool_calls) |
| Images | with --mmproj, OpenAI image_url parts holding a base64 data:image/... URL (PNG, JPEG, BMP or GIF), several per message |
| Not supported | more than one GPU, batch requests |
Images: --mmproj /models/mmproj-Qwen3.8-Flash-Next-BF16.gguf loads the model's own vision encoder (from the same
Hugging Face repository as the GGUF; 0.9 GB). The encoder runs on the CPU, so the card keeps its expert cache:
about 25 s and 1,000 prompt tokens for a 1-megapixel screenshot on 8 threads, 0.2 s for a small image; a repeated
image is served from a cache. GET /v1/models then lists image under input_modalities. Without --mmproj an
image request is refused with a 400.
The engine runs as a child process. When it exits or its stall watchdog fires, the front end exits with a failure
status, for a supervisor such as systemd (Restart=on-failure) to restart; /health and /v1/models answer 503
while the engine is down. Reasoning streams as it is generated; content and tool calls are sent once the whole
message is parsed, so a partial tool-call JSON never changes arguments already sent. make test-frontend checks
the child handling and the protocol without a model; make test-chat-parser MODEL=<shard 1> checks the chat
template and tool-call parsing against the real GGUF.
The supported models
Qwen3.8-Flash-Next
Qwen3.8-Flash-Next (125B parameters, mixture of experts), the full model at IQ3_XXS quantization, from
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF,
directory IQ3_XXS, revision ed59f920. No other model, quantization or pruned variant is supported. The
draft (MTP) head is required.
Everything below must be on disk before start. Nothing is fetched.
| What | Size | SHA-256 or source |
|---|---|---|
Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf (weights) |
47.04 GB | 219ea929900dfa9ef091f3aa473fdba6874b65fcb36526d7d851ac9e95856d15 |
Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf (n-gram table), beside shard 1 |
28.80 GB | 316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113 |
Pack: index.txt, dense.bin, native_experts.txt, conversions.json, expert-profile.bin |
1.5 GB | made once with upstream's tools; not published yet |
Draft head: experts.bin, dense.bin, dense.txt, draft_vocab.bin |
0.8 GB | made once with upstream's tools; not published yet |
About 78 GB in total. The commands that make the pack and draft head, and the SHA-256 of every file they produce, are in UPSTREAM.md.
Qwen3.6-35B-A3B
Qwen3.6-35B-A3B (35B parameters, 3B active: 40 layers, 256 experts of which 8 route per token, 30 Gated
DeltaNet layers and 10 full-attention layers, 262,144-token context), unsloth's UD quantizations from
unsloth/Qwen3.6-35B-A3B-GGUF and
unsloth/Qwen3.6-35B-A3B-MTP-GGUF. Two
quantizations, with the pack and draft pack made by this repository's own tools (tools/iq_pack.py,
tools/make_profile.py, tools/mtp_qwen36_pack.py; commands and every file's SHA-256 in
UPSTREAM.md):
| What | Size | SHA-256 |
|---|---|---|
Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf, the default (K-quants: the fast AVX2 path for the experts the CPU computes) |
22.36 GB | QWEN36_Q4_PLAIN_SHA |
Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf from the -MTP repository (the same trunk plus the draft block blk.40; serves as the model file too) |
22.85 GB | 55983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1 |
Qwen3.6-35B-A3B-UD-IQ3_XXS.gguf, for 6 and 8 GB cards |
13.21 GB | 9c964e657212fea1f24905dd7b0a89b82fd807d19fab0b41da14251b07b88fbe |
Pack qwen36-q4/ or qwen36-iq3/ (index.txt, dense.bin, native_experts.txt, conversions.json, expert-profile.bin, tokenizer/) |
65 MB | per file in UPSTREAM.md |
Draft pack qwen36-mtp-draft/ (experts.bin, dense.bin, dense.txt, native_experts.txt, mtp.json, draft_vocab.bin), cut from the -MTP file's draft block; serves both quantizations |
0.5 GB | per file in UPSTREAM.md |
No other Qwen3.6 file is accepted: the IQ4_XS-MTP file's draft block (Q3_K experts) and the 27B dense model
are refused by name. The vision encoder (mmproj) is not wired for this model yet.
Sizing
At start the engine prints its plan for the card it finds: the fixed set for the requested context (the
dense weights, the drafter, the KV cache, the session, a reserve), then every remaining megabyte as expert
slots, filled by the route-trace profile's rank. If the fixed set does not fit, the KV cache is streamed
to RAM above a resident window, then the context is lowered toward 131,072, then the engine refuses with
the numbers and suggests the IQ3_XXS file. It never silently picks a shorter context. The experts that do
not fit in VRAM are read from pinned RAM when the host has it, else from the file on a miss; /health
reports the VRAM hits, RAM reads and file reads per request. --vram-cap and --ram-cap make a big card
plan like a small one.
| VRAM | Q4_K_XL at 262,144, q4_0 KV: fixed set, experts resident | IQ3_XXS: fixed set, experts resident |
|---|---|---|
| 24 GB (RTX 4090) | 4,823 MiB; 9,980 of 10,240 (97%) | 4,331 MiB; all 10,240, 8.8 GB spare |
| 11 GB (GTX 1080 Ti) | 4,461 MiB; 3,575 (35%) | 4,019 MiB; 6,748 (66%) |
| 8 GB | 1,949 (19%) | 3,873 (38%) |
| 6 GB | 598 (6%) | 1,486 (15%) |
The 24 GB row is measured; the others are the planner's figures from the same files under --vram-cap
(docs/qwen36-port/step2-notes.md section 5, step4-pack.md section 5).
Status
Checked on one machine: RTX 3090, 32 vCPUs of an EPYC 7763, 125 GB RAM, CUDA 12.8, in a container.
| Build | from an rsynced tree with no git metadata; the binary holds no download code |
| Serving | chat, streaming, reasoning, tool calls; a coding agent (pi) wrote and ran a program through it |
| RTX 4090 (24 GB), 82 GB RAM, Debian, bare metal | serving with tool calls and images, through pi (file attachments and clipboard paste) and curl, over several days of use |
| Start from local disk | 19 s with the files in the OS file cache |
| Start from a network volume | 12 min for 76 GB (S3-backed RunPod volume, 120 to 330 MB/s). The volume refused reads twice with "cannot allocate memory"; the loader retried and went on |
| Not tested | RTX 50 cards; a cold start from local disk |
Qwen3.6-35B-A3B, checked on the RTX 4090 (VM, 16 vCPU i9-9900K, 62 GB RAM, CUDA 12.4):
| Correctness | the engine's logits held to a numpy reference and to llama.cpp at every position of the real files (greedy top-1 64/64 on three prompts at IQ3_XXS, 61-64/64 at Q4_K_XL, mean KL 1e-3 to 7e-3); the expert-miss path (what every card below 24 GB runs on) held with the same prompts under --vram-cap |
| Serving | chat, streaming, reasoning, tool calls, multi-turn prompt checkpoints at 262,144 context; both quantizations |
| Speed, short answers | 320-360 tokens/s with the draft head (IQ3_XXS and Q4_K_XL, every expert resident); 169 tokens/s at IQ3_XXS under an 11 GB cap (56% of the experts resident) |
| The ladder (6 to 24 GB, both quantizations, against the llama.cpp baseline) | measured on the 4090 under --vram-cap; the table and plots are in the regina repository's analysis/qwen36-35b-single-gpu-ladder/engine-4090/ |
| Pascal | built and unit-tested on a GTX 1080 Ti (sm_61: every kernel parity test, the pack, the drafter, the verify window); serving there is not measured yet (the card was in use) |
Speed, one run of each, same machine and model files, greedy sampling, reasoning off. Generation is the mean of 8 different prompts of 400 tokens; prompt speed is the mean of 2 different prompts of about 20,000 tokens.
| Generation, tokens/s | Prompt, tokens/s | |
|---|---|---|
| This fork | 107 (87 to 116) | 2,483 |
Upstream, with --pool-workers 15 --ple-io ram |
78 (61 to 93) | 2,439 |
| Upstream, arguments as its installer writes them | 20 (16 to 21) | 2,368 |
Upstream as installed started 127 CPU workers on the container's 32 vCPUs and read the n-gram table from disk per token; the middle row removes both. The remaining gap to the fork is not explained yet: the two builds differ in compile flags and in how the n-gram table is held in RAM, and each row is a single run.
Known problems
- Text in a message that looks like a control token (
<think>,<tool_call>) is tokenized as that control token. Upstream's tokenizer keeps it as plain text. - Replies are not reproducible token for token between runs or between this fork and upstream, even with greedy sampling, so "same output" cannot be checked by comparing text.
- Qwen3.6-35B-A3B: the multi-turn checkpoint reuses a shorter prefix than the previous turn's length (27 of 278 tokens in one two-turn test); images are not wired; the RTX 50 and Volta builds have not run on a card.
Compared with upstream Strata (6f32ec0)
| Upstream | This fork | |
|---|---|---|
Engine source (src/, include/) |
272 files | 58 files changed for the Qwen3.6 port (the model geometry read from the GGUF, the plain-residual block, dense attention, the SiLU-gated DeltaNet, the expert kernels for the UD quantizations, the VRAM planner, the drafter pack) plus retrying reads from slow stores; docs/qwen36-port/ has the per-step notes |
| Build | clones llama.cpp during CMake | pinned submodule, fetches nothing; one patch, applied at configure time: tool-call arguments in any order (see UPSTREAM.md) |
| Setup | Python installer downloads the model and builds the pack and draft head | none; files must already exist |
| Server | Python | C++, in the same binary (frontend/), with the image encoder from llama.cpp's mtmd |
| Python | 33,745 lines | 0 |
| C, C++ and CUDA | 208,254 lines (with tests and the Intel port) | 84,086 lines |
| Tracked files | 851, 27 MB | 292, 6 MB |
| Configurations | several models, NVIDIA, AMD and Intel, Linux and Windows, multi-GPU | two models, one NVIDIA card (Pascal to RTX 50), Linux |
Credits and licence
MIT, as upstream. The engine is the work of Niko1221 and the Strata contributors; see LICENSE and UPSTREAM.md. llama.cpp and ggml are MIT. The model files have their own licences.