[PR #3910] [Engine] qwen35: hybrid mode sizes the CPU half by the rows that reach it and keeps 256 MiB free (default change) #4828

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

📋 Pull Request Information

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

Base: main ← Head: pr/q36-09-hybrid-sizing-default


📝 Commits (10+)

  • 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)
  • 6e21c89 [Engine] qwen35: --fused-prompt-attn, the prompt attention in one tensor-core kernel from the int8 cache
  • 022982d [Engine] qwen35: --chunked-gdn, the prompt's gated delta rule in pieces of 16 tokens
  • a3c2dc4 [Engine] qwen35: k_add_rms_q and k_moe_out in registers with a one-barrier same-order sum
  • 9017b2f [Engine] qwen35: --side-stream: z, alpha / beta (and the attention k, v) on a stream beside the first matrix

📊 Changes

27 files changed (+6856 additions, -262 deletions)

View changed files

📝 CMakeLists.txt (+39 -0)
📝 apps/host/server/run-config-check.mjs (+1 -1)
📝 apps/host/tests/run-config-check.test.mjs (+5 -0)
📝 docs/DETAILS.md (+7 -0)
📝 docs/QWEN36.md (+269 -3)
📝 include/strata/kernels/cpu/pool.hpp (+40 -1)
📝 serve/server.py (+44 -5)
➕ serve/test_turn_splice.py (+171 -0)
➕ serve/turn_splice.py (+177 -0)
📝 setup.py (+2 -2)
📝 src/kernels/cpu/pool.cpp (+170 -37)
➕ src/kernels/cpu/pool_warm_test.cpp (+88 -0)
📝 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 (+2122 -204)
➕ src/qwen35/q36_gdn.cuh (+258 -0)
📝 src/qwen35/q36_kernels.cuh (+113 -4)
➕ src/qwen35/q36_pattn.cuh (+297 -0)
➕ src/qwen35/q36_sampling.hpp (+320 -0)

...and 7 more files

📄 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 9 of 9; it builds on #3909.

Branch pr/q36-09-hybrid-sizing-default, stacked on pr/q36-08-agent-turns.

Problem and result

In the hybrid mode the placement reserves 768 MiB of free VRAM and sizes the CPU half's device buffers for a whole prompt chunk (tmax rows), although only --hybrid-rows (128 by default) rows can reach the CPU. Both leave room that the expert cache could use. Two changes, both default (no flag):

  1. The CPU half's buffers are sized by the rows that can reach it: 8 MiB of VRAM instead of 128 MiB at --prefill 2048, given back to the expert slots.
  2. The hybrid placement keeps 256 MiB free at the low-water mark (+48 MiB for the engine's lazy growth after placement, +96 MiB that place_experts itself allocates after reading the free VRAM) instead of 768 MiB.
    --expert-vram, --expert-slots and the all-in-VRAM decision are not changed: an explicit --expert-vram budget keeps exactly its old slot pool (the CPU half's buffers are counted in the slot budget only for the reserve-derived budget, where the old reserve paid for them). The branch is two commits, one per change; the first is arithmetic on the buffers' sizes, the second needs data from more than one setup.

Measured on the RTX 5080 16 GB with Sage-A1.5 Q4_K_M, free-running (no --expert-slots), --prefill 2048 --pool-workers 16 --mtp 0: hybrid experts per layer in VRAM, level 08 -> this PR: 90 -> 95 (--max-context 65536, fp32 cache) and 82 -> 87 (--max-context 262144 --kv int8 --gqa-attn). With all of level 08's flags (--max-context 262144): 92 -> 97. From the docs, measured on the tree these commits came from and not re-run on this branch: with --snapshots 2 --expert-prefetch 2, 78 -> 80 cache slots for change 1; with the opt-ins of the docs' measurement (prefetch, snapshots, lend-staging), 93 -> 97 slots for change 2, the lowest free VRAM 0.579 -> 0.297 GiB (the low-water check, STRATA_Q36_VRAM_WATCH=1, was not run on this branch).
Decode speed, forced text, same day, two runs per arm, level 08 -> this PR: +1.1% at 4K (243.8 -> 246.5 tok/s) and +1.2% at 40K (219.1 -> 221.7) with all of level 08's flags; +0.5% / -0.7% with only --kv int8 --gqa-attn; +0.9% / -0.3% with no flag at all (fp32 cache, 65K). Free-running greedy --mtp 2: +3.6% at 4K, +5.8% at 40K, but the acceptance also moves (83% -> 89%, 78.5% -> 81%), so that pair is not the same text. These are two runs on one card and a gain of about 1% in decode: they do not justify a default by themselves. The case for the change is the 5 extra resident experts per layer and the larger free-VRAM margin it uses; the question for the maintainers is below.

No scope issue yet: this draft asks the question here (related scope discussion: #3700). The scope question for the maintainers: is a 256 MiB headroom acceptable as the default? The number comes from one card, one desktop session and the runs listed below.

Approach

STRATA_Q36_VRAM_WATCH=1 (a test setting) polls the device's free VRAM every 5 ms and reports each new low-water mark and the lowest at exit; the headroom was sized from it: over a 245K prompt read plus MTP 2 decode, a 198K read with two follow-ups, lend-staging's evict and refill around 4K / 16K / 40K prompts and the first request, the low-water mark was 21 MiB under the free VRAM after placement, all of it in the warm-up. The log gets a line VRAM left after the experts' buffers: X GiB (CPU half: N rows). STRATA_Q36_PLACE_DEBUG=1 prints the placement numbers (documented in docs/QWEN36.md).
Anything else that allocates VRAM after the placement (another program, the desktop, a driver) now has 256 MiB, not 768 MiB. A failure there would be a cudaMalloc error at a later request.

Validation

Revision: branch pr/q36-09-hybrid-sizing-default (f8997ef), level 08 below it, origin/main 5c8dd32. 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), target strata and the test tools.

  • Slot counts above (slots.sh: strata --native $MODEL --max-context N --prefill 2048 --pool-workers 16 --mtp 0 --tokens 1,2,3,4,5,6,7,8 --n 2 [--kv int8 --gqa-attn], the line hybrid experts: N of 256 per layer in VRAM).

  • Fixed-slot gates (--expert-slots 56, STRATA_Q36_FIXED_SLOTS=1) against level 01's binary and gate_a.sh against level 02's: IDENTICAL / IDENTICAL at 4K and 14K. They are identical because the fixed slot count hides the change; the free-running slot count is the evidence.

  • The submitted revision f8997ef against the timed one (the revision before the last amend of the stack), full-logit cmp with the flags of level 09 on both sides (all of level 08's flags, fixed 56 slots, 4K and 14K): IDENTICAL / IDENTICAL (64,563,200 bytes each). The fixed slot count hides this PR's change, so this shows only that the amend of the stack did not alter the output; the slot counts are the evidence for the PR itself.

  • --expert-vram 6 --max-context 65536 gives 68 of 256 experts per layer on level 08 and on this branch (slots.sh): an explicit budget keeps its old pool (cpu_dev_b is 0 for an explicit budget).

Timing (same box and day, 2026-10-23; one cold strata process per run under the GPU lock; arms alternated, two runs each; the binaries are the revisions before the last amend of the stack). <08 flags> = --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy --expert-profile $PROFILE --expert-prefetch 2 --hybrid-zero-copy --decode-swaps 64 --async-swaps --lend-staging --pool-warm 3 --prefetch-copies 0 --mtp-sampled q --sample-gpu --snapshots 2 --snapshot-host ($PROFILE is an expert profile saved from an agent session, not in the repository). Commands, $P / $G = prompt ids and forced text of the depth:

strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 <08 flags> --mtp 0 --tokens-file $P --n 256 --force "$G"      # all flags
strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --mtp 0 --tokens-file $P --n 256 --force "$G"   # int8 + gqa only
strata --native $MODEL --max-context 65536  --prefill auto --pool-workers 16 --mtp 0 --tokens-file $P --n 256 --force "$G"                       # no flag
strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 <08 flags> --mtp 2 --tokens-file $P --n 256                          # free-running greedy

Decode tok/s (forced text), individual runs, then the mean; slots = experts per layer in VRAM, level 08 -> this PR:

flags slots tg 4,096: level 08 tg 4,096: this PR tg 40,960: level 08 tg 40,960: this PR
all of level 08's 92 -> 97 243.6 / 244 = 243.8 246.4 / 246.6 = 246.5 (+1.1%) 219.9 / 218.3 = 219.1 221.5 / 221.9 = 221.7 (+1.2%)
--kv int8 --gqa-attn 82 -> 87 183.6 / 185 = 184.3 185.3 / 185.2 = 185.2 (+0.5%) 179.9 / 179.8 = 179.9 178.5 / 178.6 = 178.6 (-0.7%)
none (fp32 cache, 65K) 90 -> 95 160.4 / 159.4 = 159.9 161.2 / 161.5 = 161.3 (+0.9%) 57.8 / 57.5 = 57.6 57.2 / 57.6 = 57.4 (-0.3%)

Free-running greedy --mtp 2, all flags, tok/s and draft acceptance:

4,096 acceptance 40,960 acceptance
level 08 294.1 / 298.6 = 296.4 83% 246.6 / 249.9 = 248.2 78.5%
this PR 307 / 306.8 = 306.9 (+3.6%) 89% 262.8 / 262.4 = 262.6 (+5.8%) 81%

Where the extra slots do not change what the CPU pool does (40K, int8 + gqa only) the decode is level, within about 1%. GPU share of the decode rows with all flags: 86.2% -> 87.4% at 4K, 88.9% -> 89.8% at 40K.

Failed: none observed.

Not run:

  • A low-water check with STRATA_Q36_VRAM_WATCH=1 on this branch, and the slot counts "with the opt-ins of the docs' measurement" above on this branch.
  • Decode at 16K; a run on a heavier desktop or with a second GPU program (where 256 MiB may not be enough).
  • One fast run never justifies a default: this PR has two runs per arm on one card.
  • Cards with 12 GB or 24/32 GB, Windows (where the desktop holds more VRAM), a second program using the GPU, multi-GPU.
  • HIP and SYCL builds (cudaMemGetInfo and a polling thread; never compiled for HIP).

Limits

One card, one desktop (GNOME on Fedora). A machine with a heavier desktop or another GPU program may fail where 768 MiB did not; STRATA_Q36_HEADROOM_MIB=768 gives the old reserve back (documented in docs/QWEN36.md), and --expert-vram / --expert-slots bypass the reserve.

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/3910 **Author:** [@xyehya](https://github.com/xyehya) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/q36-09-hybrid-sizing-default` --- ### 📝 Commits (10+) - [`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) - [`6e21c89`](https://github.com/Niko1221/Strata/commit/6e21c895f215690eae1ae196b428e1090fcc1db9) [Engine] qwen35: --fused-prompt-attn, the prompt attention in one tensor-core kernel from the int8 cache - [`022982d`](https://github.com/Niko1221/Strata/commit/022982df36843763f7f43978bf3259d95a3948d0) [Engine] qwen35: --chunked-gdn, the prompt's gated delta rule in pieces of 16 tokens - [`a3c2dc4`](https://github.com/Niko1221/Strata/commit/a3c2dc4c8a7f9aaec120cd0594efe9893d4b95db) [Engine] qwen35: k_add_rms_q and k_moe_out in registers with a one-barrier same-order sum - [`9017b2f`](https://github.com/Niko1221/Strata/commit/9017b2fd45cea7a63e871a21c523d1065fe455eb) [Engine] qwen35: --side-stream: z, alpha / beta (and the attention k, v) on a stream beside the first matrix ### 📊 Changes **27 files changed** (+6856 additions, -262 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+39 -0) 📝 `apps/host/server/run-config-check.mjs` (+1 -1) 📝 `apps/host/tests/run-config-check.test.mjs` (+5 -0) 📝 `docs/DETAILS.md` (+7 -0) 📝 `docs/QWEN36.md` (+269 -3) 📝 `include/strata/kernels/cpu/pool.hpp` (+40 -1) 📝 `serve/server.py` (+44 -5) ➕ `serve/test_turn_splice.py` (+171 -0) ➕ `serve/turn_splice.py` (+177 -0) 📝 `setup.py` (+2 -2) 📝 `src/kernels/cpu/pool.cpp` (+170 -37) ➕ `src/kernels/cpu/pool_warm_test.cpp` (+88 -0) 📝 `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` (+2122 -204) ➕ `src/qwen35/q36_gdn.cuh` (+258 -0) 📝 `src/qwen35/q36_kernels.cuh` (+113 -4) ➕ `src/qwen35/q36_pattn.cuh` (+297 -0) ➕ `src/qwen35/q36_sampling.hpp` (+320 -0) _...and 7 more files_ </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 9 of 9; it builds on #3909. Branch `pr/q36-09-hybrid-sizing-default`, stacked on `pr/q36-08-agent-turns`. <!-- DRAFT, do not open before a maintainer has agreed the scope in an issue (CONTRIBUTING: changes to defaults). This is the one PR of the stack that changes a default. --> ## Problem and result In the hybrid mode the placement reserves 768 MiB of free VRAM and sizes the CPU half's device buffers for a whole prompt chunk (`tmax` rows), although only `--hybrid-rows` (128 by default) rows can reach the CPU. Both leave room that the expert cache could use. Two changes, both default (no flag): 1. The CPU half's buffers are sized by the rows that can reach it: 8 MiB of VRAM instead of 128 MiB at `--prefill 2048`, given back to the expert slots. 2. The hybrid placement keeps 256 MiB free at the low-water mark (+48 MiB for the engine's lazy growth after placement, +96 MiB that `place_experts` itself allocates after reading the free VRAM) instead of 768 MiB. `--expert-vram`, `--expert-slots` and the all-in-VRAM decision are not changed: an explicit `--expert-vram` budget keeps exactly its old slot pool (the CPU half's buffers are counted in the slot budget only for the reserve-derived budget, where the old reserve paid for them). The branch is two commits, one per change; the first is arithmetic on the buffers' sizes, the second needs data from more than one setup. Measured on the RTX 5080 16 GB with Sage-A1.5 Q4_K_M, free-running (no `--expert-slots`), `--prefill 2048 --pool-workers 16 --mtp 0`: hybrid experts per layer in VRAM, level 08 -> this PR: 90 -> 95 (`--max-context 65536`, fp32 cache) and 82 -> 87 (`--max-context 262144 --kv int8 --gqa-attn`). With all of level 08's flags (`--max-context 262144`): 92 -> 97. From the docs, measured on the tree these commits came from and not re-run on this branch: with `--snapshots 2 --expert-prefetch 2`, 78 -> 80 cache slots for change 1; with the opt-ins of the docs' measurement (prefetch, snapshots, lend-staging), 93 -> 97 slots for change 2, the lowest free VRAM 0.579 -> 0.297 GiB (the low-water check, `STRATA_Q36_VRAM_WATCH=1`, was not run on this branch). Decode speed, forced text, same day, two runs per arm, level 08 -> this PR: +1.1% at 4K (243.8 -> 246.5 tok/s) and +1.2% at 40K (219.1 -> 221.7) with all of level 08's flags; +0.5% / -0.7% with only `--kv int8 --gqa-attn`; +0.9% / -0.3% with no flag at all (fp32 cache, 65K). Free-running greedy `--mtp 2`: +3.6% at 4K, +5.8% at 40K, but the acceptance also moves (83% -> 89%, 78.5% -> 81%), so that pair is not the same text. **These are two runs on one card and a gain of about 1% in decode: they do not justify a default by themselves.** The case for the change is the 5 extra resident experts per layer and the larger free-VRAM margin it uses; the question for the maintainers is below. ## Related discussion No scope issue yet: this draft asks the question here (related scope discussion: #3700). The scope question for the maintainers: is a 256 MiB headroom acceptable as the default? The number comes from one card, one desktop session and the runs listed below. ## Approach `STRATA_Q36_VRAM_WATCH=1` (a test setting) polls the device's free VRAM every 5 ms and reports each new low-water mark and the lowest at exit; the headroom was sized from it: over a 245K prompt read plus MTP 2 decode, a 198K read with two follow-ups, lend-staging's evict and refill around 4K / 16K / 40K prompts and the first request, the low-water mark was 21 MiB under the free VRAM after placement, all of it in the warm-up. The log gets a line `VRAM left after the experts' buffers: X GiB (CPU half: N rows)`. `STRATA_Q36_PLACE_DEBUG=1` prints the placement numbers (documented in `docs/QWEN36.md`). Anything else that allocates VRAM after the placement (another program, the desktop, a driver) now has 256 MiB, not 768 MiB. A failure there would be a `cudaMalloc` error at a later request. ## Validation Revision: branch `pr/q36-09-hybrid-sizing-default` (f8997ef), level 08 below it, `origin/main` 5c8dd32. 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), target `strata` and the test tools. - Slot counts above (`slots.sh`: `strata --native $MODEL --max-context N --prefill 2048 --pool-workers 16 --mtp 0 --tokens 1,2,3,4,5,6,7,8 --n 2 [--kv int8 --gqa-attn]`, the line `hybrid experts: N of 256 per layer in VRAM`). - Fixed-slot gates (`--expert-slots 56`, `STRATA_Q36_FIXED_SLOTS=1`) against level 01's binary and `gate_a.sh` against level 02's: IDENTICAL / IDENTICAL at 4K and 14K. They are identical because the fixed slot count hides the change; the free-running slot count is the evidence. - The submitted revision `f8997ef` against the timed one (the revision before the last amend of the stack), full-logit `cmp` with the flags of level 09 on both sides (all of level 08's flags, fixed 56 slots, 4K and 14K): IDENTICAL / IDENTICAL (64,563,200 bytes each). The fixed slot count hides this PR's change, so this shows only that the amend of the stack did not alter the output; the slot counts are the evidence for the PR itself. - `--expert-vram 6 --max-context 65536` gives 68 of 256 experts per layer on level 08 and on this branch (`slots.sh`): an explicit budget keeps its old pool (`cpu_dev_b` is 0 for an explicit budget). **Timing** (same box and day, 2026-10-23; one cold `strata` process per run under the GPU lock; arms alternated, two runs each; the binaries are the revisions before the last amend of the stack). `<08 flags>` = `--kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy --expert-profile $PROFILE --expert-prefetch 2 --hybrid-zero-copy --decode-swaps 64 --async-swaps --lend-staging --pool-warm 3 --prefetch-copies 0 --mtp-sampled q --sample-gpu --snapshots 2 --snapshot-host` (`$PROFILE` is an expert profile saved from an agent session, not in the repository). Commands, `$P` / `$G` = prompt ids and forced text of the depth: ``` strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 <08 flags> --mtp 0 --tokens-file $P --n 256 --force "$G" # all flags strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --mtp 0 --tokens-file $P --n 256 --force "$G" # int8 + gqa only strata --native $MODEL --max-context 65536 --prefill auto --pool-workers 16 --mtp 0 --tokens-file $P --n 256 --force "$G" # no flag strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 <08 flags> --mtp 2 --tokens-file $P --n 256 # free-running greedy ``` Decode tok/s (forced text), individual runs, then the mean; slots = experts per layer in VRAM, level 08 -> this PR: | flags | slots | tg 4,096: level 08 | tg 4,096: this PR | tg 40,960: level 08 | tg 40,960: this PR | |---|---|---|---|---|---| | all of level 08's | 92 -> 97 | 243.6 / 244 = 243.8 | 246.4 / 246.6 = 246.5 (+1.1%) | 219.9 / 218.3 = 219.1 | 221.5 / 221.9 = 221.7 (+1.2%) | | `--kv int8 --gqa-attn` | 82 -> 87 | 183.6 / 185 = 184.3 | 185.3 / 185.2 = 185.2 (+0.5%) | 179.9 / 179.8 = 179.9 | 178.5 / 178.6 = 178.6 (-0.7%) | | none (fp32 cache, 65K) | 90 -> 95 | 160.4 / 159.4 = 159.9 | 161.2 / 161.5 = 161.3 (+0.9%) | 57.8 / 57.5 = 57.6 | 57.2 / 57.6 = 57.4 (-0.3%) | Free-running greedy `--mtp 2`, all flags, tok/s and draft acceptance: | | 4,096 | acceptance | 40,960 | acceptance | |---|---|---|---|---| | level 08 | 294.1 / 298.6 = 296.4 | 83% | 246.6 / 249.9 = 248.2 | 78.5% | | this PR | 307 / 306.8 = 306.9 (+3.6%) | 89% | 262.8 / 262.4 = 262.6 (+5.8%) | 81% | Where the extra slots do not change what the CPU pool does (40K, int8 + gqa only) the decode is level, within about 1%. GPU share of the decode rows with all flags: 86.2% -> 87.4% at 4K, 88.9% -> 89.8% at 40K. **Failed:** none observed. **Not run:** - A low-water check with `STRATA_Q36_VRAM_WATCH=1` on this branch, and the slot counts "with the opt-ins of the docs' measurement" above on this branch. - Decode at 16K; a run on a heavier desktop or with a second GPU program (where 256 MiB may not be enough). - One fast run never justifies a default: this PR has two runs per arm on one card. - Cards with 12 GB or 24/32 GB, Windows (where the desktop holds more VRAM), a second program using the GPU, multi-GPU. - HIP and SYCL builds (`cudaMemGetInfo` and a polling thread; never compiled for HIP). ## Limits One card, one desktop (GNOME on Fedora). A machine with a heavier desktop or another GPU program may fail where 768 MiB did not; `STRATA_Q36_HEADROOM_MIB=768` gives the old reserve back (documented in `docs/QWEN36.md`), and `--expert-vram` / `--expert-slots` bypass the reserve. ## 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#4828
No description provided.