mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2088] strata_bench.py + --expert-profile-save: the bench run overwrites your calibrated live profile with what it learned #829
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#829
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?
Originally created by @mmbeanz on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2088
Setup with
--expert-profile X --expert-profile-save X(the profile-save loop setup offers) on a running-server config.--expert-profile-savewrites the profile when the server quits.strata_bench.py --url http://127.0.0.1:8080attaches to the running server but still shuts it down at the end of the suite. Result: the benchmark silently replaces the live profile with the one learned from three short chats and word-list prompts — the calibration is gone and nothing says so.We hit this on a 5060 Ti + 3060 split (v0.1.43,
7695859a): the first on-box suite run mutated the live profile; the run and its results had to be discarded.Suggested fixes, cheapest first:
docs/COMMUNITY_BENCHMARKS.md("pin the profile: use--expert-profilewithout--savefor benching") — one line.strata_bench.pywarn when the attached server's config carries--expert-profile-save.--urlmode), and let the owner manage the lifecycle.Workaround we used: bench configs point at a plain pinned
data/expert-profile.binwith no save flag, and the engine log lineprofile ...: 24576 ranked pairs, built for 24576 slotsat every boot confirms which profile each run started from.Drafted with AI assistance; I reviewed every line and ran the measurements myself.
@gravitomagnetic commented on GitHub (Oct 12, 2026):
This is a real trap, and we nearly fell into its statistical twin on the same day. A second data point, from an RTX 5090 desktop in the 1M-agent regime (same machine as our interleaved reports, #1592 lineage), in the hope that it helps the docs line and the warning.
The workload-tailored profile is worth having. We replaced our September expert profile (built with
make_profile.pyfrom raw counts) with one rebuilt bymake_profile_mix.pyfrom 56 routing traces: the upstream 45-prompt corpus weighted 1, plus twelve prompts written to match our own traffic shapes (voice chat, code-agent turns, ops questions, planning) weighted 2. The A/B was interleaved (A B A B A B, full swap per leg, the live engine's argv checked for the profile path before each leg, 30 s settle), and every candidate leg beat every baseline leg on decode: instruct decode 256 rose from a median of 122.8 to 129.9 tok/s (+5.8%), greedy decode from 222.9 to 229.7 (+3.1%), with 200K prefill flat and all quality gates clean (needle recall 6/6, zero adjacent repeats 6/6). Engine 0.1.43, CUDA 13.4 kit source build, IQ3_S pack,--expert-cache 6500auto-filling to about 8,320 slots,--batch 2,--kv int8.The contamination lesson, which belongs beside your pin-the-profile warning. Our first candidate profile was built from 57 traces, and one of those traces was the count-to-300 prompt that our decode probe uses on every leg. The candidate cache was therefore partly trained on the test itself, and the first A/B showed a flattering +7 to +19% on decode that was not entirely real. We rebuilt the candidate with that trace excluded and re-ran the campaign; the honest win is the +5.8% above. The general rule we will follow from now on, and would suggest for
docs/COMMUNITY_BENCHMARKS.mdnext to your line about pinning the profile: when a profile is built from routing traces, the evaluation prompts must not appear in the trace corpus. The failure mode is the mirror image of the one you filed. Your trap lets a bench run silently overwrite a good profile; ours lets a home-built profile silently memorize the bench. Both corrupt the measurement without corrupting any file.One further note on trace scope:
collect_profile_traces.pycounts decode-window routing only, with a default of 250 generated tokens per prompt. That suited our experiment, because residency decisions matter most during generation, but it means the profile is calibrated to short generations rather than to long agent turns. A follow-up with longer--max-newtraces is planned on our side; if the upstream corpus ever grows a long-generation mode, that would be the natural place for it.@Niko1221 commented on GitHub (Oct 12, 2026):
Thank you for the trap report and for the contamination lesson. One correction from reading the code: with
--urlthe bench only attaches and never stops the server (it stops only a server it started itself, tracked bystarted), so a--urlrun does not trigger the save at quit; if your profile changed after a--urlrun, please check whether something else ended that server. The path that does hit this is the bench starting the server itself from a config that carries--expert-profile-save: the engine writes the profile when that server quits. Fixed: a server the bench starts now runs from a copy of the config without--expert-profile-save(and its value), the bench prints a note when it does this, and your config file is not touched. Caveat: the copy sits beside the bench's temp log, so the config's shared-settings file next to the original is not read during the run. Test added for both behaviours (stripping the flag, and an attached server never being stopped). Still to do and not in this fix: a line in docs/COMMUNITY_BENCHMARKS.md about pinning the profile and keeping the evaluation prompts out of any trace corpus a profile is built from (your second comment); I will leave this open for that.@mmbeanz commented on GitHub (Oct 13, 2026):
Thanks for the fix and for the correction. You are right: with
--urlthe bench only attaches and never stops the server, so that part of my report was wrong. I stated it without checking thestartedlogic in the bench code. The trap that does exist is the one you describe: a server the bench starts itself from a config carrying--expert-profile-savewrites the profile at quit.I have updated #2085 (finding 8) to say this. I will check what ended my server after the
--urlrun and report back here only if it turns out to be a bench-side problem. The docs line about pinning the profile can stay on this issue as you planned.@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta.
If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment
/reopen. A check runs and reopens it.