mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2078] [CLOSED] prefill: refill the lent expert slots from the GGUF mapping's pieces (STRATA_REFILL_PARTS=1, gfx1151's table: 4K +3.1%, 32K +1.0%) #3845
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#3845
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/2078
Author: @libratechw
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/refill-parts📝 Commits (1)
8304364prefill: refill a prompt's lent expert slots from the GGUF mapping's pieces (STRATA_REFILL_PARTS=1, gfx1151's table)📊 Changes
9 files changed (+105 additions, -11 deletions)
View changed files
📝
docs/STRIX_HALO.md(+1 -0)📝
include/strata/core/expert_cache.hpp(+6 -0)📝
include/strata/core/expert_source.hpp(+8 -0)📝
include/strata/core/remote_experts.hpp(+3 -0)📝
src/core/arch_defaults.cpp(+1 -0)📝
src/core/expert_cache.cpp(+24 -0)📝
src/core/expert_source.cpp(+35 -11)📝
src/program/generate.cpp(+10 -0)📝
tests/core/expert_layout_test.cpp(+17 -0)📄 Description
Title
Issue: none
Summary
After a prompt, the expert-cache slots it borrowed are refilled from the experts' files. With the GGUF read in place an expert
is three tensor slices (gate, up, down, possibly in two shards), so
blob_stablefirst assembled each 4 MB blob in a stagingbuffer (a copy on the calling thread) and the refill then copied that to the slot. Each slice is contiguous in its mapped
tensor, so it can go straight to its offset in the slot. The bytes in the slot are the same.
What changed
ExpertSource::blob_parts(default: none),FileExpertSource::blob_parts(the GGUF in place only; the RAM copy, anoverride, unbuffered reads, a closed mapping and
STRATA_IO_PREFETCH=1keepblob_stable), and the pass-through inRemotePrefillSource(none for an expert the helper holds, the fallback's pieces otherwise).blob_partscounts the readas
blobdoes a read out of the mapping (count_mapped_read, now shared by both).ExpertCache::fill_slot_queued_parts: the pieces on the same queue asfill_slot_queued;sync_queuedwaits as before.generate.cpp: the--serverefill (refill_issue) uses them whenSTRATA_REFILL_PARTS=1. The single-run refill isunchanged.
src/core/arch_defaults.cpp: gfx1151 setsSTRATA_REFILL_PARTS=1(STRATA_REFILL_PARTS=0orSTRATA_GFX1151_DEFAULTS=0turns it off);
docs/STRIX_HALO.md: its row.tests/core/expert_layout_test.cpp: the pieces, each at its offset, equal the assembled blob byte for byte (the fixture'ssecond layer spans two shards).
Ryzen AI Max+ 395 (gfx1151, ROCm 7.14.1, Linux), on
296b59d2, UD-Q4_K_XL,--serve --prefill 16384 --spec 4, the section-5switches of
docs/STRIX_HALO.mdwithSTRATA_PF_SWITCH_MIN_T=2048andSTRATA_PF_FUSED_KQ=1, a chat request of 4K / 32Ktokens (a fresh nonce each, reasoning off, 256 tokens out), fresh servers alternating, 7 pairs (32K: of 8, dropping one
with page migration or reclaim during a prompt). Every one of the 7 pairs is faster:
296b59d2, prompt tok/s (median)The records (each request's engine timing, the requests, the servers' arguments and variables) and the scripts are in
libratechw/Strata@9b1a9fd5,
2078/;its README says how the runs were made.
Builds and tests on this branch:
expert_layout_testamong them), 5 skip, and the same three fail as on296b59d2(
ple_parity,expert_parity,pool_test).strata_kernels,strata_prefillandstrata_mmqcompile for gfx1012, gfx1030, gfx1100, gfx1103, gfx1150, gfx1151,gfx1200 and gfx1201.
expert_layout_testamong them), 2 skip, andple_parityfails as on
296b59d2.expert_source.hpp/.cpp,expert_cache.cppandgenerate.cpp,not changed; it shares
expert_cache.hppandarch_defaults.cpp.Not run: UD-IQ4_XS, the single-run refill, gfx1151 under Windows, and
STRATA_IO_PREFETCH=1.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.