Skip to content

fix(perf-integrity): unify timing modes, compare gates, runtime guards, and telemetry - #149

Open
SamuelReeder wants to merge 1 commit into
mainfrom
users/sareeder/perf-integrity-fixes
Open

SamuelReeder wants to merge 1 commit into
mainfrom
users/sareeder/perf-integrity-fixes

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 (this PR, 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 (users/sareeder/knob-sweeps → users/sareeder/perf-integrity): Strict --knob validation, --sweep-knobs, and --knob-candidates

Summary

Fixes performance-integrity bugs across timing, validation, comparison, runtimes, telemetry, analytical metrics, and setup on top of main (1e6c8a5), without changing default input distributions or cache modes.

  • Timing & comparison integrity: Unifies per-graph timing mode on mixed staged/events fallback (MixedModeFallbackError / MIXED_MODE_RERUN_REASON); refuses vs_best ranking across mixed (mode, launch_mode) and shows launch modes in the legend; gates compare on timing.mode, timing.launch_mode, and validation state (passed vs unchecked), warns on timer mismatches, labels failed-only B rows B failed, handles missing quartiles as unknown spread, adds 1e-12 threshold boundary tolerance, and adds --strict-coverage.
  • Validation completeness: Fails validation when an engine omits a declared output tensor instead of skipping comparison; excludes unchecked rows from ranking when validated rows exist; ignores nonpositive medians when positive siblings exist.
  • Runtime & profiler safety: Passes use_graph=False on rocKE auto where supported (recording launch_mode) and releases eager 3D scratch per iteration via after_iteration; guards AITER OPUS against nonpositive attn_scale (AITER_DISABLE_FMHA_OPUS=1 aware), excludes single-query asymmetric GQA decode from ck/asm_v3, isolates hipconfig from profiler env vars, and records timing.timed_work_notes; surfaces PyTorch varlen SDPA per-batch output copy (varlen_per_batch_copy) in timing.timed_work_notes; preserves PYTORCH_TUNABLEOP_* in tuned PyTorch children while disabling it on OOTB runs; isolates --fresh-state oracle caches and forwards --fresh-state to PyTorch children; keeps GPU reference outputs resident during OOTB timing regardless of profiling flags and frees them before profiling children run; resolves ragged varlen layouts before allocation in hipdnn_tuned_child; preserves native C signal handlers during teardown.
  • Telemetry, analytical v2 & setup: Initializes amdsmi before start_runtime() imports torch, requires non-empty handles in is_amdsmi_available(), stops permanently caching pre-HIP None handles, and samples clocks/power/throttling during timed loops (GpuSmiProbe.sample_during()); bumps ANALYTICAL_FORMULA_VERSION to 2 (missing dims → None, scalar dims=[] → 1, known-zero rates → 0.0, ambiguous packed paged diagonal SDPA → None); adds zero-sample timer-resolution warning and non-finite IQR guards; sets DVC_GLOBAL_CONFIG_DIR to <workspace>/dvc-config in setup_env.py.

Risk Assessment

Risk Level: 2 / 5 — Correctness and integrity fixes across 35 files; preserves default warm cache mode and default U[0, 1) inputs.

Device / Architecture Coverage

  • gfx90a (MI210, local): Full unit suite + live MI210 checks for amdsmi in-run telemetry, PyTorch --oracle TunableOp preservation (1.09x), --pytorch-dispatch integration, and validation completeness.
  • gfx950: AITER/rocKE live runtime paths verified via unit tests here; full hardware coverage runs on the gpu-tests (gfx950, full suite) CI lane.

Testing Summary

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

Testing Checklist

  • black --check (25.12.0) on all modified/added Python files
  • Full CPU unit suite (2,276 passed, 1 skipped)
  • MI210 (gfx90a) targeted GPU verification
  • 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