mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1402] [CLOSED] Qwen3.6-35B-A3B and Ornith-1.5-35B-A3B (qwen35moe): a second, smaller model for 8-12 GB cards #3433
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3433
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1402
Author: @aflin
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:qwen36-35b-support📝 Commits (10+)
42bf2ffQwen3.6-35B-A3B and Ornith-1.5-35B-A3B (qwen35moe): a second, smaller model for 8-12 GB cards64ec4ceMerge upstream/main (0.1.40.2) into qwen36-35b-supportaa7ab97Merge upstream/main (0.1.41) into qwen36-35b-support20f4d4bqwen35moe: 16-bit K/V at 8K, and the server below sm_755c92395qwen35moe: --kv-resident past the resident cells (KV streaming with dense attention)48534f3setup: KV streaming for the 35B-A3B models: needed below 9 GB free from 128K, asked otherwise21ce6b2Merge upstream/main (0.1.42) into qwen36-35b-supporte5fd6d3qwen35moe: dense prompt attention, 8 queries per block4a0bb25serve: preserve_thinking on both APIs, from a request, the Chat settings or the config70c5d3esetup: images for Qwen3.6 and Ornith📊 Changes
57 files changed (+3817 additions, -777 deletions)
View changed files
📝
README.md(+5 -0)➕
data/expert-profile-qwen36.bin(+0 -0)📝
docs/DETAILS.md(+10 -1)📝
docs/MODELS.md(+22 -1)➕
docs/QWEN36.md(+193 -0)📝
include/strata/artifact/gguf_reader.hpp(+11 -1)📝
include/strata/core/layout.hpp(+28 -0)📝
include/strata/core/mtp.hpp(+8 -0)📝
include/strata/core/verify.hpp(+9 -1)📝
include/strata/core/vmm.hpp(+1 -0)📝
include/strata/kernels/cpu/expert_layout.hpp(+5 -1)📝
include/strata/kernels/kv_stream.hpp(+6 -5)📝
include/strata/kernels/qsa.hpp(+4 -0)📝
include/strata/kernels/qsa_decode_attn.hpp(+12 -0)📝
include/strata/kernels/qsa_prompt_attn.hpp(+3 -0)📝
include/strata/kernels/qsa_select.hpp(+4 -0)📝
include/strata/kernels/verify_kernels.hpp(+3 -0)📝
include/strata/prefill/kernels.hpp(+19 -11)📝
include/strata/prefill/prefill.hpp(+3 -0)📝
serve/frontend.py(+10 -3)...and 37 more files
📄 Description
Related: #824 (perronemirko's Qwen3.6 engine, closed by the history rewrite). That PR adds a separate
strata-qwen36engine beside the main one; this one teaches the main engine the model instead, so the server, setup,the batched prompt path, MTP and the expert cache all apply to it, and the engine picks the model from the GGUF.
Summary
Qwen3.6-35B-A3B is the same family as Flash-Next (DeltaNet layers, full attention every fourth layer, a MoE with a
shared expert) at 35B parameters: its experts take 12-14 GB of RAM instead of 23-50 GB. It is the model for PCs with
16-32 GB of RAM and 6-12 GB cards. Ornith-1.5-35B-A3B (ornith-ai, MIT) is a coding-agent fine-tune of it with the same
architecture.
The engine reads
general.architectureand runsqwen35moebesideqwen4expon one code path. Nothing on thecommand line says which model it is. Flash-Next's arithmetic is unchanged (see "How it was checked").
Measured on Linux (Debian 12), RTX 4070 Ti 12 GB, Ryzen 9 5950X, 62 GB RAM, CUDA 13.0; 32K context, 8-bit K/V, MTP on.
"8 GB" is the same card with 4 GiB held by another process (emulated, not a real 8 GB card).
--fit on)Greedy tokens match llama.cpp b11438 exactly on UD-IQ4_XS (three short prompts and the 8K prompt, 32 tokens each,
expert cache at 3,000 slots). With a different cache size a near-tie can flip, because experts computed on the GPU
round slightly differently from the CPU's (seen once: llama.cpp's top two at 28% and 26%). More numbers (UD-IQ3_S,
Ornith, small cards, 256K) are in
docs/QWEN36.md.What changed
Engine: model geometry (
include/strata/core/layout.hpp,src/core/layout.cpp,gguf_reader.hpp)ModelGeometrygains the architecture, experts per token, and whether the model has PLE, the sparse-attentionindexer and hyper-connections;
geometry_from_gguffills it and checks that each size fits the kernels' limits(all of Qwen3.6's are at or below Flash-Next's, which stay as compile-time capacities).
Engine: decode (
src/core/verify.cpp,src/kernels/cuda/*.cu,src/kernels/cpu/*,src/core/expert_source.cpp)silu(z)DeltaNetoutput gate, and dense attention: every cached cell is attended (
qsa_select_all), with no indexer projections,snapshots or replay.
CPU pool and expert layout take the model's widths.
iq_row_bytescovers Q2_K (without it theMTP layer's Q2_K experts read as garbage).
Engine: prompt path (
src/prefill/prefill.cpp,kernels.cu)a dense mode for the tensor-core prompt attention. NVIDIA sm_75+; elsewhere (
Prefill::supports) the prompt is readthrough the decode windows.
Engine: MTP (
src/core/mtp.cpp)blk.40(eh_projsplit into its embedding and hidden halves,native projections and experts). No separate download.
Engine: VRAM on small cards (
src/program/generate.cpp,Verifier::dense_attention_bytes)allocated after the cache: without this a 256K context failed on every card.
instantiation at 8K, 32K and 64K, 450 started) and stays 300 for Flash-Next.
the prompt buffers.
--draft-vocab en, from3.9 GB.
Data
data/expert-profile-qwen36.bin: 40 x 256 experts ranked by routing counts from 24 varied prompts (server--expert-profile-savewith a 64-slot cache). Against an unranked profile, on prompts not among the 24 (threeruns): 12 GB short-chat writes 99 -> 106 tok/s, 8K writes 84 -> 93 tok/s; no difference at 8 GB.
Setup (
setup.py)qwen36(unsloth/Qwen3.6-35B-A3B-MTP-GGUF: UD-IQ4_XS, UD-IQ3_S) andornith(bartowski/Ornith-1.5-35B-A3B-GGUF: IQ4_XS, IQ3_XXS), pinned revisions and SHA-256. ModelScope serves the same four
files with the same SHA-256.
size and an 8K context (a recommendation, never forced).
looks for the support in the engine file itself and compiles the engine when a ready-made one lacks it. Flash-Next
keeps the ready-made engine.
tools/test_setup_qwen36.py,tools/test_setup_ornith.py; updatedtest_setup_choices.py,test_setup_unsloth.py.Tools
tools/iq_pack.pyleaves the MTP layer out of the expert table;tools/make_profile.py --n-layer;tools/iq_fixture.pyadds Q2_K and Q4_0;tools/strata_mcp.pyrecommend()follows setup's rules.Docs
docs/QWEN36.md(setup, what fits, small cards, speed, against llama.cpp, Ornith, differences, limits);sections in
docs/MODELS.mdandREADME.md.What it leaves alone
instance is a template next to the existing one, and Flash-Next takes the same instance as before. The setup
families, sizes and defaults for Flash-Next, Swift, the Coder and Unsloth are unchanged. Two things a Flash-Next user
can see: setup's "less than 12 GB of VRAM" warning adds a pointer to
--family qwen36when no family was named, anda start whose automatic expert cache gets no slot at all now stops there with the existing "no VRAM is left" message
instead of going on to fail at the prompt buffers.
stop with a message for any other size (
sycl/src/prefill/kernels.dp.cpp).--peer-device,--layer-splitand--expert-cache-device1..3at thestart; those paths carry Flash-Next's shapes and were not run with it.
share (
STRATA_PREFILL_CPU_SHARE), the chunked GDN recurrence (STRATA_GDN_CHUNKED), the query branch ofSTRATA_DF_BRANCHand the routing debug hook (STRATA_DBG_FEAT).How it was checked
STRATA_HIP_GFX906build for gfx906, with ROCm 7.10 from AMD's TheRock wheels) and SYCL (thestrata-sycl-devimage,every target). Only the CUDA build was run; there is no AMD or Intel card here.
fb58e0d, the same PC, Coder IQ1_M, expert cache 900 slots): theshort prompts give main's tokens (prompts 1 and 2 identical; prompt 0 alternates between the same two outputs in
both builds). The 8K prompt is not repeatable on main itself on this PC (with
--adapt-every 0 --pcie-frac 0, withand without the MTP layer, with
STRATA_STAGER_SLEEP=0,STRATA_STAGE_PIN=0orSTRATA_PREFILL_STREAM_AHEAD=0:three runs gave three different outputs, while 0.1.40.2 repeated exactly), so it cannot be compared byte for byte;
the merged build's outputs were among main's. I can open a separate issue with the numbers if that is useful.
floor and 256K as measured before the merge.
iq_parity(with and withoutSTRATA_PARITY_IQ_MMVQ) andnative_grouped_parity0 failures; setup, MCPand profile tests pass except
tools/test_setup_engine_hash.py's two, which fail the same way on main.Extra Notes
NVIDIA-only (elsewhere prompts are read through the decode windows), and setup's compile path for them is untested
on Windows. Test requests for those could go in docs/TEST_REQUESTS.md.
copy of the layer did no better, so it is the fine-tune's draft layer, not its quantization.
Squash or rebase as you prefer.
this one is settled (one change per pull request).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.