[PR #3906] [Engine] qwen35: hybrid mode: expert placement opt-ins, --async-swaps and --lend-staging #4824

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

Base: main ← Head: pr/q36-05-placement-vram


📝 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 (+4064 additions, -132 deletions)

View changed files

📝 CMakeLists.txt (+29 -0)
📝 docs/QWEN36.md (+181 -3)
📝 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 (+1345 -118)
➕ src/qwen35/q36_gdn.cuh (+258 -0)
📝 src/qwen35/q36_kernels.cuh (+113 -4)
➕ 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 5 of 9; it builds on #3905.

Branch pr/q36-05-placement-vram, stacked on pr/q36-04-bit-identical.

Problem and result

In the hybrid mode (the experts do not all fit in VRAM) three things leave GPU time or VRAM unused. All are opt-in flags; with none of them the engine runs as before. The three groups are independent of each other (each has its own code path; the only shared edit is that --lend-staging adds two trailing arguments with defaults to three grouping kernels), so they can be opened as three PRs if review prefers; they are in one branch of three commits.

  • Placement (--expert-profile F, --expert-profile-save F, --decode-swaps N, --hybrid-zero-copy, --expert-prefetch P): start the slots from a profile and save what a run learned; set the swap rate; hand routing and CPU rows over through mapped pinned memory; fill P slots per layer ahead from the next layer's router.
  • --async-swaps / --async-after-prompt: slot swaps off the engine stream. The synchronous swap cost 20.8 ms per 256 decode tokens at 4K (0.08 ms a token) and 40 to 45 ms after every prompt read.
  • --lend-staging: the two prompt-staging buffers (0.97 GiB) hold 13 more expert slots per layer while decoding.

Result on an RTX 5080 16 GB (same day, --max-context 262144, level 04 with its flags against this level; runs in Validation):

  • All of it together (--expert-profile, --expert-prefetch 2, --hybrid-zero-copy, --decode-swaps 64, --async-swaps, --lend-staging): decode +17.3% at 4K (195.6 -> 229.4 tok/s) and +13.0% at 40K (186.2 -> 210.5); prompt read at 40K +1.1% (5,970 -> 6,033), with 92 experts per layer in VRAM instead of 94. Flags off, this level decodes like level 04 (195.8 / 186.0).
  • One at a time (two runs each, 4K / 40K): --expert-profile +9.2% / +8.7%; profile with --expert-prefetch 2 +10.9% / +9.8%; --hybrid-zero-copy +4.6% / +4.7%; --decode-swaps 64 +0.6% / +2.9%; --async-swaps -0.2% / -0.2%; --lend-staging alone -3.7% / -5.0%. Inside the full set --lend-staging is worth about +3% (the set without it: -3.0% at 4K, -3.1% at 40K). The parts do not add up, so read the flags as a group.
  • --expert-prefetch (with copies), --async-swaps and --lend-staging are timing-dependent: their output is not reproducible run to run.

none yet. The profile flags use the main path's names and file format (src/core/expert_cache.cpp, unchanged). --expert-prefetch is not reproducible run to run (a copy is used only once it has landed, so the output depends on timing); --async-swaps is the same. The PR text says so per flag.

Approach

Each flag has its own code path and a line in the usage text and docs/QWEN36.md (including the test settings STRATA_Q36_PF_CHECK, _PF_GEN_START, _STAGE_TAIL_CHECK, _AFTER_SWAPS_PER_KTOK, _LEND_SETTLE, _LEND_PRIOR, _ASYNC_SWAPS). The lent slots are a third slot class after the cache and prefetch slots, with their own base pointer: k_group_small, k_route_group and k_group_hy take it as two trailing arguments whose defaults leave every other path as it was. The async path moves a new expert into the host and device tables only when its batch's event is done, checked at the start of the next forward, so no slot is read before its bytes arrived. The exit report gets rebalance:, lent slots:, async swaps: and table check: lines.

Validation

Revision: branch pr/q36-05-placement-vram (e301d0c), level 04 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 parity tools.
  • Parity tools of lower levels: pass.
  • Default path against level 01's binary, flags off, fixed 56 slots, fp32 cache: logits cmp at 4K / 14K IDENTICAL / IDENTICAL; gate_a.sh against level 02's binary: IDENTICAL / IDENTICAL.
  • Free-running slot count unchanged: 90 of 256 (fp32, 65K), 82 (int8, 262144).
  • Free-running smoke (rebalancing on, --expert-slots 56, no FIXED_SLOTS, --kv int8 --gqa-attn --mtp 0): logits cmp of level 04's binary against this branch's, flags off, 4K / 14K: IDENTICAL / IDENTICAL; level 04's binary against itself (is a free-running run reproducible): IDENTICAL / IDENTICAL.

Timing (same box and day, 2026-10-23; one cold strata process per run under the GPU lock; arms alternated, two runs each, four for the full set; level 04 built from the revision before its last amend, this level from 12bd46a, the revision before the last amend of the stack). $PROFILE = an expert profile saved from an agent session (--expert-profile-save; not in the repository). Common arguments: --native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy, then the arm's flags, then --mtp 0 --tokens-file $P --n 256 --force "$G" (tg) or --n 1 (pp):

strata <common> --expert-profile $PROFILE --expert-prefetch 2 --hybrid-zero-copy --decode-swaps 64 --async-swaps --lend-staging --mtp 0 --tokens-file $P --n 256 --force "$G"

tg = decode tok/s, individual runs, then the mean; the change is against level 04 with the common flags:

arm (flags after the common ones) slots tg 4,096 tg 40,960
level 04, none 94 195.6 / 195.7 = 195.6 186.2 / 186.2 = 186.2
this level, none 94 195.6 / 195.9 = 195.8 (+0.1%) 186.3 / 185.7 = 186.0 (-0.1%)
--expert-profile 94 214.4 / 212.8 = 213.6 (+9.2%) 203 / 201.9 = 202.4 (+8.7%)
--expert-profile --expert-prefetch 2 92 217.1 / 217 = 217.1 (+10.9%) 204.5 / 204.4 = 204.4 (+9.8%)
--hybrid-zero-copy 94 206 / 203.4 = 204.7 (+4.6%) 195 / 195 = 195.0 (+4.7%)
--decode-swaps 64 94 196.7 / 197.1 = 196.9 (+0.6%) 191.6 / 191.6 = 191.6 (+2.9%)
--async-swaps 94 195.3 / 195.1 = 195.2 (-0.2%) 186.1 / 185.7 = 185.9 (-0.2%)
--lend-staging 94 188.3 / 188.5 = 188.4 (-3.7%) 176.8 / 177 = 176.9 (-5.0%)
full set (profile, prefetch 2, zero-copy, decode-swaps 64, async-swaps, lend-staging) 92 229.5 / 229.6 / 229.3 / 229.2 = 229.4 (+17.3%) 210.3 / 210.5 / 210.4 / 210.7 = 210.5 (+13.0%)
full set minus --lend-staging 92 222.6 / 222.5 = 222.6 (+13.7%) 207.1 / 200.7 = 203.9 (+9.5%)

Prompt read at 40,960 tokens (pp tok/s): level 04 5967.8 / 5971.2 = 5969.5; full set 6042.2 / 6029.6 / 6037.8 / 6022.5 = 6033.0 (+1.1%); full set minus --lend-staging 6027.9 / 6014.7 = 6021.3 (+0.9%). GPU share of decode rows: 74.7% (level 04) -> 81.8% (profile alone) -> 90.8% (full set).

The timed binaries are the revision before stack-4. Full-logit cmp of the submitted revision e301d0c against the timed one, with the full set of this level's flags on both sides (fixed 56 slots, 4K and 14K): DIFFERENT, and so is the same binary against itself with the same flags (control: mean KL 6.88e-3 / 5.16e-3 at 4K / 14K, top-1 62/65 and 58/65, no step above 0.1; submitted against timed: 5.22e-3 / 5.08e-3, top-1 63/65 and 60/65). The set's output varies from run to run, so the equality of the two revisions was not shown by cmp; nothing in the difference points at the revision. The control with --prefetch-copies 0 (deterministic prefetch) could not run: that flag arrives in the next PR.

Failed: none observed.

Not run:

  • Decode at 16K, --async-after-prompt alone, STRATA_Q36_PF_CHECK=1 runs; a repeat-run spread of the timing-dependent flags beyond the runs above.
  • A cmp of the submitted revision against the timed one with deterministic flags only (see the control above).
  • The fixed-slot identity gates run with STRATA_Q36_FIXED_SLOTS=1, which turns off the slot rebalancing this PR restructures; the free-running smoke above is the only check of the rebalancing, and it is a logits compare, not a timing.
  • HIP / SYCL builds (nothing is guarded for HIP beyond the existing idiom; never compiled for HIP).
  • Cards other than the RTX 5080, other CPUs / memory speeds.

Limits

  • --expert-prefetch, --async-swaps and --async-after-prompt are timing-dependent (not reproducible run to run); the others are deterministic.
  • Measured on one machine (DDR5 at 6400 MT/s configured, 2 channels); the hybrid mode is bound by RAM bandwidth, so numbers move with the memory.

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/3906 **Author:** [@xyehya](https://github.com/xyehya) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/q36-05-placement-vram` --- ### 📝 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** (+4064 additions, -132 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+29 -0) 📝 `docs/QWEN36.md` (+181 -3) 📝 `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` (+1345 -118) ➕ `src/qwen35/q36_gdn.cuh` (+258 -0) 📝 `src/qwen35/q36_kernels.cuh` (+113 -4) ➕ `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 5 of 9; it builds on #3905. Branch `pr/q36-05-placement-vram`, stacked on `pr/q36-04-bit-identical`. ## Problem and result In the hybrid mode (the experts do not all fit in VRAM) three things leave GPU time or VRAM unused. All are opt-in flags; with none of them the engine runs as before. **The three groups are independent of each other** (each has its own code path; the only shared edit is that `--lend-staging` adds two trailing arguments with defaults to three grouping kernels), so they can be opened as three PRs if review prefers; they are in one branch of three commits. - Placement (`--expert-profile F`, `--expert-profile-save F`, `--decode-swaps N`, `--hybrid-zero-copy`, `--expert-prefetch P`): start the slots from a profile and save what a run learned; set the swap rate; hand routing and CPU rows over through mapped pinned memory; fill P slots per layer ahead from the next layer's router. - `--async-swaps` / `--async-after-prompt`: slot swaps off the engine stream. The synchronous swap cost 20.8 ms per 256 decode tokens at 4K (0.08 ms a token) and 40 to 45 ms after every prompt read. - `--lend-staging`: the two prompt-staging buffers (0.97 GiB) hold 13 more expert slots per layer while decoding. Result on an RTX 5080 16 GB (same day, `--max-context 262144`, level 04 with its flags against this level; runs in Validation): - All of it together (`--expert-profile`, `--expert-prefetch 2`, `--hybrid-zero-copy`, `--decode-swaps 64`, `--async-swaps`, `--lend-staging`): decode +17.3% at 4K (195.6 -> 229.4 tok/s) and +13.0% at 40K (186.2 -> 210.5); prompt read at 40K +1.1% (5,970 -> 6,033), with 92 experts per layer in VRAM instead of 94. Flags off, this level decodes like level 04 (195.8 / 186.0). - One at a time (two runs each, 4K / 40K): `--expert-profile` +9.2% / +8.7%; profile with `--expert-prefetch 2` +10.9% / +9.8%; `--hybrid-zero-copy` +4.6% / +4.7%; `--decode-swaps 64` +0.6% / +2.9%; `--async-swaps` -0.2% / -0.2%; **`--lend-staging` alone -3.7% / -5.0%**. Inside the full set `--lend-staging` is worth about +3% (the set without it: -3.0% at 4K, -3.1% at 40K). The parts do not add up, so read the flags as a group. - `--expert-prefetch` (with copies), `--async-swaps` and `--lend-staging` are timing-dependent: their output is not reproducible run to run. ## Related discussion none yet. The profile flags use the main path's names and file format (`src/core/expert_cache.cpp`, unchanged). `--expert-prefetch` is not reproducible run to run (a copy is used only once it has landed, so the output depends on timing); `--async-swaps` is the same. The PR text says so per flag. ## Approach Each flag has its own code path and a line in the usage text and `docs/QWEN36.md` (including the test settings `STRATA_Q36_PF_CHECK`, `_PF_GEN_START`, `_STAGE_TAIL_CHECK`, `_AFTER_SWAPS_PER_KTOK`, `_LEND_SETTLE`, `_LEND_PRIOR`, `_ASYNC_SWAPS`). The lent slots are a third slot class after the cache and prefetch slots, with their own base pointer: `k_group_small`, `k_route_group` and `k_group_hy` take it as two trailing arguments whose defaults leave every other path as it was. The async path moves a new expert into the host and device tables only when its batch's event is done, checked at the start of the next forward, so no slot is read before its bytes arrived. The exit report gets `rebalance:`, `lent slots:`, `async swaps:` and `table check:` lines. ## Validation Revision: branch `pr/q36-05-placement-vram` (e301d0c), level 04 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 parity tools. - Parity tools of lower levels: pass. - Default path against level 01's binary, flags off, fixed 56 slots, fp32 cache: logits `cmp` at 4K / 14K IDENTICAL / IDENTICAL; `gate_a.sh` against level 02's binary: IDENTICAL / IDENTICAL. - Free-running slot count unchanged: 90 of 256 (fp32, 65K), 82 (int8, 262144). - Free-running smoke (rebalancing on, `--expert-slots 56`, no FIXED_SLOTS, `--kv int8 --gqa-attn --mtp 0`): logits `cmp` of level 04's binary against this branch's, flags off, 4K / 14K: IDENTICAL / IDENTICAL; level 04's binary against itself (is a free-running run reproducible): IDENTICAL / IDENTICAL. **Timing** (same box and day, 2026-10-23; one cold `strata` process per run under the GPU lock; arms alternated, two runs each, four for the full set; level 04 built from the revision before its last amend, this level from `12bd46a`, the revision before the last amend of the stack). `$PROFILE` = an expert profile saved from an agent session (`--expert-profile-save`; not in the repository). Common arguments: `--native $MODEL --max-context 262144 --prefill auto --pool-workers 16 --kv int8 --gqa-attn --fused-prompt-attn --chunked-gdn --side-stream --split-stage-copy`, then the arm's flags, then `--mtp 0 --tokens-file $P --n 256 --force "$G"` (tg) or `--n 1` (pp): ``` strata <common> --expert-profile $PROFILE --expert-prefetch 2 --hybrid-zero-copy --decode-swaps 64 --async-swaps --lend-staging --mtp 0 --tokens-file $P --n 256 --force "$G" ``` tg = decode tok/s, individual runs, then the mean; the change is against level 04 with the common flags: | arm (flags after the common ones) | slots | tg 4,096 | tg 40,960 | |---|---:|---|---| | level 04, none | 94 | 195.6 / 195.7 = 195.6 | 186.2 / 186.2 = 186.2 | | this level, none | 94 | 195.6 / 195.9 = 195.8 (+0.1%) | 186.3 / 185.7 = 186.0 (-0.1%) | | `--expert-profile` | 94 | 214.4 / 212.8 = 213.6 (+9.2%) | 203 / 201.9 = 202.4 (+8.7%) | | `--expert-profile --expert-prefetch 2` | 92 | 217.1 / 217 = 217.1 (+10.9%) | 204.5 / 204.4 = 204.4 (+9.8%) | | `--hybrid-zero-copy` | 94 | 206 / 203.4 = 204.7 (+4.6%) | 195 / 195 = 195.0 (+4.7%) | | `--decode-swaps 64` | 94 | 196.7 / 197.1 = 196.9 (+0.6%) | 191.6 / 191.6 = 191.6 (+2.9%) | | `--async-swaps` | 94 | 195.3 / 195.1 = 195.2 (-0.2%) | 186.1 / 185.7 = 185.9 (-0.2%) | | `--lend-staging` | 94 | 188.3 / 188.5 = 188.4 (-3.7%) | 176.8 / 177 = 176.9 (-5.0%) | | full set (profile, prefetch 2, zero-copy, decode-swaps 64, async-swaps, lend-staging) | 92 | 229.5 / 229.6 / 229.3 / 229.2 = 229.4 (+17.3%) | 210.3 / 210.5 / 210.4 / 210.7 = 210.5 (+13.0%) | | full set minus `--lend-staging` | 92 | 222.6 / 222.5 = 222.6 (+13.7%) | 207.1 / 200.7 = 203.9 (+9.5%) | Prompt read at 40,960 tokens (pp tok/s): level 04 5967.8 / 5971.2 = 5969.5; full set 6042.2 / 6029.6 / 6037.8 / 6022.5 = 6033.0 (+1.1%); full set minus `--lend-staging` 6027.9 / 6014.7 = 6021.3 (+0.9%). GPU share of decode rows: 74.7% (level 04) -> 81.8% (profile alone) -> 90.8% (full set). The timed binaries are the revision before stack-4. Full-logit `cmp` of the submitted revision `e301d0c` against the timed one, with the full set of this level's flags on both sides (fixed 56 slots, 4K and 14K): DIFFERENT, and so is the same binary against itself with the same flags (control: mean KL 6.88e-3 / 5.16e-3 at 4K / 14K, top-1 62/65 and 58/65, no step above 0.1; submitted against timed: 5.22e-3 / 5.08e-3, top-1 63/65 and 60/65). The set's output varies from run to run, so the equality of the two revisions was not shown by `cmp`; nothing in the difference points at the revision. The control with `--prefetch-copies 0` (deterministic prefetch) could not run: that flag arrives in the next PR. **Failed:** none observed. **Not run:** - Decode at 16K, `--async-after-prompt` alone, `STRATA_Q36_PF_CHECK=1` runs; a repeat-run spread of the timing-dependent flags beyond the runs above. - A `cmp` of the submitted revision against the timed one with deterministic flags only (see the control above). - The fixed-slot identity gates run with `STRATA_Q36_FIXED_SLOTS=1`, which turns off the slot rebalancing this PR restructures; the free-running smoke above is the only check of the rebalancing, and it is a logits compare, not a timing. - HIP / SYCL builds (nothing is guarded for HIP beyond the existing idiom; never compiled for HIP). - Cards other than the RTX 5080, other CPUs / memory speeds. ## Limits - `--expert-prefetch`, `--async-swaps` and `--async-after-prompt` are timing-dependent (not reproducible run to run); the others are deterministic. - Measured on one machine (DDR5 at 6400 MT/s configured, 2 channels); the hybrid mode is bound by RAM bandwidth, so numbers move with the memory. ## 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#4824
No description provided.