mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1042] [CLOSED] prefill: bytes_needed sizes the MoE buffers for the layout init picks (with or without an expert source) #2988
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#2988
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/1042
Author: @sergqwer
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:pr/prefill-bytes-needed📝 Commits (10+)
f4e96d5tests: gdn_rec_head also compares the PP (variant 4) and two-column (variant 5) recurrence kernels, bitwise16bc95aprefill: STRATA_HCD_EXACT=1 - the HC down projection by a WMMA kernel with hipBLASLt solution 1176/1177 k order (StaggerU included), bitwise502fcef#606: the fused SwiGLU q8_1 quantizers keep the block's scale and sum finite too64d0136cache: preserve checkpoints when split allocation failsa0d0056prefill: fused-expert exact wins (table16 via direct selector, float4 moe_combine, LDS alias + occupancy)5f5452bserve: park_current's try covers the checkpoint split too (#752): a host OOM skips parking8b19a38Layer split: --vram-reserve-later-mib, a separate reserve for the later cardsea83d0dResident RAM mode with a layer splitd2d981fsetup: the low-RAM mode's resident variant on several GPUs (#642)cd62e5eserve: a split's stage-0 GPU profile line keeps its text (#848); later stages say which stage📊 Changes
3 files changed (+27 additions, -21 deletions)
View changed files
📝
include/strata/prefill/prefill.hpp(+9 -5)📝
src/prefill/prefill.cpp(+11 -9)📝
src/program/generate.cpp(+7 -7)📄 Description
Replaces #547. GitHub closed it on 2026-10-05, when my fork was made private by mistake: that took the fork out of the network for good, so it can no longer open pull requests. This is the same branch and commit (
b3a15cf), opened from a new fork; the discussion and the measurements are in #547.Prefill::bytes_needed()sizes the region the prompt path borrows from the expert cache, and it must count exactly whatcarve()allocates. It does not, in two places (src/prefill/prefill.cpp).xnandgrs.bytes_neededcounts a T x D float buffer forxn.carveallocates it only underSTRATA_GR_UNFUSED=1; by default the fused read readsR.bytes_neededalso leaves outgrs(T x HC floats), whichcarvealways takes. Net, 40,944 bytes a token too many:--prefill auto:32768).Those expert-cache slots are lent to every prompt, never used, and refilled after it. A 12-16 GB card feels it most: either more experts are streamed during the prompt, or the auto chunk steps down earlier than it needs to.
The MoE layout.
bytes_neededsizes the MoE scratch withfused_layout(T, true), butcarveusesfused_layout(T, m.src != nullptr). For a pack that can take the fused layout, a caller with noExpertSourcegets a region sized for the smaller fused buffers, andinitthen asks for MMQ-sized ones.bytes_needednow takes asrcflag (defaulttrue), andgenerate.cpppassessrcp != nullptrat its four call sites.Measured on an RTX 5090, IQ2_XS (ISTA),
--expert-cache 14900, v0.1.37 against this PR:The same experts are computed with the same kernels; only the number of slots lent for the prompt changes.
🤖 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.