mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5468] [Engine] q36: layer-major prompt prefill stages a layer's experts once per N chunks #5440
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#5440
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5468
Author: @bahooo22
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:pr-super-chunk📝 Commits (4)
652e4dfsuper-chunk: слой-мажорный обход промпта, эксперты слоя стейджатся один разb019e83super-chunk: фиксы ревизии — stream_base только при активном потоке, cap N и логd721ed3q36: super-chunk — residual x переносится в xsuper вместе с h (критический фикс)f4324e0docs: add the super-chunk prefill notes to the PR📊 Changes
3 files changed (+342 additions, -3 deletions)
View changed files
➕
docs/research/super-chunk.md(+117 -0)➕
docs/research/super-chunk.ru.md(+112 -0)📝
src/qwen35/q36_engine.cu(+113 -3)📄 Description
Problem and result
On a hybrid placement the prompt is read chunk by chunk; every chunk walks all layers and reloads each layer's experts over PCIe. On a 96k prompt, N=1 spent 8.7 s in expert H2D copies and 14.6 s in MMQ out of 103.2 s. After the change the prefill is layer-major: a layer runs over N sub-chunks (2048 tokens each) while its experts are staged once. At 96k, KAT IQ4_XS, q4_0 KV, super N=4 against N=1: 1024.0 tok/s against 800.9 (+27.9 %), TTFT -23.5 s, slots 19 -> 17; MoE 49.5 -> 23.3 s. 64k +25 %, 128k +21 %, HauhauCS IQ4_XS +22 %. STRATA_Q36_SUPER_CHUNK=4 enables it; N=1 is the old path and is bit-identical.
Related discussion
Design, measurements and limits: docs/research/super-chunk.md (EN/RU), included in this PR. The review findings (stream_base only with an active stream, cap N <= 8, MTP accounting, the residual-x fix) are part of this PR. Related: #3976 is the layer-major walk of the src/prefill engine; the q36 native path this PR changes does not run Prefill and has no layer-major mode. Scope agreement requested (feature).
Approach
Validation
Passed (revision
f4324e03, Windows 11, CUDA 13.3, sm_86, RTX 3060 Ti 8 GiB):Failed: none observed.
Not run: HIP, SYCL, Metal; models other than KAT and HauhauCS IQ4_XS; a formal unit test (the bit-exact check is a manual state dump). Draft until backends are covered.
Limits
N is capped at 8; larger N needs more VRAM for xsuper/hsuper and is not measured. A cancelled request stops at a sub-chunk boundary rather than immediately.
Scope note: this is an internal prefill optimization behind
STRATA_Q36_SUPER_CHUNK(off by default). Default behaviour is unchanged; the layer-major staging path is opt-in.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.