mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #907] [CLOSED] calibrate: measure the adaptive expert tier (--adapt-every / --adapt-swaps / --adapt-decay) #2910
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#2910
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/907
Author: @star1872
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:calibrate-expert-tier📝 Commits (10+)
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 it57bd713sycl: pipeline the expert cache's profile fill (model load 3-4x faster)📊 Changes
1 file changed (+8 additions, -4 deletions)
View changed files
📝
tools/calibrate.py(+8 -4)📄 Description
--calibratemeasures the adaptive expert tier too: after the worker count, the engine's default tier against twothat swap more and remember longer, a restart each (as for the workers), kept only when it beats the default by more
than
MIN_GAIN(3%).--adapt-every--adapt-swaps--adapt-decayapply()drops the three flags when the calibration keeps the default, so an older calibration's tier never lingers(the same rule as the other settings).
Why
On a PC whose CPU reads the missed experts slowly, the CPU's share is most of a verify window, and the default tier
swaps about 24 experts per window. Measured in #906 (Xeon E5-2673 v3, DDR3, RTX 4060 Ti 16 GB on PCIe 3.0 x8, Q2_0,
setup's default config, 4 prompts x 2 passes, interleaved):
Hit rate on the code-edit prompt 0.62 -> 0.73, CPU time in those windows 40.1 -> 28.8 ms. A routing trace replayed
offline (in #906) shows the misses follow the swaps per window more than the counting rule. A PC with a fast CPU and
RAM may not gain, which is why this is a measurement and not a new default.
Cost
Three engine starts more: with the model already in the page cache (the first measurement loaded it) each start is
seconds (16 s here), then one warm-up round and two measured rounds of the three calibration prompts with 512-token
answers (the tier needs some windows to follow a text; with the calibration's usual 128 tokens it did not show, see the
comment below). The whole calibration took 655 s on this PC; the setup message says about 10 minutes.
Test
tools/test_calibrate.py:test_adaptive_tier(a 10% faster candidate is kept, a 2% one is not, the candidates runwith the worker count chosen before,
applykeeps and removes the flags);test_fewer_workerscounts the extrastarts. All
tools/test_setup_*.pypass.Measured end to end
tools/calibrate.pyon that PC (Q2_0, setup's default config): engine default 54.3, every 1 / 80 / 0.97 60.1,every 1 / 160 / 0.97 60.6 tok/s: kept (+11.6%); the other settings stayed at their defaults. Any PC other than this
one is not measured.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.