[GH-ISSUE #5176] Gyro-M on a 64 GB Mac: the whole expert set fits in the expert cache, but setup writes 64 slots and drops the MTP #3081

Open
opened 2026-11-07 14:37:55 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @Flo5k5 on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5176

Following up on #5169 (MTP pays under the 96 GB streaming threshold) with a stronger finding from the same machine.

Setup: Mac mini M5 Pro 64 GB, branch v0.2.6 + #3876 + #4126 + our TYPE_SIZE patch (#5167), Gyro-M TQ2_0 (7aa36d15), same pack as the community reports in #5168.

Finding: Gyro-M's experts (all of them — 24576 slots, 29.88 GiB of VRAM) fit in a 64 GB Mac's unified memory once oMLX/other servers are stopped. --expert-cache 24576 pre-fills the whole set from the profile in 45 s (705 MB/s) at boot, and after that the expert-tier counters never move again (since the start RAM 0 blobs, files 0 blobs) — the SSD streaming disappears entirely. The setup's own config for this machine writes --expert-cache 64 and removes the MTP layer, which leaves the model streaming and slow.

Measured (strata bench run, thinking-v1-draft.1 protocol, median short/4K/16K decode tok/s, 3 runs each, engine 0.1.50-metal):

Config short 4K 16K
setup default the day before (streaming, cache 64, suffix only — community protocol) 25.7 — —
expert-cache 24576, --spec 4, --suffix-draft 3 43.4 43.5 42.8
+ --suffix-draft 8, --pool-workers 4 (calibrate.py's pick on this Mac) 46.0 44.5 42.3

Also measured and rejected on this machine: --spec 6 (loses everywhere), --lookup-chain 2 (kills the 16K case: 37.4), --spec-min-p 0.7 (wins short at 47.1, loses 4K/16K), re-benching hot vs cold (no difference once the cache is full at boot — the warm-up argument disappears with the full cache).

tools/calibrate.py on this Mac: pool-workers 4 (+12.6% on a miss-heavy engine, +0.4 once the cache is full), pcie-frac 0.55 default confirmed, spec-min-p 0.5 default confirmed, default adaptive tier kept.

Suggestion: when mac_fit computes the plan for a Gyro model, check whether all experts fit the available VRAM budget and, if so, write the full --expert-cache count (plus keep the MTP on). On this 64 GB machine that single change is the difference between streaming and resident.

The remaining gap to the Q2_0 resident speed (66 tok/s) is the TQ2_T Metal decode path itself — the trellis dequant costs more per expert than Q2_0's — which is kernel work, not configuration.

Originally created by @Flo5k5 on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5176 Following up on #5169 (MTP pays under the 96 GB streaming threshold) with a stronger finding from the same machine. **Setup:** Mac mini M5 Pro 64 GB, branch v0.2.6 + #3876 + #4126 + our TYPE_SIZE patch (#5167), Gyro-M TQ2_0 (`7aa36d15`), same pack as the community reports in #5168. **Finding:** Gyro-M's experts (all of them — 24576 slots, 29.88 GiB of VRAM) fit in a 64 GB Mac's unified memory once oMLX/other servers are stopped. `--expert-cache 24576` pre-fills the whole set from the profile in 45 s (705 MB/s) at boot, and after that the expert-tier counters never move again (`since the start RAM 0 blobs, files 0 blobs`) — the SSD streaming disappears entirely. The setup's own config for this machine writes `--expert-cache 64` and removes the MTP layer, which leaves the model streaming and slow. **Measured** (strata bench run, thinking-v1-draft.1 protocol, median short/4K/16K decode tok/s, 3 runs each, engine 0.1.50-metal): | Config | short | 4K | 16K | |---|---|---|---| | setup default the day before (streaming, cache 64, suffix only — community protocol) | 25.7 | — | — | | expert-cache 24576, --spec 4, --suffix-draft 3 | 43.4 | 43.5 | 42.8 | | + --suffix-draft 8, --pool-workers 4 (calibrate.py's pick on this Mac) | 46.0 | 44.5 | 42.3 | Also measured and rejected on this machine: `--spec 6` (loses everywhere), `--lookup-chain 2` (kills the 16K case: 37.4), `--spec-min-p 0.7` (wins short at 47.1, loses 4K/16K), re-benching hot vs cold (no difference once the cache is full at boot — the warm-up argument disappears with the full cache). `tools/calibrate.py` on this Mac: pool-workers 4 (+12.6% on a miss-heavy engine, +0.4 once the cache is full), pcie-frac 0.55 default confirmed, spec-min-p 0.5 default confirmed, default adaptive tier kept. **Suggestion:** when `mac_fit` computes the plan for a Gyro model, check whether *all* experts fit the available VRAM budget and, if so, write the full `--expert-cache` count (plus keep the MTP on). On this 64 GB machine that single change is the difference between streaming and resident. The remaining gap to the Q2_0 resident speed (66 tok/s) is the TQ2_T Metal decode path itself — the trellis dequant costs more per expert than Q2_0's — which is kernel work, not configuration.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 4, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6621675132 --> @github-actions[bot] commented on GitHub (Nov 4, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

Follow-up: where the remaining time actually goes on this machine.

With STRATA_VERIFY_PROFILE=1 STRATA_DECODE_TIMING=1 on the same config (expert cache full, so no streaming):

65 windows, avg T 2.89, 1.82 tokens/window, 53.72 ms/window
= verify 47.09 (GPU-reach wait 0.00 + per-layer host 0.00 [plan 0.00 actq 0.00 jobs 0.00 CPU 0.00] + stage 0.00)
+ commit/emit 0.02 + draft 6.60; per layer-window: CPU experts 0.00, VRAM hits 0.00, PCIe 0.00

Everything outside the verify kernels is zero — the ceiling is pure GPU compute in the expert path, and the decode-side profile confirms what the Q2_0 comparison suggested:

  • The TQ2_T dequant (quant.metal, deq_tq<8>) lives on threadgroup gathers: per 16 weights, 4 IMAD hashes and 8 lookups into the 2048-point codebook. The repo's own alu_bench on this M5 Pro measures a_tgload at 420 Gops/s vs ~3,700 for the integer ALU around it — the one operation the trellis path needs most is 6-9x slower than everything else.
  • The ~50% draft acceptance (53/123, 74/141 measured) pulls the average window to T 2.89, so each dequantized unit is only combined with ~3 rows — the gather cost per useful token compounds.
  • The "only 0 MiB of VRAM free" warning (#2065) fires here on the first request of every run (recommendedMaxWorkingSetSize 55.7 GB, planned footprint 38.9 GB, real cap 41.2 GB = RAM minus 27.5 for macOS + file cache), but it is a false signal at these footprints: shrinking the arena to 16384 slots frees ~8 GB and drops decode to 33.6 tok/s (streamed misses) with the warning still firing. Decode never falls to "a few tok/s".
  • STRATA_METAL_F16=1 (the LPR 16 / NR 2 trellis variant of window.cpp:1192) measures 40.6 tok/s against 41.6 for the float path — neutral here.

Ideas that would move the 44 → 50+ on this class of machine, in rough order of impact: expose or auto-tune NR 2/4 on the float path (window.cpp:2468 hardcodes gr = 1, so each unit is dequantized per row while the f16 variant already has an NR 2 form); a hot-expert fp16 pre-dequantized cache in the ~8.8 GB of VRAM that stays free with the full expert cache (the routing is concentrated enough for the profile fill to matter); a per-phase --spec-min-p (thinking accepts far better than the sampling-temperature-1 answer phase).

None of this is a bug — the trellis tax is structural to the format, and the same machine keeps a bigger Q2_0 at 66 tok/s resident. Happy to test any of these on this Mac if a branch exists.

<!-- gh-comment-id:6626228892 --> @Flo5k5 commented on GitHub (Nov 4, 2026): Follow-up: where the remaining time actually goes on this machine. With `STRATA_VERIFY_PROFILE=1 STRATA_DECODE_TIMING=1` on the same config (expert cache full, so no streaming): ``` 65 windows, avg T 2.89, 1.82 tokens/window, 53.72 ms/window = verify 47.09 (GPU-reach wait 0.00 + per-layer host 0.00 [plan 0.00 actq 0.00 jobs 0.00 CPU 0.00] + stage 0.00) + commit/emit 0.02 + draft 6.60; per layer-window: CPU experts 0.00, VRAM hits 0.00, PCIe 0.00 ``` Everything outside the verify kernels is zero — the ceiling is pure GPU compute in the expert path, and the decode-side profile confirms what the Q2_0 comparison suggested: - The TQ2_T dequant (`quant.metal`, `deq_tq<8>`) lives on threadgroup gathers: per 16 weights, 4 IMAD hashes and **8 lookups into the 2048-point codebook**. The repo's own `alu_bench` on this M5 Pro measures `a_tgload` at **420 Gops/s** vs ~3,700 for the integer ALU around it — the one operation the trellis path needs most is 6-9x slower than everything else. - The ~50% draft acceptance (53/123, 74/141 measured) pulls the average window to T 2.89, so each dequantized unit is only combined with ~3 rows — the gather cost per useful token compounds. - The "only 0 MiB of VRAM free" warning (#2065) fires here on the first request of every run (recommendedMaxWorkingSetSize 55.7 GB, planned footprint 38.9 GB, real cap 41.2 GB = RAM minus 27.5 for macOS + file cache), but it is a false signal at these footprints: shrinking the arena to 16384 slots frees ~8 GB and *drops* decode to 33.6 tok/s (streamed misses) with the warning still firing. Decode never falls to "a few tok/s". - `STRATA_METAL_F16=1` (the LPR 16 / NR 2 trellis variant of `window.cpp:1192`) measures 40.6 tok/s against 41.6 for the float path — neutral here. Ideas that would move the 44 → 50+ on this class of machine, in rough order of impact: expose or auto-tune NR 2/4 on the float path (`window.cpp:2468` hardcodes `gr = 1`, so each unit is dequantized per row while the f16 variant already has an NR 2 form); a hot-expert fp16 pre-dequantized cache in the ~8.8 GB of VRAM that stays free with the full expert cache (the routing is concentrated enough for the profile fill to matter); a per-phase `--spec-min-p` (thinking accepts far better than the sampling-temperature-1 answer phase). None of this is a bug — the trellis tax is structural to the format, and the same machine keeps a bigger Q2_0 at 66 tok/s resident. Happy to test any of these on this Mac if a branch exists.
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

Update: the DFlash2 drafter does run on Metal — we had it compiled out.

Our first engine build came from a branch without commit 1d36e65a ("metal: DFlash2 drafter on the Metal window"), so the engine silently ignored --draft dflash2, the host remembered the failure and stripped the flags, and yesterday's "DFlash2 wins nothing" measurement was actually the suffix drafter alone. After rebuilding (0.1.56-metal) and placing the pack where the host looks for it (<data-dir>/dflash2/qwen3.8-flash-next-dflash2.q8.pack + draft_vocab.bin; our hand-packed 725 MB file is the accepted legacy Q8), the engine logs "DFlash2 drafter on".

Re-run duel, same machine, same engine build, same standard bench (full expert cache, --spec 4, --suffix-draft 8, --pool-workers 4):

drafter short 4K 16K mean
DFlash2 47.1 47.6 38.2 44.3
MTP 46.7 44.6 36.4 42.6

DFlash2 wins all three cases (+4% mean) with a measured acceptance of 96/143 = 67% against the MTP's 43-52%. Wider windows (--spec 6 --draft-cap 8) lose everywhere (38.1 mean): the verifications past 4 tokens cost more than they return even at 67% acceptance. First answer 2.3 s and zero capped requests on this build — the 0.1.51-56 fixes to the thinking cap apply to both drafters.

Two notes that might save others an hour: the engine gives no error when --draft dflash2 is compiled out (it just runs without a drafter and the host falls back), and the host's pack lookup only sees <data-dir>/dflash2/, not the cwd the engine reads --draft-model from.

<!-- gh-comment-id:6627496582 --> @Flo5k5 commented on GitHub (Nov 4, 2026): Update: the DFlash2 drafter does run on Metal — we had it compiled out. Our first engine build came from a branch without commit 1d36e65a ("metal: DFlash2 drafter on the Metal window"), so the engine silently ignored `--draft dflash2`, the host remembered the failure and stripped the flags, and yesterday's "DFlash2 wins nothing" measurement was actually the suffix drafter alone. After rebuilding (0.1.56-metal) and placing the pack where the host looks for it (`<data-dir>/dflash2/qwen3.8-flash-next-dflash2.q8.pack` + `draft_vocab.bin`; our hand-packed 725 MB file is the accepted legacy Q8), the engine logs "DFlash2 drafter on". Re-run duel, same machine, same engine build, same standard bench (full expert cache, `--spec 4`, `--suffix-draft 8`, `--pool-workers 4`): | drafter | short | 4K | 16K | mean | |---|---|---|---|---| | DFlash2 | 47.1 | 47.6 | 38.2 | **44.3** | | MTP | 46.7 | 44.6 | 36.4 | 42.6 | DFlash2 wins all three cases (+4% mean) with a measured acceptance of 96/143 = 67% against the MTP's 43-52%. Wider windows (`--spec 6 --draft-cap 8`) lose everywhere (38.1 mean): the verifications past 4 tokens cost more than they return even at 67% acceptance. First answer 2.3 s and zero capped requests on this build — the 0.1.51-56 fixes to the thinking cap apply to both drafters. Two notes that might save others an hour: the engine gives no error when `--draft dflash2` is compiled out (it just runs without a drafter and the host falls back), and the host's pack lookup only sees `<data-dir>/dflash2/`, not the cwd the engine reads `--draft-model` from.
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

Follow-up with numbers: the resident plan arbitrates experts against the context on its own, and the cost is measurable.

Setup: same M5 Pro 64 GB, Gyro-M TQ2_0, --expert-cache 24576 --mmap-experts --draft dflash2, only --max-context changes.

32768 65536
experts resident (of 24576 asked) 24576 (all) 21593
prompt buffers in the arena - 1.43 GB
resident footprint / cap 40.8 / 41.2 GB 40.8 / 41.2 GB
VRAM free at ready ~7.5 GB 7539 MiB
bench decode tok/s (short / 4K / 16K) 48.3 / 47.2 / 36.5 33.8 / 34.7 / 35.7
bench sanity 12/12 12/12 (retrieval and tools included)

A real 43,232-token request was read at 605 tok/s and answered (no refusal, KV grows on demand; the full --kv-grow path is CUDA/HIP-only - no vmm on macOS - but the non-elastic path already serves 64K).

So recommend_context()'s 32K under 96 GB is not a memory wall: it is the choice of keeping every expert. The trade measured here: 64K costs ~21% of median decode speed (44.0 -> 34.7 on the standard bench, short windows hit hardest at -28%, 16K nearly flat) while the sanity suite stays 12/12. For our use (agent sessions that outgrow 32K), that trade is worth it; for pure speed, 32K integral remains the right pick. Trying 131072 next - the expected ceiling is the KV at peak (~30-70 KB/token from the parked-snapshot sizes).

<!-- gh-comment-id:6630861761 --> @Flo5k5 commented on GitHub (Nov 4, 2026): Follow-up with numbers: the resident plan arbitrates experts against the context on its own, and the cost is measurable. **Setup**: same M5 Pro 64 GB, Gyro-M TQ2_0, `--expert-cache 24576 --mmap-experts --draft dflash2`, only `--max-context` changes. | | 32768 | 65536 | | --- | ---: | ---: | | experts resident (of 24576 asked) | 24576 (all) | 21593 | | prompt buffers in the arena | - | 1.43 GB | | resident footprint / cap | 40.8 / 41.2 GB | 40.8 / 41.2 GB | | VRAM free at ready | ~7.5 GB | 7539 MiB | | bench decode tok/s (short / 4K / 16K) | 48.3 / 47.2 / 36.5 | 33.8 / 34.7 / 35.7 | | bench sanity | 12/12 | 12/12 (retrieval and tools included) | A real 43,232-token request was read at 605 tok/s and answered (no refusal, KV grows on demand; the full `--kv-grow` path is CUDA/HIP-only - no vmm on macOS - but the non-elastic path already serves 64K). So `recommend_context()`'s 32K under 96 GB is not a memory wall: it is the choice of keeping every expert. The trade measured here: **64K costs ~21% of median decode speed** (44.0 -> 34.7 on the standard bench, short windows hit hardest at -28%, 16K nearly flat) while the sanity suite stays 12/12. For our use (agent sessions that outgrow 32K), that trade is worth it; for pure speed, 32K integral remains the right pick. Trying 131072 next - the expected ceiling is the KV at peak (~30-70 KB/token from the parked-snapshot sizes).
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

The 131072 step, measured: it works end to end, and the marginal cost over 65536 is small.

  • Boot: 20,859 of 24,576 experts resident (85%), arena 27.34 GB, prompt buffers 1.50 GB, 4,984 MiB VRAM free at ready - the 41.2 GB cap still holds.
  • A real 129,224-token request: read in 260 s (497 tok/s) and answered correctly. The KV at peak is what fits, and at 129K it does.
  • Standard bench: 37.7 / 30.9 / 30.4 = 33.0 median decode (sanity 12/12) against 34.7 at 64K and 44.0 at 32K. The arbitration curve is sub-linear: -3,000 experts going 32K->64K, then only -734 going 64K->128K, and short windows actually recover (37.7 vs 33.8 - the 64K short runs were cold-start affected).

So on a 64 GB Mac: 128K is a perfectly usable operating point for agent sessions, at roughly -25% decode vs the all-experts 32K. The next wall should be the KV at peak somewhere past this (a 256K window would ask 8-18 GB of KV on this model, more than the plan leaves beside the arena).

Our production profile moves to 131072. Thanks for a plan that arbitrates on its own - it made this a one-flag experiment.

<!-- gh-comment-id:6631130190 --> @Flo5k5 commented on GitHub (Nov 4, 2026): The 131072 step, measured: it works end to end, and the marginal cost over 65536 is small. - Boot: 20,859 of 24,576 experts resident (85%), arena 27.34 GB, prompt buffers 1.50 GB, 4,984 MiB VRAM free at ready - the 41.2 GB cap still holds. - A real **129,224-token** request: read in 260 s (497 tok/s) and answered correctly. The KV at peak is what fits, and at 129K it does. - Standard bench: 37.7 / 30.9 / 30.4 = **33.0 median decode** (sanity 12/12) against 34.7 at 64K and 44.0 at 32K. The arbitration curve is sub-linear: -3,000 experts going 32K->64K, then only -734 going 64K->128K, and short windows actually recover (37.7 vs 33.8 - the 64K short runs were cold-start affected). So on a 64 GB Mac: 128K is a perfectly usable operating point for agent sessions, at roughly -25% decode vs the all-experts 32K. The next wall should be the KV at peak somewhere past this (a 256K window would ask 8-18 GB of KV on this model, more than the plan leaves beside the arena). Our production profile moves to 131072. Thanks for a plan that arbitrates on its own - it made this a one-flag experiment.
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

The 262144 verdict, for completeness: it works - with a twist worth knowing.

  • The boot leaves 0 MiB of VRAM free and the engine prints its own warning ("requests may stall; add --vram-reserve-mib 1212 ... or lower --max-context") with 19,375 of 24,576 experts (79%) and 2.9 GB more held before the arena (the big window's prefill buffers).
  • Despite that, requests serve: 134,425 tokens read at 511 tok/s, then a 240,025-token request answered correctly in 227 s - the conversation cache reused the parked 131,072-token prefix and read only the remaining 108,953 (482 tok/s). The final K/V (240K tokens in the window) held.

So the practical map on a 64 GB Mac is: 32K all-experts (44 tok/s) - 64K (88%, 34.7) - 128K (85%, 33.0) - 262K declared and serving (79%, LOW warning, stalls possible under mixed load). The recommended operating point stays 131072 (the LOW warning is the engine saying it has no slack left), but the window is not a wall anywhere.

<!-- gh-comment-id:6631644415 --> @Flo5k5 commented on GitHub (Nov 4, 2026): The 262144 verdict, for completeness: it works - with a twist worth knowing. - The boot leaves **0 MiB of VRAM free** and the engine prints its own warning ("requests may stall; add --vram-reserve-mib 1212 ... or lower --max-context") with 19,375 of 24,576 experts (79%) and 2.9 GB more held before the arena (the big window's prefill buffers). - Despite that, requests serve: 134,425 tokens read at 511 tok/s, then a 240,025-token request answered correctly in 227 s - the conversation cache reused the parked 131,072-token prefix and read only the remaining 108,953 (482 tok/s). The final K/V (240K tokens in the window) held. So the practical map on a 64 GB Mac is: 32K all-experts (44 tok/s) - 64K (88%, 34.7) - 128K (85%, 33.0) - 262K declared and serving (79%, LOW warning, stalls possible under mixed load). The recommended operating point stays 131072 (the LOW warning is the engine saying it has no slack left), but the window is not a wall anywhere.
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

One more decode lever found in the tree, and a measurement caveat for everyone benching the standard suite on a laptop-class Apple Silicon.

  • STRATA_METAL_GEMV_NR=2 (window.cpp: "NR rows a lane share each x load - the window's cost is its x traffic; the sums run in the same order for any NR"): on the 64 GB M5 Pro, Gyro-M, 32K with the full expert cache, a cold first bench reads 49.8 / 48.1 tok/s on short / prompt-4K against 47.1 / 47.2 without it - the first setting we found above the TQ2_T verify ceiling. Sanity 12/12 (the engine guarantees identical sums).
  • The caveat: back-to-back standard benches on this machine do not hold those numbers. A second full run right after reads ~32-34 on every case with a tight spread, and a long afternoon of boots and requests depresses everything similarly (our 64K/128K step numbers earlier today are lower bounds for the same reason). The first-run-after-boot state is the comparable one; sustained decode lands a third lower. Worth knowing before reading anyone's single afternoon table.
<!-- gh-comment-id:6632207290 --> @Flo5k5 commented on GitHub (Nov 4, 2026): One more decode lever found in the tree, and a measurement caveat for everyone benching the standard suite on a laptop-class Apple Silicon. - **STRATA_METAL_GEMV_NR=2** (window.cpp: "NR rows a lane share each x load - the window's cost is its x traffic; the sums run in the same order for any NR"): on the 64 GB M5 Pro, Gyro-M, 32K with the full expert cache, a cold first bench reads **49.8 / 48.1 tok/s** on short / prompt-4K against 47.1 / 47.2 without it - the first setting we found above the TQ2_T verify ceiling. Sanity 12/12 (the engine guarantees identical sums). - The caveat: back-to-back standard benches on this machine do not hold those numbers. A second full run right after reads ~32-34 on every case with a tight spread, and a long afternoon of boots and requests depresses everything similarly (our 64K/128K step numbers earlier today are lower bounds for the same reason). The first-run-after-boot state is the comparable one; sustained decode lands a third lower. Worth knowing before reading anyone's single afternoon table.
Author
Owner

@Flo5k5 commented on GitHub (Nov 4, 2026):

The remaining decode idea, as a design (the one lever the tree does not have yet): a second expert-cache tier holding the hottest experts PRE-DEQUANTIZED to fp16.

Measured grounds: the verify window is 100% GPU (47.1 ms/window, everything else at 0), and its cost is the TQ2_T trellis dequant - threadgroup gathers into the 2048-entry codebook (a_tgload ~420 Gops/s on this M5 Pro against ~4900 for the FMA path). The profile already ranks all 24,576 experts by routing frequency, and at 32K with every expert resident the boot leaves ~7.5 GB of VRAM free.

The tier: ~8 GB of fp16 holds ~800 experts (a Gyro-M expert is ~1.25 MB in TQ2_T, ~9.7 MB in fp16). The verify's gate/up/down read the hot expert as a plain fp16 GEMV - no codebook gathers - and fall back to the trellis path for the rest. If the top ~800 of a MoE's routing distribution carries a Pareto-sized share of the activations (the profile would say exactly how much), the dequant-bound verify gains that share almost free; boot pays a one-time GPU dequant of 8 GB.

The questions the design leaves to the code's owner: whether the tier lives beside the arena's slots or in its own allocation, how the ranking follows runtime heat (the profile is static; R4's hit counters already measure the real one), and whether the swap granularity is per-expert or by batch.

For the record, everything else in the decode path on this machine is already optimal-by-default: STRATA_METAL_GEMV_NR=2 (above), CTAB, FUSE, GDN_FUSE, GEMM_TILES and GYRO_TILES are all on unless turned off - the remaining headroom is this tier, or the trellis kernels themselves.

<!-- gh-comment-id:6632293869 --> @Flo5k5 commented on GitHub (Nov 4, 2026): The remaining decode idea, as a design (the one lever the tree does not have yet): a second expert-cache tier holding the hottest experts PRE-DEQUANTIZED to fp16. Measured grounds: the verify window is 100% GPU (47.1 ms/window, everything else at 0), and its cost is the TQ2_T trellis dequant - threadgroup gathers into the 2048-entry codebook (a_tgload ~420 Gops/s on this M5 Pro against ~4900 for the FMA path). The profile already ranks all 24,576 experts by routing frequency, and at 32K with every expert resident the boot leaves ~7.5 GB of VRAM free. The tier: ~8 GB of fp16 holds ~800 experts (a Gyro-M expert is ~1.25 MB in TQ2_T, ~9.7 MB in fp16). The verify's gate/up/down read the hot expert as a plain fp16 GEMV - no codebook gathers - and fall back to the trellis path for the rest. If the top ~800 of a MoE's routing distribution carries a Pareto-sized share of the activations (the profile would say exactly how much), the dequant-bound verify gains that share almost free; boot pays a one-time GPU dequant of 8 GB. The questions the design leaves to the code's owner: whether the tier lives beside the arena's slots or in its own allocation, how the ranking follows runtime heat (the profile is static; R4's hit counters already measure the real one), and whether the swap granularity is per-expert or by batch. For the record, everything else in the decode path on this machine is already optimal-by-default: STRATA_METAL_GEMV_NR=2 (above), CTAB, FUSE, GDN_FUSE, GEMM_TILES and GYRO_TILES are all on unless turned off - the remaining headroom is this tier, or the trellis kernels themselves.
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#3081
No description provided.