[PR #3905] [Engine] qwen35: faster decode chain and prompt expert stream (two kernels always on, two opt-in flags) #4823

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/3905
Author: @xyehya
Created: 10/24/2026
Status: 🔄 Open

Base: main ← Head: pr/q36-04-bit-identical


📝 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

13 files changed (+3158 additions, -91 deletions)

View changed files

📝 CMakeLists.txt (+29 -0)
📝 docs/QWEN36.md (+112 -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 (+519 -83)
➕ src/qwen35/q36_gdn.cuh (+258 -0)
📝 src/qwen35/q36_kernels.cuh (+102 -0)
➕ src/qwen35/q36_pattn.cuh (+297 -0)
➕ tools/qwen35/q36_attn_parity.cu (+500 -0)
➕ tools/qwen35/q36_gdn_parity.cu (+199 -0)
➕ tools/qwen35/q36_pattn_parity.cu (+240 -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 4 of 9; it builds on #3904.

Branch pr/q36-04-bit-identical, stacked on pr/q36-03-prompt-read.

Problem and result

Three places in the Qwen3.6 engine path wait for something they do not need to wait for. Everything below keeps the logits byte-identical to the previous level, and with no flag the only change is item 1 (two kernels, bit-identical by construction and by test). Items 2 and 3 are opt-in flags.

  1. Decode (always on): k_add_rms_q and the MoE end (k_moe_out_s8: 8 experts, 2048 wide) re-read h through a volatile load and need nine or ten barriers for a 256-way sum. They now keep their values in registers and use one barrier, with the same pairing of the sum (same bits). Also always on: in the MMQ prompt path each token's MoE input is quantized once and scattered to its sorted rows (MMQ::quantize_scatter, already in the tree; NVFP4 activations keep quantize()), the wait for the routing counts is an event wait, and the shared expert is enqueued before it. These move no bytes.
  2. --side-stream (decode): the GDN z / alpha / beta products and the attention k / v products are independent of the layer's first matrix. They run on a second, higher-priority stream and join before the kernel that reads them.
  3. --split-stage-copy (prompt reads in the hybrid mode): the resident experts' device-to-device copies to the staging buffer ran on the PCIe copy stream, behind compute kernels. With the flag they run on a stream of their own, and the split copy is taken from 1/8 of the experts resident (before: below half).

Result on an RTX 5080 16 GB (same day, --max-context 262144 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn, level 03 against this level; runs in Validation):

  • No new flag (items 1 only): decode +4.7% at 4K (179.0 -> 187.4 tok/s), +2.4% at 16K, +4.1% at 40K; prompt read unchanged (4K 5,364 / 5,364, 16K 5,798 / 5,804, 40K 5,548 / 5,556, 90K 4,374 / 4,380 tok/s).
  • With --side-stream --split-stage-copy added: total against level 03 decode +9.1% / +6.6% / +8.5% at 4K / 16K / 40K; prompt read +28.4% at 4K (5,364 -> 6,887), +20.2% at 16K, +8.0% at 40K, +2.5% at 90K.
  • The two flags were measured together, not one at a time.

none (no scope issue). Both flags are off by default because the gain is measured on one card only: --side-stream costs about 40 us of host time per token, so host-bound shapes may gain less or lose; the old half-resident rule behind --split-stage-copy came from one RTX 3060 measurement (37 of 256 resident, both copy kinds on one stream) that has not been re-run with the separate stream. If a second card's numbers show a gain, either could become a default in a later PR.

Approach

  • Item 1 changes two kernels, with a unit harness and STRATA_Q36_VERIFY=1 for the same-bits claim.
  • --side-stream is used only for decode steps and verify windows that are not captured in a CUDA graph (the hybrid mode never uses graphs), and only when the driver gives the side stream a higher priority than the main stream (else the flag says so and is ignored); it is ignored under HIP. STRATA_Q36_SIDE_SKEW=<us> / STRATA_Q36_SIDE_SKEW_JOIN=<us> (tests) insert a spin kernel before the side stream's first kernel / before the join, to force the interleavings natural timing does not.
  • --split-stage-copy moves the threshold and the stream of the resident experts' copies; the bytes in staging are the same. With the flag off the copies stay where they were: the whole layer from host memory below half resident, and above that the resident runs on the copy stream, in order with the PCIe copies (the new stream and its events are created only with the flag). STRATA_Q36_STREAM_ALL=1 (existing) still gives the whole-layer copy. The side stream and its events are likewise created only with --side-stream.
  • The flags are in the usage text and docs/QWEN36.md. The two always-on steps are the only change to the default path; the former commit that also switched both flags on is split into three commits (kernels; side stream; MMQ prompt path steps; split copy).

Validation

Revision: branch pr/q36-04-bit-identical (af08278), level 03 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 plus the parity tools of the lower levels.

  • q36_attn_parity, q36_pattn_parity 1, q36_gdn_parity 1: pass.

  • Default path (no flags) against level 01's binary, fp32 cache: logits cmp at 4K and 14K IDENTICAL / IDENTICAL (command as in the level-02 PR). With --kv int8 --gqa-attn against level 02's binary (gate_a.sh): IDENTICAL / IDENTICAL.

  • Free-running slot count unchanged: 90 of 256 (fp32, 65K), 82 (int8, 262144).

  • The side stream's race test on this branch (--kv int8 --gqa-attn, fixed 56 slots, logits cmp of --side-stream against the same binary without it): plain --mtp 0 logits IDENTICAL / IDENTICAL (4K / 14K); with STRATA_Q36_SIDE_SKEW=300 STRATA_Q36_SIDE_SKEW_JOIN=300 (spin kernels of 300 us at the fork and at the join) --mtp 0 logits IDENTICAL / IDENTICAL. Verify windows (--dump-full-logits / --force do not run the speculative path, so these are free greedy generation of 160 tokens, 4K and 14K prompts, generated ids compared): --mtp 2 plain and with the skews, and --mtp 3 with the skews, IDENTICAL in all runs (--mtp 3: 95 of 192 drafts accepted, so windows of up to 4 rows ran).

  • --split-stage-copy against the same binary without it (--mtp 0, logits at 4K / 14K): IDENTICAL / IDENTICAL.

  • Above half resident, flags off (--expert-slots 128 --max-context 8192, 4K prompt, so the resident-runs branch of the staging copy runs): level 03's binary against this branch's, logits IDENTICAL (128 of 256 experts per layer resident, so the branch ran); with --split-stage-copy: IDENTICAL (bits are the same; speed is not measured).

  • The earlier commits report STRATA_Q36_VERIFY=1 --no-graph 0 mismatches in 92,263 comparisons for item 1; that run is from the tree the commit came from, not re-run on this branch.

  • The timings below were taken on the revision before the last amend of this branch (stack-4 changed only the staging-copy stream when at least half of the experts are resident, which this card does not reach: 82 to 97 of 256). The submitted revision af08278 was compared with the timed one by full-logit cmp with this level's flags on both sides (--attn-mma --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy, fixed 56 slots, 4K and 14K prompts): IDENTICAL / IDENTICAL (64,563,200 bytes each).

Timing (same box and day, 2026-10-23; one cold strata process per run under the GPU lock, arms alternated A-B-A-B, two runs each; level 03 built from 022982d, this level from the revision before the amend). Command, $P / $G = prompt ids and forced text of that depth, [flags] as in the table:

strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn [flags] --mtp 0 --tokens-file $P --n 256 --force "$G"   # tg
strata ... same arguments ... --mtp 0 --tokens-file $P --n 1                                                                                  # pp

Arms: level 03 (no extra flags); this level (no extra flags); this level with --side-stream --split-stage-copy. 94 experts per layer in VRAM in all three, GPU share and CPU entries equal within a depth. Individual runs, then the mean (tok/s):

level 03 this level, no flag this level, both flags
tg 4,096 179.1 / 178.9 = 179.0 187.2 / 187.6 = 187.4 (+4.7%) 195.8 / 194.6 = 195.2 (+9.1%)
tg 16,384 155.1 / 156.1 = 155.6 160 / 158.8 = 159.4 (+2.4%) 165.7 / 166.1 = 165.9 (+6.6%)
tg 40,960 171.7 / 171.2 = 171.4 178.2 / 178.9 = 178.6 (+4.1%) 185.7 / 186.2 = 185.9 (+8.5%)
pp 4,096 5364.7 / 5364.2 = 5364.4 5363.2 / 5363.8 = 5363.5 (-0.0%) 6893.5 / 6880.3 = 6886.9 (+28.4%)
pp 16,384 5797.7 / 5798.4 = 5798.0 5803.9 / 5803.5 = 5803.7 (+0.1%) 6967 / 6970.6 = 6968.8 (+20.2%)
pp 40,960 5540 / 5555.3 = 5547.6 5543.3 / 5569.1 = 5556.2 (+0.2%) 5991.8 / 5992.5 = 5992.1 (+8.0%)
pp 90,112 4385.9 / 4362.1 = 4374.0 4381.4 / 4379.2 = 4380.3 (+0.1%) 4485.7 / 4476.9 = 4481.3 (+2.5%)

Failed: none observed.

Not run:

  • --side-stream and --split-stage-copy one at a time (the timing arm has both on); decode with --mtp above 0 (timed with --mtp 0); timing of the submitted revision (compared by logits only).
  • --batch rows with --side-stream.
  • The 14K prompt reads here go through the split-copy path only when the placement has at least 1/8 of the experts resident (56 slots of 256 do).
  • Any card other than the RTX 5080: --split-stage-copy on a 12 GB card (RTX 3060, 37 of 256 resident) and --side-stream on a driver with one priority level.
  • HIP / SYCL builds (the priority code is guarded for HIP; never compiled for HIP).

Limits

One card, one model. The RTX 5080 in these runs holds 82 to 97 of 256 experts per layer, so the branch above half resident (the path an RTX 4090/5090-class card with 24 or 32 GB takes) was not reached in a normal run; it is unchanged by this PR when the flag is off, and a short run with 128 slots at a small context (below) compared the logits only. On the card in the docs --side-stream gives +1 to +1.4% in decode and --split-stage-copy +2% to +17% in the prompt read (4K / 16K / 40K); a machine where the host is the limit may not gain. The timing pass above measured the two flags together: decode +4.1% to +4.2% on top of the always-on kernels, prompt read +2.5% to +28.4% (4K to 90K).

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/3905 **Author:** [@xyehya](https://github.com/xyehya) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/q36-04-bit-identical` --- ### 📝 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 **13 files changed** (+3158 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+29 -0) 📝 `docs/QWEN36.md` (+112 -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` (+519 -83) ➕ `src/qwen35/q36_gdn.cuh` (+258 -0) 📝 `src/qwen35/q36_kernels.cuh` (+102 -0) ➕ `src/qwen35/q36_pattn.cuh` (+297 -0) ➕ `tools/qwen35/q36_attn_parity.cu` (+500 -0) ➕ `tools/qwen35/q36_gdn_parity.cu` (+199 -0) ➕ `tools/qwen35/q36_pattn_parity.cu` (+240 -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 4 of 9; it builds on #3904. Branch `pr/q36-04-bit-identical`, stacked on `pr/q36-03-prompt-read`. ## Problem and result Three places in the Qwen3.6 engine path wait for something they do not need to wait for. Everything below keeps the logits byte-identical to the previous level, and **with no flag the only change is item 1** (two kernels, bit-identical by construction and by test). Items 2 and 3 are opt-in flags. 1. Decode (always on): `k_add_rms_q` and the MoE end (`k_moe_out_s8`: 8 experts, 2048 wide) re-read `h` through a volatile load and need nine or ten barriers for a 256-way sum. They now keep their values in registers and use one barrier, with the same pairing of the sum (same bits). Also always on: in the MMQ prompt path each token's MoE input is quantized once and scattered to its sorted rows (`MMQ::quantize_scatter`, already in the tree; NVFP4 activations keep `quantize()`), the wait for the routing counts is an event wait, and the shared expert is enqueued before it. These move no bytes. 2. `--side-stream` (decode): the GDN `z` / `alpha` / `beta` products and the attention `k` / `v` products are independent of the layer's first matrix. They run on a second, higher-priority stream and join before the kernel that reads them. 3. `--split-stage-copy` (prompt reads in the hybrid mode): the resident experts' device-to-device copies to the staging buffer ran on the PCIe copy stream, behind compute kernels. With the flag they run on a stream of their own, and the split copy is taken from 1/8 of the experts resident (before: below half). Result on an RTX 5080 16 GB (same day, `--max-context 262144 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn`, level 03 against this level; runs in Validation): - No new flag (items 1 only): decode +4.7% at 4K (179.0 -> 187.4 tok/s), +2.4% at 16K, +4.1% at 40K; prompt read unchanged (4K 5,364 / 5,364, 16K 5,798 / 5,804, 40K 5,548 / 5,556, 90K 4,374 / 4,380 tok/s). - With `--side-stream --split-stage-copy` added: total against level 03 decode +9.1% / +6.6% / +8.5% at 4K / 16K / 40K; prompt read +28.4% at 4K (5,364 -> 6,887), +20.2% at 16K, +8.0% at 40K, +2.5% at 90K. - The two flags were measured together, not one at a time. ## Related discussion none (no scope issue). Both flags are off by default because the gain is measured on one card only: `--side-stream` costs about 40 us of host time per token, so host-bound shapes may gain less or lose; the old half-resident rule behind `--split-stage-copy` came from one RTX 3060 measurement (37 of 256 resident, both copy kinds on one stream) that has not been re-run with the separate stream. If a second card's numbers show a gain, either could become a default in a later PR. ## Approach - Item 1 changes two kernels, with a unit harness and `STRATA_Q36_VERIFY=1` for the same-bits claim. - `--side-stream` is used only for decode steps and verify windows that are not captured in a CUDA graph (the hybrid mode never uses graphs), and only when the driver gives the side stream a higher priority than the main stream (else the flag says so and is ignored); it is ignored under HIP. `STRATA_Q36_SIDE_SKEW=<us>` / `STRATA_Q36_SIDE_SKEW_JOIN=<us>` (tests) insert a spin kernel before the side stream's first kernel / before the join, to force the interleavings natural timing does not. - `--split-stage-copy` moves the threshold and the stream of the resident experts' copies; the bytes in staging are the same. With the flag off the copies stay where they were: the whole layer from host memory below half resident, and above that the resident runs on the copy stream, in order with the PCIe copies (the new stream and its events are created only with the flag). `STRATA_Q36_STREAM_ALL=1` (existing) still gives the whole-layer copy. The side stream and its events are likewise created only with `--side-stream`. - The flags are in the usage text and `docs/QWEN36.md`. The two always-on steps are the only change to the default path; the former commit that also switched both flags on is split into three commits (kernels; side stream; MMQ prompt path steps; split copy). ## Validation Revision: branch `pr/q36-04-bit-identical` (af08278), level 03 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` plus the parity tools of the lower levels. - `q36_attn_parity`, `q36_pattn_parity 1`, `q36_gdn_parity 1`: pass. - Default path (no flags) against level 01's binary, fp32 cache: logits `cmp` at 4K and 14K IDENTICAL / IDENTICAL (command as in the level-02 PR). With `--kv int8 --gqa-attn` against level 02's binary (`gate_a.sh`): IDENTICAL / IDENTICAL. - Free-running slot count unchanged: 90 of 256 (fp32, 65K), 82 (int8, 262144). - The side stream's race test on this branch (`--kv int8 --gqa-attn`, fixed 56 slots, logits `cmp` of `--side-stream` against the same binary without it): plain `--mtp 0` logits IDENTICAL / IDENTICAL (4K / 14K); with `STRATA_Q36_SIDE_SKEW=300 STRATA_Q36_SIDE_SKEW_JOIN=300` (spin kernels of 300 us at the fork and at the join) `--mtp 0` logits IDENTICAL / IDENTICAL. Verify windows (`--dump-full-logits` / `--force` do not run the speculative path, so these are free greedy generation of 160 tokens, 4K and 14K prompts, generated ids compared): `--mtp 2` plain and with the skews, and `--mtp 3` with the skews, IDENTICAL in all runs (`--mtp 3`: 95 of 192 drafts accepted, so windows of up to 4 rows ran). - `--split-stage-copy` against the same binary without it (`--mtp 0`, logits at 4K / 14K): IDENTICAL / IDENTICAL. - Above half resident, flags off (`--expert-slots 128 --max-context 8192`, 4K prompt, so the resident-runs branch of the staging copy runs): level 03's binary against this branch's, logits IDENTICAL (128 of 256 experts per layer resident, so the branch ran); with `--split-stage-copy`: IDENTICAL (bits are the same; speed is not measured). - The earlier commits report `STRATA_Q36_VERIFY=1 --no-graph` 0 mismatches in 92,263 comparisons for item 1; that run is from the tree the commit came from, not re-run on this branch. - The timings below were taken on the revision before the last amend of this branch (stack-4 changed only the staging-copy stream when at least half of the experts are resident, which this card does not reach: 82 to 97 of 256). The submitted revision `af08278` was compared with the timed one by full-logit `cmp` with this level's flags on both sides (`--attn-mma --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy`, fixed 56 slots, 4K and 14K prompts): IDENTICAL / IDENTICAL (64,563,200 bytes each). **Timing** (same box and day, 2026-10-23; one cold `strata` process per run under the GPU lock, arms alternated A-B-A-B, two runs each; level 03 built from `022982d`, this level from the revision before the amend). Command, `$P` / `$G` = prompt ids and forced text of that depth, `[flags]` as in the table: ``` strata --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn [flags] --mtp 0 --tokens-file $P --n 256 --force "$G" # tg strata ... same arguments ... --mtp 0 --tokens-file $P --n 1 # pp ``` Arms: level 03 (no extra flags); this level (no extra flags); this level with `--side-stream --split-stage-copy`. 94 experts per layer in VRAM in all three, GPU share and CPU entries equal within a depth. Individual runs, then the mean (tok/s): | | level 03 | this level, no flag | this level, both flags | |---|---|---|---| | tg 4,096 | 179.1 / 178.9 = 179.0 | 187.2 / 187.6 = 187.4 (+4.7%) | 195.8 / 194.6 = 195.2 (+9.1%) | | tg 16,384 | 155.1 / 156.1 = 155.6 | 160 / 158.8 = 159.4 (+2.4%) | 165.7 / 166.1 = 165.9 (+6.6%) | | tg 40,960 | 171.7 / 171.2 = 171.4 | 178.2 / 178.9 = 178.6 (+4.1%) | 185.7 / 186.2 = 185.9 (+8.5%) | | pp 4,096 | 5364.7 / 5364.2 = 5364.4 | 5363.2 / 5363.8 = 5363.5 (-0.0%) | 6893.5 / 6880.3 = 6886.9 (+28.4%) | | pp 16,384 | 5797.7 / 5798.4 = 5798.0 | 5803.9 / 5803.5 = 5803.7 (+0.1%) | 6967 / 6970.6 = 6968.8 (+20.2%) | | pp 40,960 | 5540 / 5555.3 = 5547.6 | 5543.3 / 5569.1 = 5556.2 (+0.2%) | 5991.8 / 5992.5 = 5992.1 (+8.0%) | | pp 90,112 | 4385.9 / 4362.1 = 4374.0 | 4381.4 / 4379.2 = 4380.3 (+0.1%) | 4485.7 / 4476.9 = 4481.3 (+2.5%) | **Failed:** none observed. **Not run:** - `--side-stream` and `--split-stage-copy` one at a time (the timing arm has both on); decode with `--mtp` above 0 (timed with `--mtp 0`); timing of the submitted revision (compared by logits only). - `--batch` rows with `--side-stream`. - The 14K prompt reads here go through the split-copy path only when the placement has at least 1/8 of the experts resident (56 slots of 256 do). - Any card other than the RTX 5080: `--split-stage-copy` on a 12 GB card (RTX 3060, 37 of 256 resident) and `--side-stream` on a driver with one priority level. - HIP / SYCL builds (the priority code is guarded for HIP; never compiled for HIP). ## Limits One card, one model. The RTX 5080 in these runs holds 82 to 97 of 256 experts per layer, so the branch above half resident (the path an RTX 4090/5090-class card with 24 or 32 GB takes) was **not reached in a normal run**; it is unchanged by this PR when the flag is off, and a short run with 128 slots at a small context (below) compared the logits only. On the card in the docs `--side-stream` gives +1 to +1.4% in decode and `--split-stage-copy` +2% to +17% in the prompt read (4K / 16K / 40K); a machine where the host is the limit may not gain. The timing pass above measured the two flags together: decode +4.1% to +4.2% on top of the always-on kernels, prompt read +2.5% to +28.4% (4K to 90K). ## 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#4823
No description provided.