mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #372] [CLOSED] Prompt path: an MMQ group's experts gathered in one launch, after one wait, released by one event (-9% on a 32K prompt, same output) #2602
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#2602
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/372
Author: @sergqwer
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:pr/group-gather📝 Commits (1)
936fc67Prompt path: an MMQ group's experts gathered in one launch, after one wait, released by one event📊 Changes
3 files changed (+118 additions, -12 deletions)
View changed files
📝
include/strata/prefill/moe_mmq.hpp(+10 -0)📝
src/prefill/moe_mmq.cu(+35 -0)📝
src/prefill/prefill.cpp(+73 -12)📄 Description
Every prompt chunk on a native pack runs the streamed walk: for each expert the compute stream waits for its copy, gathers it into the MMQ group buffer and records an event that gives its ring slot back. The gather takes ~3 us. Under WDDM, each wait and record also leaves ~10 us of GPU idle, even when the copy landed long before.
An nsys trace of a 32K prompt shows:
What changes:
gather_native_group/copy16_group_kernelcopy a group's 16 experts in one launch, the same bytes to the same slots.used[used_of[slot]], whereused_ofmaps each slot to the event that released it. A later record of that event only waits longer.STRATA_PREFILL_GROUP_GATHER=0gathers, waits and releases one expert at a time.Same output
First-token logits are bit-identical with the switch on and off at 2K, 8K, 16K and 32K, and with a 96-slot ring (
STRATA_PREFILL_RING=96) at 8K:STRATA_DUMP_FIRST_LOGITSin a test build.--expert-cache 14900. Withautothe slot count moves by ~100 from run to run with the desktop's free VRAM, and that alone changes a first token now and then, on main too.Speed
Setup: IQ2_XS (ISTA), RTX 5090, 9950X3D, 128 GB, Windows 11,
--max-context 262144 --kv int8 --prefill auto --vram-reserve-mib 1500, cache auto. The runs alternated between the switch off and on.On an NVFP4 pack (our fork, larger experts): 32K -5.2%, 16K -7.9%, 8K -11.1%.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.