mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #407] [CLOSED] Adaptive tier: --adapt-decay, and --adapt-tuned (opt-in): 31% fewer misses, -19% CPU pool, -22% PCIe on UD-Q4_K_XL #2626
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#2626
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/407
Author: @sergqwer
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:pr/adapt-tuned📝 Commits (2)
a7fc7bcAdaptive tier: --adapt-decay, and --adapt-tuned (opt-in) for caches that hold 20-60% of the expertsbf76ef6Adaptive tier: --adapt-decay outside (0, 1) is refused📊 Changes
1 file changed (+44 additions, -6 deletions)
View changed files
📝
src/program/generate.cpp(+44 -6)📄 Description
The adaptive tier swaps the most-routed missing experts into VRAM in place of the least-routed resident ones. It works from routing counts that are multiplied by 0.7 after each pass, every 4 rounds, up to 96 swaps.
This PR adds:
--adapt-decay F: sets that factor (default 0.7, unchanged).--adapt-tuned(STRATA_ADAPT_TUNED=1), off by default:--adapt-*flags win.--adapt-tuned: the cache holds 30% of the experts -> adaptive tier every 2 rounds, 192 swaps, x0.92.It is opt-in because more experts on the GPU change which kernels compute them, so it changes tokens and would not pass a byte-identical gate.
How it was chosen
We recorded two decode routing traces (
--dump-routing) and replayed them through the tier's policy. The replay matched the engine's misses within 3%.Measured on Unsloth UD-Q4_K_XL
Setup:
--resident-budget-gib 90(every expert outside VRAM in RAM),--max-context 32768 --kv int8 --vram-reserve-mib 1500;--adapt-every 2 --adapt-swaps 192 --adapt-decay 0.92, the same as--adapt-tunedhere.With 16 busy CPU worker processes beside the engine (a desktop doing other work), 4 pairs:
What the numbers say:
Ideas we did not get to:
🤖 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.