mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #934] [CLOSED] Per-layer expert cache: each layer's slots are that layer's blob #2923
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#2923
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/934
Author: @Chromadera
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:per-layer-blob-slots📝 Commits (10+)
fa16567setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it📊 Changes
4 files changed (+106 additions, -13 deletions)
View changed files
📝
docs/ORCA_Q4_K_S.md(+1 -1)➕
docs/per-layer-expert-slots.png(+0 -0)📝
src/program/generate.cpp(+50 -6)📝
sycl/src/program/generate.cpp(+55 -6)📄 Description
Credit
Measured and prepared by Chromadera.
The arrangement comes from the report that this model wrote on its own expert pack: Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, the weights served as
qwen3.8-flash-next-gsq-iq3-xxs(Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.ggufand shard 2, packstrata-gsq-iq3-xxs).Schematic
--expert-cache Nwith--expert-cache-per-layeris still a budget of N slots of the largest blob. On a native pack the engine now spends that budget on each layer's real blob. Every layer gets the same number of slots, because a per-layer range islayer * quota + n.On Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, 48 layers,
--expert-cache 7008:Startup prints:
per-layer slots use each layer's blob: 7008 uniform slots (15.20 GiB) -> 9312 slots, 194 per layer (15.14 GiB)Why this does not hit the #369 problem
#369 kept per-layer mode on the largest blob because the sized-slot list was built in profile order. A size chosen for one layer could land in another layer's slot. This list is built in layer order. Slot
layer * quota + nis that layer's blob, and every expert in a layer is one size.open_sizedalready starts each layer at the bottom of its range, and the profile fill already skips a layer once that layer is full.If one copy of every layer does not fit, the cache stays the old uniform slots. When the cache shrinks, it rebuilds the same equal counts. Cutting the list in the middle would put one layer's blob into the next layer's range.
A layer split is untouched. It already walks that stage's profile. The shared cache, without
--expert-cache-per-layer, is unchanged.Measured
RX 7900 XTX, same binary, same profile, only the slot layout changed. BetterBench cold prefill, thinking on, 5 passes:
No depth got slower. Past the 28,928-token chunk a long prompt is dominated by streaming, so the extra cached experts barely show up there, and they did not cost anything. The weights are the same bytes. A GPU-resident expert rounds differently from the CPU copy; the engine already records that as equal perplexity. More slots means more tokens take the GPU path.
There is no known performance drawback from this. Decode on the shipped profile at 194 slots was 48.9 tok/s weighted (5 passes). The earlier uniform 146-slot serve was 43.8 (20 passes) on an older binary, so that pair is not a clean comparison.
Check
Start with
--expert-cache-per-layeron a native pack. The log line should show more slots than N, and the profile fill should fill them. Slot 0 is still checked against the file.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.