[AIROCMLIR-1010] Separate --debug flag into --debug and --debug-quick-tune-data to fix ~50GB .debug file#2414
Merged
Merged
Conversation
erizheng-amd
requested review from
Copilot,
dhernandez0,
justinrosner,
mirza-halilcevic,
pabloantoniom and
umangyadav
June 18, 2026 21:09
justinrosner
approved these changes
Jun 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Backports a tuningRunner debug-output change from rocmlirTriton to rocMLIR to prevent .debug TSV files from exploding in size after the timing-method change (by making per-iteration measurement arrays opt-in).
Changes:
- Adds a new
--debug-quick-tune-dataflag to emit.debugfiles without the heavyMeasurementsMsper-iteration arrays. - Keeps
--debugas the “full debug” mode that includes detailed per-iteration measurement arrays. - Adds a lit test that checks
.debugoutput is produced and omitsMeasurementsMswhen using--debug-quick-tune-data.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mlir/utils/performance/tuningRunner.py | Adds --debug-quick-tune-data and enables .debug file generation for either debug mode while only emitting MeasurementsMs for full --debug. |
| mlir/test/perf-scripts/runtime/tuningRunner-gemm.py | Adds a runtime lit test validating the new quick-debug mode’s .debug schema (no MeasurementsMs). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,13 @@ | |||
| # Using a tiny GEMM with --debug-quick-tune-data. This emits a `.debug` | |||
| # arrays. Verify the debug file is produced, has the expected header and | ||
| # per-config rows, and that the measurements column is absent. | ||
| # RUN: rm -f %t2.tsv %t2.tsv.state %t2.tsv.debug | ||
| # RUN: tuningRunner.py --op gemm --tuning-space=quick --debug-quick-tune-data \ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2414 +/- ##
===========================================
+ Coverage 82.57% 82.68% +0.11%
===========================================
Files 120 120
Lines 42852 42828 -24
Branches 7110 7106 -4
===========================================
+ Hits 35381 35410 +29
+ Misses 4815 4791 -24
+ Partials 2656 2627 -29
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR backports PR https://github.com/ROCm/rocmlirTriton/pull/297 in rocmlirTriton to rocMLIR.
After the PR #2407 change in timing method, the .debug file generated with
tuningRunner.pywith--debugflag now has a huge array of measurements for every tested config. Previously, we only had something like{'total_cpu_time': 40.19872, 'iterations': 31}for small kernels, and this change increased the.debugfile size from ~500MB to ~50GB.Technical Details
This PR fixes this issue by separate
--debugflag into--debugand--debug-quick-tune-dataasquickTuningGen.pyrequires the.debugfile but not using the detail measurements at all. Now with--debug-quick-tune-data, we still generate a.debugfile but we drop theMeasurementsMscolumn entirely. We only print that if we want to do some actual debug work and require theMeasurementsMsdata with--debugflag.Test Plan
-- verify the
QuickTuningGenworks fine withoutMeasurementsMs-- verify the
.debugfile size shrinks-- ninja check-rocmlir
-- PR CI
Test Result
-- I have tried
QuickTuningGenworks fine withoutMeasurementsMson a .debug file with only 2 problem configs with exhaustive tuning-- For the 2 problem configs with exhaustive tuning, the
.debugfile size drops from 341MB to 3MB-- ninja check-rocmlir passed
-- PR CI running
Submission Checklist