mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4332] [Engine] q36 hybrid mode: a 4096-token prompt chunk reads prompts 51-76% faster on a 16 GB card #1912
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#1912
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/4332
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 the CUDA 12.4 toolkit and-DSTRATA_ENABLE_CUDA=ON -DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES="61;89"Graphics card, memory and system: RTX 4080 SUPER 16 GB (sm_89) and GTX 1080 Ti 11 GB (sm_61, not part of this
model's run), WSL2 Ubuntu 22.04 on an i7-14700KF (14C/28T), 24 GB of RAM given to WSL, driver 581.80. The engine and
the model file are on ext4 (not the 9p drive).
Model, size and settings:
Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf(Unsloth, 22.85 GB, sha25655983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1), run as./strata --model ... --gpu 0 --max-context <8192|32768|65536> --tokens <4096 token ids> --n 128 --mtp 2 --chunk <2048|4096>.What I measured
On a 16 GB card this model runs in the hybrid mode (79 of 256 experts per layer in VRAM at 8K context). The prompt
chunk there is picked by a fixed rule — 2048 above 7.5 GiB free, 1024 above 5.5, else 512 — with no 4096 arm. A prompt
chunk streams every layer's experts over PCIe once, so the cost is paid per chunk, not per token: a 4096-token prompt
(three alternating runs per arm, same binary, medians):
The decode does not pay for the bigger chunk here, and at 32K it gained (the MTP drafts were accepted more often in
the 4096 arm: 64% against 57%). Prompt time to first token is where the difference shows: 4.9 s against 3.2 s at 8K.
The same model also boots on the 11 GB GTX 1080 Ti (sm_61, 16 experts per layer), so the family's Pascal path runs;
that card is not part of the numbers above.
Re-tested on 0.2.11 (2026-11-06)
Rebuilt
main9f7d977and repeated the 8,192-cell arm (4,096-token prompt, 128 generated,--mtp 2, two alternatingpairs):
--chunk 20485,016.5 / 5,084.1 ms against the 4,096 chunk's 2,923.8 / 3,025.7 ms (1.70x prompt), decode59.8 / 60.9 against 59.5 / 59.7 tok/s. The hybrid rule in 0.2.11 still has no 4,096 arm, so the report still applies.
Proposal
Take 4096 in the hybrid branch when the chunk's buffers (0.5 MiB per token, measured 0.47) fit in a third of the room
the expert slots keep at a 512-token chunk:
and keep today's rule otherwise. On this card that is 4096 at 8K and 32K, and 2048 at 64K, where the K / V cache
comes out of the same room first (measured: 4.89 GiB free after init, 41 experts per layer, prompt 764 tok/s — the
same arm as 2048 today). A 12 GB card keeps 2048, where docs/QWEN36.md measured a 13% decode loss for chunk 4096 on
an RTX 3060.
This changes a default, so I am asking here before opening the pull request (CONTRIBUTING.md). I have the change and
the A/B ready, and I can test any other context sizes or cards you want numbers from.
What I have not tested
the docs; only the 16 GB case is measured here.
@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,-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES="61;89"), RTX 4080 SUPER 16 GB, WSL2 Ubuntu 22.04, driver 581.80, Qwen3.6-35B-A3B-UD-Q4_K_XL (22.85 GB, sha25655983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1),--gpu 0 --max-context 8192 --tokens <4096 ids> --n 128 --mtp 2, two alternating pairs on the same binary, page cache dropped before each run:--chunk 2048(0.2.11 behaviour)So the report still applies on 0.2.11: the hybrid rule there is unchanged (no 4,096 arm), and the 4,096 chunk reads a 4,096-token prompt 1.70x faster with the decode unchanged. The PR (#4335) is rebased onto 0.2.11 as
61caa0dand mergeable./reopen
@rynwang commented on GitHub (Nov 6, 2026):
/reopen
Re-tested on 0.2.11 today (see the body): 8,192 cells, 4,096-token prompt -> 5,016/5,084 ms at
--chunk 2048against 2,923/3,025 ms with 4,096, decode unchanged. The hybrid rule in 0.2.11 still has no 4,096 arm, so this still applies.@github-actions[bot] commented on GitHub (Nov 6, 2026):
Reopened, thank you. A maintainer will pick it up from here.