Skip to content

[AIROCMLIR-1010] Separate --debug flag into --debug and --debug-quick-tune-data to fix ~50GB .debug file#2414

Merged
erizheng-amd merged 9 commits into
developfrom
eric-1010
Jun 24, 2026
Merged

[AIROCMLIR-1010] Separate --debug flag into --debug and --debug-quick-tune-data to fix ~50GB .debug file#2414
erizheng-amd merged 9 commits into
developfrom
eric-1010

Conversation

@erizheng-amd

Copy link
Copy Markdown
Contributor

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.py with --debug flag 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 .debug file size from ~500MB to ~50GB.

Technical Details

This PR fixes this issue by separate --debug flag into --debug and --debug-quick-tune-data as quickTuningGen.py requires the .debug file but not using the detail measurements at all. Now with --debug-quick-tune-data, we still generate a .debug file but we drop the MeasurementsMs column entirely. We only print that if we want to do some actual debug work and require the MeasurementsMs data with --debug flag.

Test Plan

-- verify the QuickTuningGen works fine without MeasurementsMs
-- verify the .debug file size shrinks
-- ninja check-rocmlir
-- PR CI

Test Result

-- I have tried QuickTuningGen works fine without MeasurementsMs on a .debug file with only 2 problem configs with exhaustive tuning
-- For the 2 problem configs with exhaustive tuning, the .debug file size drops from 341MB to 3MB
-- ninja check-rocmlir passed
-- PR CI running

Submission Checklist

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-data flag to emit .debug files without the heavy MeasurementsMs per-iteration arrays.
  • Keeps --debug as the “full debug” mode that includes detailed per-iteration measurement arrays.
  • Adds a lit test that checks .debug output is produced and omits MeasurementsMs when 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.

Comment thread mlir/utils/performance/tuningRunner.py
@@ -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

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

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     
Flag Coverage Δ
gfx120x 82.53% <ø> (+0.01%) ⬆️
gfx950 82.49% <ø> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erizheng-amd
erizheng-amd merged commit 518955c into develop Jun 24, 2026
12 of 19 checks passed
@erizheng-amd
erizheng-amd deleted the eric-1010 branch June 24, 2026 13:48
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.

3 participants