[GH-ISSUE #5502] [Benchmark] thorough tuning sweeps 16 arms of ~60 documented knobs — measured wins exist outside its surface #5473

Open
opened 2026-11-07 23:43:55 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @gdevenyi on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5502

Problem

strata launch --tune thorough plans its candidates from a fixed list: 16 startup arms + 3 per-request knobs, filtered by machine class, BOUNDS and NEVER (strata_control/tune_knobs.py, control 0.1.57 — static analysis, trivially checkable). The engine and docs/DETAILS.md document roughly 60 runtime knobs with measured effects. Several documented, previously-measured knobs are structurally unreachable by the tuner:

  • STRATA_ROUTE_TAIL_SKIP is never swept. Setup writes =0 whenever the experts fit in RAM, and no arm ever tries 7 against it — yet 0.1.42's own history measured +10–24% decode with it on, KL-checked.
  • The per-arch opt-in kernel switches (STRATA_HC_UPMIX, STRATA_DEQUANT_WIDE, STRATA_ATTN_DAILY, STRATA_QSA_ROWS, STRATA_QSA_SPLIT_ATTN, STRATA_SPEC_PROB, …) are never benchmarked per machine, even though the project's history shows per-arch sets paying 2–18% (#3659, #5459 pattern).
  • --ple-io (ram/mmap/direct) is chosen by a static RAM rule, never measured per machine. It is the single largest RAM lever in the engine (~28.8 GB table) and can be speed-neutral.
  • KV formats q4_0/k8v4 are classed "quality", so a speed-goal tune never reports their trade to a user who would accept it.
  • Conversely, --pool-cores with a fixed CPU list is not in NEVER, and it cost 26–29% decode on both of my machines — nothing warns a user who sets it by hand.

Net effect: a user who runs thorough tuning on a RAM-rich machine gets "your defaults are already the fastest" while double-digit wins sit outside the tuner's surface. That is the exact result I got on two machines.

Environment

  • Machine A: RTX 5080 16 GB, Ryzen 9 9950X (16C/32T), 123 GiB RAM, Linux (xanmod 7.2.9), engine 0.1.57 cuda13, control 0.1.57. Model: Qwen3.8-Flash-Next Unsloth UD-IQ3_XXS, 512K context, DFlash2 (spec 6, conf 0.8), all other settings default.
  • Machine B: GTX 1080 Ti 11 GB (sm_61), engineering-sample Intel 20C/40T @ 2.2 GHz, 125 GiB RAM, CachyOS, engine 0.1.57 cuda12, same model/config.

Evidence (my own runs; paired candidate/baseline boots interleaved on the same day, 3 pairs per confirmed number, geometric mean of decode/code-gen/4K/30K-prefill tok/s; ~150 boots per machine; per-run JSONL retained; the harness drives the same serve.server + engine stack the tuner uses)

Knob (not in the tuner's surface) Machine A Machine B
Tail-skip 7 vs 0 (alone) +9.4% (1.077/1.094/1.113) +6.5%; prefill −9%, recovered by HC_UPMIX
3-knob combo (tail-skip 7 + STRATA_HC_UPMIX=1 + --ple-io direct) +9.4%, prefill flat, RAM peak 77→59 GiB +9.4% (1.094/1.102/1.086), prefill flat, RAM 76→57 GiB
--ple-io direct vs ram (alone) 0.995 (flat), −18 GiB prefill −8%; tuned variant (row cache 2M + inflight 512) recovers it, −26 GiB
STRATA_DEQUANT_WIDE=1 +5% prefill in screen, not confirmed in pairs 0.993
--pool-cores fixed list −29% decode −26% decode
--pool-tasks 6 −5% −11%
--kv q4_0 decode +7% / prompts −7% (trade) +2–6% prefill (screen), not confirmed in pairs

For contrast, thorough tuning on machine A the same day returned default_confirmed with 6.3% run-to-run spread — every win in the table above was outside what it examined. Full per-metric tables and both confirm runs are in the JSONL logs; happy to attach sanitized copies.

Proposed behavior (opt-in; the default path stays byte-identical)

  1. Arch-gated env-switch arm families in thorough mode: tail-skip 7-vs-0 as a placement arm with the KL note, plus the documented per-arch opt-in switch sets as plain restart arms (~50 s each; skip via the existing condition facts where an arch lacks them).
  2. PLE I/O arms gated on RAM facts: ram vs mmap vs direct (+ the row-cache/inflight variant), since the current choice is a static RAM check, not a measurement.
  3. NEVER rows for --pool-cores fixed lists and small --pool-tasks on many-core CPUs, with the measured reason.
  4. An explicit consent flag (e.g. --tune-allow-quality) that sweeps quality-classed knobs (kv q4_0/k8v4) and reports the documented perplexity trade alongside the speed result, instead of hiding them from a speed-goal tune.

Tradeoffs

Thorough runtime roughly doubles with the families above (more restarts); the existing paired-machinery in autotune.py already handles the noise problem, which is real (6–8% household spread on both machines). Quality arms must never fire without the explicit flag. Arch-gating needs the same facts mechanism condition_holds already uses.

Limits / not tested

  • Perplexity/KL for q4_0 and tail-skip: the numbers I cite for quality are the project docs' and 0.1.42 history's, not mine; I measured speed and answer-changing status only.
  • My prompt set is my harness's (chat decode, code generation, 4K and 30K prefill), not the tuner's request set.
  • n=3 pairs per confirmed number; sm_120 and sm_61 only; the draft knobs (DFlash2 conf/cap) were measured only on machine A.

Reproduction status: reproduced on both machines listed above.

Related: #5136 (tail-skip switch visibility), #5232 (strata tune UX), #3659 / #5459 (per-arch switch-set scope agreements — the same pattern this proposal would extend into the tuner).

Originally created by @gdevenyi on GitHub (Nov 7, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5502 **Problem** `strata launch --tune thorough` plans its candidates from a fixed list: **16 startup arms + 3 per-request knobs**, filtered by machine class, `BOUNDS` and `NEVER` (`strata_control/tune_knobs.py`, control 0.1.57 — static analysis, trivially checkable). The engine and `docs/DETAILS.md` document roughly 60 runtime knobs with measured effects. Several documented, previously-measured knobs are structurally unreachable by the tuner: - **`STRATA_ROUTE_TAIL_SKIP`** is never swept. Setup writes `=0` whenever the experts fit in RAM, and no arm ever tries 7 against it — yet 0.1.42's own history measured +10–24% decode with it on, KL-checked. - **The per-arch opt-in kernel switches** (`STRATA_HC_UPMIX`, `STRATA_DEQUANT_WIDE`, `STRATA_ATTN_DAILY`, `STRATA_QSA_ROWS`, `STRATA_QSA_SPLIT_ATTN`, `STRATA_SPEC_PROB`, …) are never benchmarked per machine, even though the project's history shows per-arch sets paying 2–18% (#3659, #5459 pattern). - **`--ple-io`** (`ram`/`mmap`/`direct`) is chosen by a static RAM rule, never measured per machine. It is the single largest RAM lever in the engine (~28.8 GB table) and can be speed-neutral. - **KV formats** `q4_0`/`k8v4` are classed "quality", so a speed-goal tune never reports their trade to a user who would accept it. - Conversely, **`--pool-cores` with a fixed CPU list** is not in `NEVER`, and it cost 26–29% decode on both of my machines — nothing warns a user who sets it by hand. Net effect: a user who runs thorough tuning on a RAM-rich machine gets "your defaults are already the fastest" while double-digit wins sit outside the tuner's surface. That is the exact result I got on two machines. **Environment** - Machine A: RTX 5080 16 GB, Ryzen 9 9950X (16C/32T), 123 GiB RAM, Linux (xanmod 7.2.9), engine 0.1.57 cuda13, control 0.1.57. Model: Qwen3.8-Flash-Next Unsloth UD-IQ3_XXS, 512K context, DFlash2 (spec 6, conf 0.8), all other settings default. - Machine B: GTX 1080 Ti 11 GB (sm_61), engineering-sample Intel 20C/40T @ 2.2 GHz, 125 GiB RAM, CachyOS, engine 0.1.57 cuda12, same model/config. **Evidence** (my own runs; paired candidate/baseline boots interleaved on the same day, 3 pairs per confirmed number, geometric mean of decode/code-gen/4K/30K-prefill tok/s; ~150 boots per machine; per-run JSONL retained; the harness drives the same `serve.server` + engine stack the tuner uses) | Knob (not in the tuner's surface) | Machine A | Machine B | |---|---|---| | Tail-skip 7 vs 0 (alone) | **+9.4%** (1.077/1.094/1.113) | +6.5%; prefill −9%, recovered by HC_UPMIX | | 3-knob combo (tail-skip 7 + `STRATA_HC_UPMIX=1` + `--ple-io direct`) | **+9.4%**, prefill flat, RAM peak 77→59 GiB | **+9.4%** (1.094/1.102/1.086), prefill flat, RAM 76→57 GiB | | `--ple-io direct` vs `ram` (alone) | 0.995 (flat), −18 GiB | prefill −8%; tuned variant (row cache 2M + inflight 512) recovers it, −26 GiB | | `STRATA_DEQUANT_WIDE=1` | +5% prefill in screen, not confirmed in pairs | 0.993 | | `--pool-cores` fixed list | **−29%** decode | **−26%** decode | | `--pool-tasks 6` | −5% | −11% | | `--kv q4_0` | decode +7% / prompts −7% (trade) | +2–6% prefill (screen), not confirmed in pairs | For contrast, thorough tuning on machine A the same day returned `default_confirmed` with 6.3% run-to-run spread — every win in the table above was outside what it examined. Full per-metric tables and both confirm runs are in the JSONL logs; happy to attach sanitized copies. **Proposed behavior** (opt-in; the default path stays byte-identical) 1. **Arch-gated env-switch arm families** in thorough mode: tail-skip 7-vs-0 as a placement arm with the KL note, plus the documented per-arch opt-in switch sets as plain restart arms (~50 s each; skip via the existing condition facts where an arch lacks them). 2. **PLE I/O arms** gated on RAM facts: `ram` vs `mmap` vs `direct` (+ the row-cache/inflight variant), since the current choice is a static RAM check, not a measurement. 3. **`NEVER` rows** for `--pool-cores` fixed lists and small `--pool-tasks` on many-core CPUs, with the measured reason. 4. **An explicit consent flag** (e.g. `--tune-allow-quality`) that sweeps quality-classed knobs (`kv q4_0`/`k8v4`) and reports the documented perplexity trade alongside the speed result, instead of hiding them from a speed-goal tune. **Tradeoffs** Thorough runtime roughly doubles with the families above (more restarts); the existing paired-machinery in `autotune.py` already handles the noise problem, which is real (6–8% household spread on both machines). Quality arms must never fire without the explicit flag. Arch-gating needs the same `facts` mechanism `condition_holds` already uses. **Limits / not tested** - Perplexity/KL for `q4_0` and tail-skip: the numbers I cite for quality are the project docs' and 0.1.42 history's, not mine; I measured speed and answer-changing status only. - My prompt set is my harness's (chat decode, code generation, 4K and 30K prefill), not the tuner's request set. - n=3 pairs per confirmed number; sm_120 and sm_61 only; the draft knobs (DFlash2 conf/cap) were measured only on machine A. **Reproduction status**: reproduced on both machines listed above. **Related**: #5136 (tail-skip switch visibility), #5232 (`strata tune` UX), #3659 / #5459 (per-arch switch-set scope agreements — the same pattern this proposal would extend into the tuner).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5473
No description provided.