mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3522] [Other] calibrate: keep the PCIe/draft-floor winner only when it beats this run's own noise instead of the fixed >3% #4666
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#4666
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/3522
Author: @dsenchankau
Created: 10/20/2026
Status: 🔄 Open
Base:
main← Head:calibration-noise📝 Commits (4)
3111eccgit commit -m 'calibrate: decide the PCIe/floor confirmation against the run's own measured noised5a1b37Merge branch 'main' into calibration-noise1da8954Merge branch 'main' into calibration-noisec72b7abMerge branch 'main' into calibration-noise📊 Changes
3 files changed (+171 additions, -27 deletions)
View changed files
📝
docs/DETAILS.md(+4 -1)📝
tools/calibrate.py(+84 -20)📝
tools/test_calibrate.py(+83 -6)📄 Description
Problem and result
--calibratedecides the PCIe share and the draft floor against a fixed margin: the winner of the sweeps iskept only when the interleaved confirmation measures it "more than 3% faster". The machine's own run-to-run
variation is often as large as that margin. Measured on one PC, three consecutive tuning runs of the same
model measured their own variation at 1.7%, 3.0% and 5.2%. A fixed 3% line therefore drops real gains of
1-3% and keeps noise of up to 3%. The 2026-10-19 run that started this: the sweep winner (worth about +2%
on the confirmation rounds) was thrown away, and a draft floor the sweep never chose was written into the
config as
--spec-min-p 0.5because the settings builder always emitted the pair.After the change the confirmation buys seven fresh default-vs-candidate pairs and keeps the pair only when
the mean gain is unlikely to be that run's own variation (a
tof 2.5 or more, the scatter floor taken fromthe run's own sweep repeats). The decision line is printed with the numbers: mean gain, measured noise,
t,verdict. A sweep tie goes to the default, only a coordinate that actually won lands in the config, and
apply()never adds a flag the calibration did not choose. On the same PC the new rule kept a real +18.9%pair (noise 1.7%, t 17.5; end to end 70.3 -> 80.6 tok/s on
iq3_s) and refused a +1.9% pair that freshsamples could not separate from noise (noise 3.0%, t 1.14; defaults stayed, config gained no flags).
Related discussion: none. This is a focused fix inside the opt-in
--calibrateflow: a PC without a tuningrun gets exactly the same settings as before, and no product default changes. What values tuning picks is
unchanged in kind: the same sweeps and the same two settings. Only the line that decides "is this gain real"
now uses the run's own measured variation instead of a fixed 3% that sits inside that variation.
Approach
The sweeps already rotate every value inside one engine start and take medians, so their repeats measure the
run's variation for free; the pooled coefficient of variation over all sweep samples becomes the noise
estimate. The confirmation pairs sit back to back, so the block-to-block drift that #1332 measured (8-28%
between engine starts) cancels inside a pair; the fixed margin could not see either effect. The pair
(pcie-frac, spec-min-p)is judged as one unit because that is the unit that goes into the config and thetwo settings interact through where experts are placed. The scatter floor keeps the confirmation's own
residual drift charged to it, which makes the rule slightly conservative on a wobbly PC; that is deliberate,
and
T_KEEPis the dial. All seven pairs are always paid: an early stop on a lucky or unlucky three-pairmean was measured to strand true winners. The printed
tis truncated toward zero so a value of exactly"2.50" can never sit next to "kept the default". Steps that must restart the engine (the worker count, the
adaptive expert tier) keep the old fixed margin, because pairing is impossible across restarts.
--prefill-pipekeeps its own win-every-round rule.Validation
9de04cd4):python tools/test_calibrate.py: 36 tests, OK. Covers: a gain that beats a noisy run, a gain that onlyscatters pair to pair, the measured noise floor dropping a steady tiny gain (t 1.08), all-seven-pairs
behavior, dead-pair skipping, the tie-to-default sweeps, and the exact config dict emitted.
python -m unittest tests.terminal.test_calibration: 30 tests, OK (the settings/apply layer on theTerminal side).
qwen3.8-flash-next-iq3_s: sweep winner 0.2/0.7, confirmation mean +18.9% against a measured 1.7% noise(t 17.52), kept; final line
--pcie-frac 0.20, --spec-min-p 0.70, --adapt-every 1, --adapt-swaps 80, --adapt-decay 0.97 (80.6 tok/s)against a 70.3 tok/s default tier.qwen3.8-flash-next-unsloth-ud-q4_k_xl: candidate +1.9% against 3.0% measured noise (t 1.14), defaultkept; config gained no tuning flags, 45.0 tok/s.
tests.terminal.test_discovery.GuiLayout(test_a_remembered_older_install_and_the_app_install_are_both_listed,test_an_own_setting_beats_the_apps_folder: Windows folder expectations on Linux) fail identically onupstream/main; this PR does not touch them.(
strata_control/calibration.py): it reuses thistools/calibrate.pyand was not exercised; any secondPC. No C++/CUDA/HIP/SYCL code is touched.
Limits
Validation is one PC and two models; the numbers describe that machine, not all machines. The seven pairs
extend the confirmation stage to a fixed cost (the old stage also measured pairs; the difference is bounded
and now predictable). The worker-count and expert-tier steps still use the old fixed 3% margin because each
of their samples needs an engine restart. The noise estimate re-charges part of the run's block-to-block drift on purpose, which keeps the
rule conservative.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.