Repository navigation
Conversation
measure_kernel returned NaN watts for every exception, and the sampling loop's synchronize swallowed its own failure, so a GPU fault during a power tune never reached the worker. The fault could then surface on the next candidate in the same worker. An AcceleratorError, or any error after which synchronize fails, is now raised; a sensor that cannot be read still gives NaN. The sampling thread is stopped even when the final synchronize raises. Co-authored-by: Cursor <cursoragent@cursor.com>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
Follow-up from #6970, raised in #5846.
package_power.measure_kernelreturned NaN watts for every exception, and_sync_cuda, which the sampling loop calls, swallowed a failed synchronize. A GPU fault during a--select powersampling pass therefore never reached themp_tunerworker. The candidate that faulted was not blamed, and the lost context could surface on the next candidate in the same worker.Change (
aiter/utility/package_power.pyonly)measure_kernelre-raises anAcceleratorErroras is. For any other error it checks whether a synchronize now fails; if so it raises that error, with the original as its cause. Any other error, such as a sensor that cannot be read, still gives NaN watts with a warning._sync_cudaraises a failed synchronize. It skips only when torch or an initialized CUDA context is missing.How the fault is handled
work_group's catch-all marks that candidate's group failed, as it does for any other fault in a group.Latency tunes do not sample power, so they are unchanged.
PR Self-Review
Reviewed revision
e29d98aBehavior and intent
A GPU fault during the power-sampling pass of a
--select powertune is now raised to the tuner instead of read as NaN watts, so it is charged to the candidate that caused it. A sensor that cannot be read still gives NaN. Latency selection is unchanged.Validation and unverified scope
CPU only (
HIP_VISIBLE_DEVICES=-1), on main29625f7:python -m unittest op_tests.tuning_tests.test_fast_tuning: 58 passed, 1 skipped, 1 error. The error istest_k5_post_process_keeps_lower_energy_duplicate, where Triton finds no GPU driver; it errors the same way on main without a GPU.test_mp_tuner_logic,test_tuner_infraandtest_compare_logicpass except the twotest_tuner_infragrouped-MoE tests that fail on main because of [FlyDSL] Add gfx1250 grouped MoE A-preshuffle and tuned CSV validation #6709'sa_preshufflecolumn (fixed in [CK] [FlyDSL] [CI] [Tuning] Per-candidate faults, selection proof and auto-select in --compare #5846).Unverified: not run on a GPU, and not run together with #5846's fault handling. A real faulting kernel during the power pass is covered only by the mocked tests below.
PR-specific question
Does raising the fault change anything for a tune on main before #5846 lands? Yes, and only under
--select power. On main,work_group's catch-all now marks the faulting candidate's group as failed instead of recording NaN watts for it and running the next candidate on the broken context. With #5846, the parent tells the fault apart by type and fails only that candidate. Latency tunes never callmeasure_kernel, so they are unchanged. No.github/changes.Changed op tests
test_fast_tuning.py(extended): five CPU tests forpackage_power. AnAcceleratorErrorfrom the sampled call is raised unchanged; an error that breaks synchronize is raised as that synchronize error, with the original as its cause; an error that leaves synchronize working still gives NaN; the synchronize check itself; and the sampling thread ending when the final synchronize raises. No existing test covered the exception path ofmeasure_kernel.Made with Cursor