Skip to content

feat(knobs): add strict --knob validation, --sweep-knobs, and --knob-candidates - #150

Open
SamuelReeder wants to merge 1 commit into
users/sareeder/perf-integrityfrom
users/sareeder/knob-sweeps
Open

SamuelReeder wants to merge 1 commit into
users/sareeder/perf-integrityfrom
users/sareeder/knob-sweeps

Conversation

@SamuelReeder

@SamuelReeder SamuelReeder commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Stack

  1. fix(perf-integrity): unify timing modes, compare gates, runtime guards, and telemetry #149 (users/sareeder/perf-integrity-fixes → main): Performance-integrity bug fixes (timing unification, compare gates, runtime guards, telemetry, analytical v2, DVC setup)
  2. feat(perf-integrity): add calibrated cold-cache sweep, rotating buffers, and versioned input recipes (ALMIOPEN-3437) #143 (users/sareeder/perf-integrity → users/sareeder/perf-integrity-fixes): ALMIOPEN-3437 — Calibrated cold-cache sweep, VRAM-safe rotating buffers, and versioned input recipes
  3. feat(knobs): add strict --knob validation, --sweep-knobs, and --knob-candidates #150 (this PR, users/sareeder/knob-sweeps → users/sareeder/perf-integrity): Strict --knob validation, --sweep-knobs, and --knob-candidates

Summary

Adds strict hipDNN knob pinning and exact candidate-tuple knob sweeping on top of #143:

  • Strict --knob KEY=VAL[,...] (parser.py, knob_sweep.py, executor.py, common/exceptions.py, suite_runner_cli.py): Validates explicit knob IDs and domains strictly against the engine's exposed knobs before priming/building (Executor.validate_knobs()); raises InvalidKnobError and exits with code 2 on invalid user-pinned knobs or unreadable/malformed --knob-candidates files.
  • Candidate-tuple sweeps (--sweep-knobs, --knob-candidates PATH): Runs the unpinned baseline first, then benchmarks each exact candidate tuple for each --engine (engine[cand_id]), skipping individual engine-rejected candidates without aborting the sweep.
  • Schema & child forwarding (suite_results.py, oracle.py, hipdnn_tuned_child.py, profiling_orchestrator.py, internal_profiling.py): Records run.config.knobs, run.config.sweep_knobs, engine.plan_name, and engine.knobs; forwards base knobs to hipDNN --oracle children (merged under global.benchmarking=1) and profiling children (--knob).
  • Docs & config (AGENTS.md, docs/usage.md, docs/results-schema.md, sample_configs/config.toml.example): Documents the new flags, exit code 2 rules, and schema keys.

Risk Assessment

Risk Level: 2 / 5 — Opt-in CLI feature (--knob, --sweep-knobs, --knob-candidates) across 19 files; default unpinned runs only populate engine.plan_name (when exposed) and engine.knobs = null.

Device / Architecture Coverage

  • gfx90a (MI210, local): Verified --sweep-knobs --knob-candidates on MIOPEN_ENGINE with --validate pytorch (baseline + candidate passed, plan_name and knobs recorded) and verified invalid --knob bogus_nonexistent=1 exits 2 with the exposed knob list.

Testing Summary

  • black --check (25.12.0): passed on all 42 modified/added Python files across the stack.
  • CPU unit tests (PYTHONPATH=src .workspace/.venv/bin/python -m pytest tests/unit -m "not gpu" -q): 2,301 passed, 1 skipped, 0 failed.

Testing Checklist

  • black --check (25.12.0) on all modified/added Python files
  • Full CPU unit suite (2,301 passed, 1 skipped)
  • MI210 (gfx90a) targeted GPU checks (--sweep-knobs, invalid --knob exit 2)
  • gpu-tests (gfx950, full suite) CI lane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant