mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #547] [CLOSED] prefill: bytes_needed sizes the MoE buffers for the layout init picks (with or without an expert source) #2686
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#2686
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/547
Author: @sergqwer
Created: 10/2/2026
Status: ❌ Closed
Base:
main← Head:pr/prefill-bytes-needed📝 Commits (1)
b3a15cfprefill: bytes_needed sizes the MoE buffers for the layout init picks (with or without an expert source)📊 Changes
3 files changed (+18 additions, -14 deletions)
View changed files
📝
include/strata/prefill/prefill.hpp(+6 -3)📝
src/prefill/prefill.cpp(+6 -5)📝
src/program/generate.cpp(+6 -6)📄 Description
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.