[PR #3903] [Engine] qwen35: decode attention that holds up at long context (--kv int8 / fp16 / k8v4, --gqa-attn, --attn-mma) #4821

Open
opened 2026-11-07 15:39:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3903
Author: @xyehya
Created: 10/24/2026
Status: 🔄 Open

Base: main ← Head: pr/q36-02-decode-attn


📝 Commits (6)

  • 1883224 [Engine] qwen35: accept Q4_K down-projection experts
  • 9903b66 [Engine] qwen35: a parity case for the Q4_K down experts at FF 512
  • aab82b7 [Engine] qwen35: --kv int8 for the qwen35moe engine, and --tokens-file
  • 0a2b727 [Engine] qwen35: grouped-query decode attention (#3641's kernel), --kv fp16 and k8v4
  • 73ba60e [Engine] qwen35: int8 decode attention reads the cache through shared memory, one pass per verify window
  • efb3066 [Engine] qwen35: --attn-mma, decode attention on tensor cores for the int8 cache (not bit-identical)

📊 Changes

8 files changed (+1741 additions, -49 deletions)

View changed files

📝 CMakeLists.txt (+15 -0)
📝 docs/QWEN36.md (+39 -1)
📝 setup.py (+2 -2)
📝 src/kernels/cuda/iq_kernels.cu (+3 -3)
📝 src/kernels/native_expert_parity.cpp (+7 -2)
➕ src/qwen35/q36_attn.cuh (+890 -0)
📝 src/qwen35/q36_engine.cu (+285 -41)
➕ tools/qwen35/q36_attn_parity.cu (+500 -0)

📄 Description

Series (each stacked on the one before; review in order): #3699 → #3903 → #3904 → #3905 → #3906 → #3907 → #3908 → #3909 → #3910. Scope discussion: #3700. This is 2 of 9; it builds on #3699.

Branch pr/q36-02-decode-attn, stacked on pr/q36-01-q4k-down.

Problem and result

On the Qwen3.6 engine path the K/V cache is fp32 only (45 KB per token), and the decode attention reads each cache cell once per query head. On a 16 GB card that means two things: --max-context 262144 runs out of memory (#3303, #3700), and decode falls steeply as the context fills (#2464, where k_attn_part is the profiled hot spot).

This PR adds opt-ins; with none of them the engine runs as before:

  • --kv fp16 | int8 | k8v4: 22.5 / 12.7 / 9.5 KB per token and session instead of 45 KB. fp16 is the cache of #3641; int8 is q8_0 rows (the format proposed in #3700).
  • --gqa-attn: the grouped-query decode attention of #3641 for the fp32 and int8 caches (a block per KV head reads each cell once for all its query heads), plus an int8 kernel that streams the cache through shared memory and serves a whole MTP verify window in one pass over the cache. Its partials have the same bits as the first int8 kernel's.
  • --attn-mma (with --gqa-attn --kv int8, sm_80+; says so and is ignored otherwise): the same attention on the tensor cores. Not bit-identical to the default kernel (q, the softmax weights and the products are rounded to fp16).
  • --tokens-file F: --tokens from a file, for prompts too long for an argument (documented in docs/QWEN36.md).

Result on an RTX 5080 16 GB (same day, forced 256-token decode, --mtp 0; every run is in Validation):

  • --max-context 262144 loads with --kv int8 (82 of 256 experts per layer in VRAM, 7.74 GiB free after load). Level 01 at 262144 stops with cudaMalloc ... out of memory.
  • Decode at --max-context 65536, level 01 against --kv int8 --gqa-attn: 4K 155.1 -> 190.8 tok/s (+23%), 16K 104.9 -> 167.6 (+60%). At 40K level 01 cannot be run from the CLI (the ids exceed the 128 KiB argument limit); on level 02 the fp32 path gives 57.0, --kv int8 132.6, with --gqa-attn 176.6.
  • --attn-mma on top: +1.6% / +2.5% / +2.4% at 4K / 16K / 40K (65K context).
  • At 4K much of the gain is VRAM: the int8 cache leaves room for 120 experts per layer instead of 90.
  • Not measured: KL of --attn-mma against the default kernel; decode at 200K.
  • Scope: #3700 (opt-in int8 cache, asking for scope). No maintainer answer yet; this PR stays a draft until there is one.
  • #3641 (acrogenesis, --kv f16 and the grouped-query kernel): the kernel here is theirs, ported to the int8 and k8v4 caches; --kv fp16 is the same cache. If #3641 lands first this PR drops its copy of that kernel.
  • #3678 (yang478, --kv int8 / fp8 / q4): overlaps in the cache format and the --kv parsing. Whichever lands first, the other rebases; the int8 layouts differ (#3678: f16 scale per 64 values; here: q8_0, fp32 scale per 32).
  • #3303 (the cache is always fp32), #2464 (decode falls with context; reported on a V100, not measured here).

Approach

One cache layout per format, chosen by a template argument of the attention-prep and attention kernels, so the fp32 path runs the same kernels as before. --kv takes the main path's names. A value this path does not have (q4_0) is said and skipped in serve mode, as an unknown option is, and refused elsewhere.
Compatibility effect: until now this engine skipped a config's --kv; a hand-written config that carries --kv int8 or fp16 now gets that cache. Setup and the Terminal do not write --kv for this family, so a default install is unaffected; setup.py's warning for --kv now says setup does not write it for this family (it used to say the family does not use it).
--attn-mma and the shared-memory int8 kernel use cp.async / mma.sync, guarded for sm_80+ (the int8 shared-memory kernel falls back to the first int8 kernel on older cards) and compiled out for HIP.
Documented in docs/QWEN36.md ("Opt-ins of this engine path"), with the test settings (STRATA_Q36_ATTN_OLD, STRATA_Q36_ATTN_ROWS, STRATA_Q36_GQA_FROM, STRATA_Q36_CACHE_WINDOW, STRATA_Q36_ATTN_MMA).

Validation

Revision: branch pr/q36-02-decode-attn (efb3066) on origin/main 5c8dd32 (level 01 below it). Environment: Fedora 44 (Linux 7.2.11), CUDA 13.4.92 with g++-15 as host compiler, RTX 5080 16 GB (driver 615.78.08), Core Ultra 9 285K, 61 GB DDR5 (6400 MT/s configured), Sage-A1.5 Q4_K_M with the BF16 ssm_alpha/ssm_beta graft (the file of #3699).

Passed:

  • Build, CUDA sm_120 and "75;120" (commands as in the level-01 PR), targets strata q36_attn_parity.

  • q36_attn_parity (fp32, fp16, int8 and k8v4 cells against a double-precision reference; part_q8x against part_q8; part_q8m against the oracle): pass.

  • Default path against level 01's binary, every flag off, fp32 cache: STRATA_Q36_FIXED_SLOTS=1 strata --native $MODEL --max-context 65536 --prefill 2048 --pool-workers 16 --expert-slots 56 --mtp 0 --tokens <ids> --force <ids> --dump-full-logits OUT, cmp of the two dumps at a 4,096- and a 14,336-token prompt: IDENTICAL / IDENTICAL (64,563,200 bytes each, non-empty).

  • Slot count, free-running (no --expert-slots, no FIXED_SLOTS, --max-context 65536 --prefill 2048 --pool-workers 16 --mtp 0): 90 of 256 experts per layer in VRAM, as level 01. With --max-context 262144 --kv int8 --gqa-attn: 82 (fp32 does not fit at 262144, so there is nothing to compare it with).

  • The new int8 kernel against the first one on the same binary (STRATA_Q36_ATTN_OLD=1 against unset, --kv int8 --gqa-attn, fixed 56 slots, 4K / 14K): logits cmp (--mtp 0) IDENTICAL / IDENTICAL; with --mtp 2 and --mtp 3 free greedy generation (160 tokens, 4K and 14K prompts; --dump-full-logits and --force do not run the speculative path, so the verify windows need free generation; --mtp 3 accepted 95 of 192 drafts) the generated ids are identical in all four runs. Commands: scratch-stack1/ab.sh and ab_gen.sh (kept with the report).

  • --attn-mma on a card below sm_80, or without --gqa-attn --kv int8, says so and is ignored (code read; the sm_75 build compiles it).

Timing (passed as measured; not a gate). Same box and day (2026-10-23), the branch's binary built from efb3066 (level 01's from 9903b66), one cold strata process per run under the GPU lock, arms alternated A-B-A-B, two runs each. Command, with $P = prompt ids of the given depth and $G = the forced text:

strata --native $MODEL --max-context 65536 --prefill auto --pool-workers 16 [flags] --mtp 0 --tokens-file $P --n 256 --force "$G"

(level 01 has no --tokens-file: its ids go inline, so it reaches 16K but not 40K.) tg = decode tok/s, individual runs, then the mean:

arm (flags) ctx slots tg 4K tg 16K tg 40K
level 01 (none) 65536 90 154.8 / 155.3 = 155.1 105 / 104.8 = 104.9 not run
level 02, none 65536 90 155.2 / 155.3 = 155.2 not run 57 / 57 = 57.0
level 02, --kv int8 65536 117 184.1 / 183.7 = 183.9 not run 132.6 / 132.6 = 132.6
level 02, --kv int8 --gqa-attn 65536 120 190.5 / 191 = 190.8 167.2 / 168.1 = 167.6 176.7 / 176.5 = 176.6
level 02, --kv int8 --gqa-attn --attn-mma 65536 120 193.9 / 193.6 = 193.8 171.7 / 172 = 171.8 181 / 180.6 = 180.8
level 02, --kv int8 --gqa-attn 262144 82 176.5 / 176.5 = 176.5 152.7 / 153.9 = 153.3 171.7 / 172.1 = 171.9
level 02, --kv int8 --gqa-attn --attn-mma 262144 82 180 / 179.4 = 179.7 156.9 / 156.4 = 156.7 175.9 / 176.1 = 176.0

Level 02 with no flag decodes like level 01 (155.2 against 155.1 tok/s at 4K, the same 90 slots), and its prompt read is unchanged by the flags (4K: 5,360 (level 01), 5,358 (level 02 --kv int8 --gqa-attn) tok/s; 40K: 4,552). Raw result lines and stderr are kept with the bench notes.

Failed: none observed.

Not run:

  • KL of --attn-mma against the default kernel, and against the --prefill 1024 floor: not measured on this branch; the unit measured speed only. --attn-mma is not bit-identical.
  • Decode at 200K: a 200K prompt read takes 187 s on this level and was dropped for the GPU budget. Level 01 at 40K and above (argument limit).
  • A flag-on end-to-end gate on this branch (the flag-on checks above are all kernel against kernel).
  • HIP and SYCL builds. q36_attn.cuh is included by q36_engine.cu, which the HIP build compiles; the sm_80+ code is under #if guards but never compiled for HIP.
  • sm_70 (V100 of #2464) and sm_80/86/89/90 cards: only sm_120 was run; sm_75 only compiled.
  • Batch (--batch) and vision with the int8 / fp16 cache.

Limits

  • Below sm_80 the shared-memory kernel is not used (the first int8 kernel runs and the log says so) and --attn-mma is ignored with a message (sm_75 compiled, not run).
  • part_q8x and part_q8m are written for 8 query heads per KV head (Qwen3.6-35B-A3B: 16 / 2); other shapes use the first int8 kernel. --kv fp16 and k8v4 refuse more than 8 query heads per KV head.
  • One model family, one card.

Not specific to Sage-A1.5

Sage-A1.5 is a fine-tune of Qwen3.6-35B-A3B with the same architecture and tensor layout, so this path runs the base model
unchanged. The before/after numbers above are Sage-A1.5's. The base model was measured once, on my fork's build of the whole series
(xyehya/Strata branch q36-r2: these PRs' flags on, plus a few fork-only defaults), same card and server sweep, with
STRATA_Q8_PACKED=0 (that file keeps its attention and DeltaNet matrices in Q8_0, and the packed copy would take 1.9 GiB
from the expert slots): Unsloth's Qwen3.6-35B-A3B-UD-Q4_K_XL (from unsloth/Qwen3.6-35B-A3B-MTP-GGUF),
262K int8 cache, decode 221 / 208 / 199 / 187 / 164 / 159 tok/s and prompt read 6,473 / 7,010 / 6,277 / 4,656 / 3,411 /
2,506 tok/s at 4K / 16K / 40K / 90K / 160K / 240K (Sage-A1.5 on the same build: decode 231 / 210 / 213 / 187 / 179 / 162).
Not measured: this PR's own before/after on the base model.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3903 **Author:** [@xyehya](https://github.com/xyehya) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/q36-02-decode-attn` --- ### 📝 Commits (6) - [`1883224`](https://github.com/Niko1221/Strata/commit/1883224f75d2f2fc29aa303e750c2918385f0af4) [Engine] qwen35: accept Q4_K down-projection experts - [`9903b66`](https://github.com/Niko1221/Strata/commit/9903b6609a29b699c088f78f29810d16458d45f8) [Engine] qwen35: a parity case for the Q4_K down experts at FF 512 - [`aab82b7`](https://github.com/Niko1221/Strata/commit/aab82b73b4a3c0be261c5432dc65d455ac216155) [Engine] qwen35: --kv int8 for the qwen35moe engine, and --tokens-file - [`0a2b727`](https://github.com/Niko1221/Strata/commit/0a2b72720c69800b811f8baea30fdfb4bb164ef3) [Engine] qwen35: grouped-query decode attention (#3641's kernel), --kv fp16 and k8v4 - [`73ba60e`](https://github.com/Niko1221/Strata/commit/73ba60e899f38d6698e9d857d04b7e08a3a4b54c) [Engine] qwen35: int8 decode attention reads the cache through shared memory, one pass per verify window - [`efb3066`](https://github.com/Niko1221/Strata/commit/efb3066fc0908c060cbccf749741d848381f2124) [Engine] qwen35: --attn-mma, decode attention on tensor cores for the int8 cache (not bit-identical) ### 📊 Changes **8 files changed** (+1741 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+15 -0) 📝 `docs/QWEN36.md` (+39 -1) 📝 `setup.py` (+2 -2) 📝 `src/kernels/cuda/iq_kernels.cu` (+3 -3) 📝 `src/kernels/native_expert_parity.cpp` (+7 -2) ➕ `src/qwen35/q36_attn.cuh` (+890 -0) 📝 `src/qwen35/q36_engine.cu` (+285 -41) ➕ `tools/qwen35/q36_attn_parity.cu` (+500 -0) </details> ### 📄 Description Series (each stacked on the one before; review in order): #3699 → #3903 → #3904 → #3905 → #3906 → #3907 → #3908 → #3909 → #3910. Scope discussion: #3700. This is 2 of 9; it builds on #3699. Branch `pr/q36-02-decode-attn`, stacked on `pr/q36-01-q4k-down`. ## Problem and result On the Qwen3.6 engine path the K/V cache is fp32 only (45 KB per token), and the decode attention reads each cache cell once per query head. On a 16 GB card that means two things: `--max-context 262144` runs out of memory (#3303, #3700), and decode falls steeply as the context fills (#2464, where `k_attn_part` is the profiled hot spot). This PR adds opt-ins; with none of them the engine runs as before: - `--kv fp16 | int8 | k8v4`: 22.5 / 12.7 / 9.5 KB per token and session instead of 45 KB. fp16 is the cache of #3641; int8 is q8_0 rows (the format proposed in #3700). - `--gqa-attn`: the grouped-query decode attention of #3641 for the fp32 and int8 caches (a block per KV head reads each cell once for all its query heads), plus an int8 kernel that streams the cache through shared memory and serves a whole MTP verify window in one pass over the cache. Its partials have the same bits as the first int8 kernel's. - `--attn-mma` (with `--gqa-attn --kv int8`, sm_80+; says so and is ignored otherwise): the same attention on the tensor cores. Not bit-identical to the default kernel (q, the softmax weights and the products are rounded to fp16). - `--tokens-file F`: `--tokens` from a file, for prompts too long for an argument (documented in `docs/QWEN36.md`). Result on an RTX 5080 16 GB (same day, forced 256-token decode, `--mtp 0`; every run is in Validation): - `--max-context 262144` loads with `--kv int8` (82 of 256 experts per layer in VRAM, 7.74 GiB free after load). Level 01 at 262144 stops with `cudaMalloc ... out of memory`. - Decode at `--max-context 65536`, level 01 against `--kv int8 --gqa-attn`: 4K 155.1 -> 190.8 tok/s (+23%), 16K 104.9 -> 167.6 (+60%). At 40K level 01 cannot be run from the CLI (the ids exceed the 128 KiB argument limit); on level 02 the fp32 path gives 57.0, `--kv int8` 132.6, with `--gqa-attn` 176.6. - `--attn-mma` on top: +1.6% / +2.5% / +2.4% at 4K / 16K / 40K (65K context). - At 4K much of the gain is VRAM: the int8 cache leaves room for 120 experts per layer instead of 90. - Not measured: KL of `--attn-mma` against the default kernel; decode at 200K. ## Related discussion - Scope: #3700 (opt-in int8 cache, asking for scope). No maintainer answer yet; this PR stays a draft until there is one. - #3641 (acrogenesis, `--kv f16` and the grouped-query kernel): the kernel here is theirs, ported to the int8 and k8v4 caches; `--kv fp16` is the same cache. If #3641 lands first this PR drops its copy of that kernel. - #3678 (yang478, `--kv int8 / fp8 / q4`): overlaps in the cache format and the `--kv` parsing. Whichever lands first, the other rebases; the int8 layouts differ (#3678: f16 scale per 64 values; here: q8_0, fp32 scale per 32). - #3303 (the cache is always fp32), #2464 (decode falls with context; reported on a V100, not measured here). ## Approach One cache layout per format, chosen by a template argument of the attention-prep and attention kernels, so the fp32 path runs the same kernels as before. `--kv` takes the main path's names. A value this path does not have (`q4_0`) is said and skipped in serve mode, as an unknown option is, and refused elsewhere. Compatibility effect: until now this engine skipped a config's `--kv`; a hand-written config that carries `--kv int8` or `fp16` now gets that cache. Setup and the Terminal do not write `--kv` for this family, so a default install is unaffected; `setup.py`'s warning for `--kv` now says setup does not write it for this family (it used to say the family does not use it). `--attn-mma` and the shared-memory int8 kernel use `cp.async` / `mma.sync`, guarded for sm_80+ (the int8 shared-memory kernel falls back to the first int8 kernel on older cards) and compiled out for HIP. Documented in `docs/QWEN36.md` ("Opt-ins of this engine path"), with the test settings (`STRATA_Q36_ATTN_OLD`, `STRATA_Q36_ATTN_ROWS`, `STRATA_Q36_GQA_FROM`, `STRATA_Q36_CACHE_WINDOW`, `STRATA_Q36_ATTN_MMA`). ## Validation Revision: branch `pr/q36-02-decode-attn` (efb3066) on `origin/main` 5c8dd32 (level 01 below it). Environment: Fedora 44 (Linux 7.2.11), CUDA 13.4.92 with g++-15 as host compiler, RTX 5080 16 GB (driver 615.78.08), Core Ultra 9 285K, 61 GB DDR5 (6400 MT/s configured), Sage-A1.5 Q4_K_M with the BF16 `ssm_alpha`/`ssm_beta` graft (the file of #3699). **Passed:** - Build, CUDA sm_120 and "75;120" (commands as in the level-01 PR), targets `strata q36_attn_parity`. - `q36_attn_parity` (fp32, fp16, int8 and k8v4 cells against a double-precision reference; part_q8x against part_q8; part_q8m against the oracle): pass. - Default path against level 01's binary, every flag off, fp32 cache: `STRATA_Q36_FIXED_SLOTS=1 strata --native $MODEL --max-context 65536 --prefill 2048 --pool-workers 16 --expert-slots 56 --mtp 0 --tokens <ids> --force <ids> --dump-full-logits OUT`, `cmp` of the two dumps at a 4,096- and a 14,336-token prompt: IDENTICAL / IDENTICAL (64,563,200 bytes each, non-empty). - Slot count, free-running (no `--expert-slots`, no FIXED_SLOTS, `--max-context 65536 --prefill 2048 --pool-workers 16 --mtp 0`): 90 of 256 experts per layer in VRAM, as level 01. With `--max-context 262144 --kv int8 --gqa-attn`: 82 (fp32 does not fit at 262144, so there is nothing to compare it with). - The new int8 kernel against the first one on the same binary (`STRATA_Q36_ATTN_OLD=1` against unset, `--kv int8 --gqa-attn`, fixed 56 slots, 4K / 14K): logits `cmp` (`--mtp 0`) IDENTICAL / IDENTICAL; with `--mtp 2` and `--mtp 3` free greedy generation (160 tokens, 4K and 14K prompts; `--dump-full-logits` and `--force` do not run the speculative path, so the verify windows need free generation; `--mtp 3` accepted 95 of 192 drafts) the generated ids are identical in all four runs. Commands: `scratch-stack1/ab.sh` and `ab_gen.sh` (kept with the report). - `--attn-mma` on a card below sm_80, or without `--gqa-attn --kv int8`, says so and is ignored (code read; the sm_75 build compiles it). **Timing** (passed as measured; not a gate). Same box and day (2026-10-23), the branch's binary built from `efb3066` (level 01's from `9903b66`), one cold `strata` process per run under the GPU lock, arms alternated A-B-A-B, two runs each. Command, with `$P` = prompt ids of the given depth and `$G` = the forced text: ``` strata --native $MODEL --max-context 65536 --prefill auto --pool-workers 16 [flags] --mtp 0 --tokens-file $P --n 256 --force "$G" ``` (level 01 has no `--tokens-file`: its ids go inline, so it reaches 16K but not 40K.) tg = decode tok/s, individual runs, then the mean: | arm (flags) | ctx | slots | tg 4K | tg 16K | tg 40K | |---|---:|---:|---|---|---| | level 01 (none) | 65536 | 90 | 154.8 / 155.3 = 155.1 | 105 / 104.8 = 104.9 | not run | | level 02, none | 65536 | 90 | 155.2 / 155.3 = 155.2 | not run | 57 / 57 = 57.0 | | level 02, `--kv int8` | 65536 | 117 | 184.1 / 183.7 = 183.9 | not run | 132.6 / 132.6 = 132.6 | | level 02, `--kv int8 --gqa-attn` | 65536 | 120 | 190.5 / 191 = 190.8 | 167.2 / 168.1 = 167.6 | 176.7 / 176.5 = 176.6 | | level 02, `--kv int8 --gqa-attn --attn-mma` | 65536 | 120 | 193.9 / 193.6 = 193.8 | 171.7 / 172 = 171.8 | 181 / 180.6 = 180.8 | | level 02, `--kv int8 --gqa-attn` | 262144 | 82 | 176.5 / 176.5 = 176.5 | 152.7 / 153.9 = 153.3 | 171.7 / 172.1 = 171.9 | | level 02, `--kv int8 --gqa-attn --attn-mma` | 262144 | 82 | 180 / 179.4 = 179.7 | 156.9 / 156.4 = 156.7 | 175.9 / 176.1 = 176.0 | Level 02 with no flag decodes like level 01 (155.2 against 155.1 tok/s at 4K, the same 90 slots), and its prompt read is unchanged by the flags (4K: 5,360 (level 01), 5,358 (level 02 `--kv int8 --gqa-attn`) tok/s; 40K: 4,552). Raw result lines and stderr are kept with the bench notes. **Failed:** none observed. **Not run:** - KL of `--attn-mma` against the default kernel, and against the `--prefill 1024` floor: not measured on this branch; the unit measured speed only. `--attn-mma` is not bit-identical. - Decode at 200K: a 200K prompt read takes 187 s on this level and was dropped for the GPU budget. Level 01 at 40K and above (argument limit). - A flag-on end-to-end gate on this branch (the flag-on checks above are all kernel against kernel). - HIP and SYCL builds. `q36_attn.cuh` is included by `q36_engine.cu`, which the HIP build compiles; the sm_80+ code is under `#if` guards but never compiled for HIP. - sm_70 (V100 of #2464) and sm_80/86/89/90 cards: only sm_120 was run; sm_75 only compiled. - Batch (`--batch`) and vision with the int8 / fp16 cache. ## Limits - Below sm_80 the shared-memory kernel is not used (the first int8 kernel runs and the log says so) and `--attn-mma` is ignored with a message (sm_75 compiled, not run). - `part_q8x` and `part_q8m` are written for 8 query heads per KV head (Qwen3.6-35B-A3B: 16 / 2); other shapes use the first int8 kernel. `--kv fp16` and `k8v4` refuse more than 8 query heads per KV head. - One model family, one card. ## Not specific to Sage-A1.5 Sage-A1.5 is a fine-tune of Qwen3.6-35B-A3B with the same architecture and tensor layout, so this path runs the base model unchanged. The before/after numbers above are Sage-A1.5's. The base model was measured once, on my fork's build of the whole series (`xyehya/Strata` branch `q36-r2`: these PRs' flags on, plus a few fork-only defaults), same card and server sweep, with `STRATA_Q8_PACKED=0` (that file keeps its attention and DeltaNet matrices in Q8_0, and the packed copy would take 1.9 GiB from the expert slots): Unsloth's `Qwen3.6-35B-A3B-UD-Q4_K_XL` (from `unsloth/Qwen3.6-35B-A3B-MTP-GGUF`), 262K int8 cache, decode 221 / 208 / 199 / 187 / 164 / 159 tok/s and prompt read 6,473 / 7,010 / 6,277 / 4,656 / 3,411 / 2,506 tok/s at 4K / 16K / 40K / 90K / 160K / 240K (Sage-A1.5 on the same build: decode 231 / 210 / 213 / 187 / 179 / 162). Not measured: this PR's own before/after on the base model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4821
No description provided.