mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4346] [Engine] q36 hybrid mode: the packed Q8_0 decode copies cost more than the expert slots they hold (decode +9-10%, prompt +6%) #1918
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1918
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rynwang on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4346
Area:
[Engine](speed, kernels, models, the server and API)Desktop app, Terminal or source? Source checkout, built from git
Reproduction status: Reproduced locally
Strata version: 0.2.11 (
main9f7d977, engine 0.1.57); first reported on 0.1.52. Built with CUDA 12.4,-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES="61;89"Graphics card, memory and system: RTX 4080 SUPER 16 GB (sm_89), WSL2 Ubuntu 22.04, i7-14700KF, 24 GB of RAM given
to WSL, driver 581.80. Engine and model file on ext4.
Model, size and settings:
Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf(Unsloth, 22.85 GB, sha25655983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1),--gpu 0 --max-context 8192|32768 --tokens <4096 ids> --n 128 --chunk 4096 --mtp 0(decode measured without MTP in this table, and with--mtp 2in the last row).What I measured
This model does not fit a 16 GB card, so the q36 engine runs the hybrid mode and keeps a set of packed Q8_0 decode
copies in VRAM (1.78 GiB,
place_experts, given back only when that makes every expert fit). Those copies speed upthe dense 1-4 column GEMVs of the decode — but in the hybrid mode the decode waits on the CPU expert pool instead, so
the same VRAM is worth more as expert slots: 66 → 92 of 256 per layer at 8192 cells (50 → 76 at 32768).
Three alternating runs per arm, same binary,
STRATA_Q36_KEEP_PACKED=1keeps the copies:With the MTP drafts on (
--mtp 2, 8192 cells), the same arms were 60.8 vs 63.8 tok/s. So giving the copies back isabout +9% decode and +6% prompt at 8K and +10% decode at 32K here, and the text is unaffected (the decode reads
the GGUF layout then, bitwise the same outputs — the existing give-back path already does this when the experts fit).
Re-tested on 0.2.11 (2026-11-06)
Rebuilt
main9f7d977and repeated the decode arm (4-token prompt, 256 generated,--chunk 4096 --mtp 2, twoalternating pairs): copies kept 68.4 / 76.4 tok/s at 65 experts per layer, copies given back 86.5 / 85.1 tok/s at 92
(+17%). 0.2.11 still gives the copies back only when every expert fits, so the report still applies.
Proposal
Extend the existing give-back to the hybrid mode when the slots are the scarce thing (fewer than a third of the
experts fit with the copies). A card that holds most of the experts keeps them, where the dense GEMVs are what the
decode waits on, and
STRATA_Q36_KEEP_PACKED=1keeps today's behaviour either way. The patch is small (it reuses thegive-back block and
E.use_mmq), and I have it running and measured; I can send it as a PR.What I have not tested
there by construction, but I could not run it.
place_experts).--batch(the give-back is placement-wide, so it applies to batched sessions too).Related: #4332 is a different lever on the same hybrid mode (prompt chunk).
@rynwang commented on GitHub (Oct 27, 2026):
Adding a small-card datapoint: on the 11 GB GTX 1080 Ti (sm_61, same model,
--chunk 4096 --mtp 2) the 1.78 GiB of copies take almost every slot there is — 3 of 256 experts per layer with them, 30 without — decode 31.1 → 33.5 tok/s, prompt 6,867 → 7,171 ms (-4%). The PR is #4347 (branchq36-hybrid-drop-packed).@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@rynwang commented on GitHub (Nov 6, 2026):
Re-tested on 0.2.11 (
main9f7d977, engine 0.1.57), built from source here (CUDA 12.4, sm_89 + sm_61), RTX 4080 SUPER 16 GB, WSL2, Qwen3.6-35B-A3B-UD-Q4_K_XL,--gpu 0 --max-context 8192 --chunk 4096 --mtp 2, a 4-token prompt and 256 generated tokens, two alternating pairs, page cache dropped before each run:STRATA_Q36_KEEP_PACKED=1)So it still applies on 0.2.11: the engine there gives the copies back only when every expert fits, and giving them back in this hybrid placement is +17% decode (65 -> 92 slots). The PR (#4347) is rebased onto 0.2.11 as
911fde4and mergeable; the validators' controls on the earlier head (same-chunk logits bitwise equal, released placement equalsmainwith an explicit 89-slot placement) still describe the code, which is unchanged between 0.1.54 and 0.1.57 except for two unrelated hunks (#4708warmup,#4590penalties)./reopen
@rynwang commented on GitHub (Nov 6, 2026):
/reopen
Re-tested on 0.2.11 today (see the body): copies kept 68.4/76.4 tok/s at 65 experts per layer, given back 86.5/85.1 at 92 (+17%). 0.2.11 still gives them back only when every expert fits, so this still applies.
@github-actions[bot] commented on GitHub (Nov 6, 2026):
Reopened, thank you. A maintainer will pick it up from here.