mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4652] [TUI] tune: probe the flags an engine accepts but does not document #5131
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#5131
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/4652
Author: @bbingoCN
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:f-tune-probe-flags📝 Commits (1)
9c6184dtune: probe the flags an engine accepts but does not document📊 Changes
5 files changed (+109 additions, -8 deletions)
View changed files
📝
strata_cli/launch/params.py(+2 -2)📝
strata_cli/tune_commands.py(+3 -2)📝
strata_control/tune_knobs.py(+13 -0)📝
strata_control/tuning.py(+49 -4)📝
tests/tuning/test_tuning.py(+42 -0)📄 Description
Problem and result
strata tune autoandstrata launch --tuneskipped theadapt_tier_fastandadapt_decay_09arms on every PC, with the reason "this engine does not accept --adapt-every, --adapt-swaps,
--adapt-decay".
The engine accepts all three. Engine 0.1.52 parses
--adapt-decay(
src/program/generate.cpp:3167) and the string is in the binary; it is simply absent from thetext
--helpprints. The tuner builds the set of usable flags by regex over--help(
strata_control/tuning.py,engine_flag_inventory), andplan_armsdrops an arm when any flagit names is outside that set — so one missing help line silently disabled two arms.
Result: a flag the engine's own parser accepts now counts as accepted, documented or not. On this
PC (engine 0.1.52, IQ3_S, 128K, RTX 3080 20 GB) the thorough sweep chose
['kv_resident_64k', 'spec3', 'pin_by_need', 'host_core_last', 'kv_grow']before the change andadds
adapt_tier_fastandadapt_decay_09after it.Approach
engine_flag_inventory(engine, wanted=None): after parsing the help text, any flag inwantedthat the help did not list is asked of the binary and kept when the parser takes it.
wantedis optional, so existing callers and the "no usable help" behaviour (
None) are unchanged.engine_accepts_flag(engine, flag): runs the flag bare. A flag the parser knows either asksfor its value (
--adapt-decay needs a value) or runs on; an unknown one is named back(
unknown argument: --adapt-decay). A dummy value must not be passed: a bare flag turns thatvalue into an unknown positional argument, whose message is the same "unknown argument" line.
tuning.dimension_flags() | tune_knobs.arm_flags()— 21 flags here, of which 6 are not in thehelp.
tune_knobs.arm_flags()is new and gathersArm.requires_flags()acrossARMS.wanted(strata_cli/tune_commands.pytwice,strata_cli/launch/params.py, andplan_tuningintuning.py, which importstune_knobslate to keep the module dependency one-way).
The alternative — adding the missing line to the engine's
--help— is worth doing too and isindependent; this change also protects against the next undocumented flag, which a help-text
fix would not.
Validation
Passed (Linux x86_64, Python 3.12, CUDA engine 0.1.52, RTX 3080 20 GB):
python -m unittest discover -s tests/tuning— 277 tests, OK (274 before; 3 added).python -m unittest discover -s tests/terminal -p 'test_*tun*.py'— 40 tests, OK.tests.terminal.test_launchandtests.terminal.test_issues_022— 147 tests, OK (15 skipped).Contextfor this machine andmode='thorough':['kv_resident_64k', 'spec3', 'pin_by_need', 'host_core_last', 'kv_grow'],adapt_tier_fastandadapt_decay_09skipped for "does not accept".adapt_tier_fastandadapt_decay_09.engine_accepts_flagon the real binary:--adapt-decayTrue,--adapt-everyTrue,--adapt-swapsTrue,--hybrid-rowsFalse (a Qwen3.6-only flag this Qwen3.8 engine reallylacks),
--no-such-flagFalse.flag_list()inlaunch/params.pyreturns 145 flags including--adapt-decay.fixtures: an undocumented-but-supported flag is kept, a refused flag stays out, the probe passes
the flag alone, and a silent engine still returns
None.Failed: none observed.
Not run:
engine_command/engine_envhelpers as theexisting
--helpread, and the tests run stand-ins throughsys.executable, which is what theWindows path needs; neither OS was exercised here.
Python control layer and treats every backend identically, but only a CUDA engine was run.
--tune thoroughwith the fix. The arm list above comes fromplan_armson the realflag inventory and this machine's
Context, not from a completed sweep. Measuring the two armstakes ~45 minutes of restarts on this PC and is left to the run that will use the fix.
Limits
tuning run, not per candidate.
direction, as before.
--adapt-async's arm remains skipped on this machine for a separate reason (it is markednon-repeatable and
strata launchpasses only--allow-small-differences); that is not changedhere.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.