Repository navigation
[AIROCMLIR-1030] Port recent enhancements in tuning scripts from rocMLIR to rocmlirTriton - #390
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR ports recent rocMLIR performance/tuning script enhancements into rocmlirTriton, including more consistent config canonicalization, improved verification behavior (timeouts + NUMA-aware locking), expanded quick-tuning generation for additional ops, and adds CI-ready Python tests for these scripts.
Changes:
- Add NUMA-node reader/writer locking to reduce CPU-verification interference during parallel tuning, and introduce a configurable verification timeout.
- Canonicalize and validate configs more consistently across
tuningRunner.pyandperfRunner.py, including stricter parsing/canonicalization in DB/config loaders. - Add new pytest-based unit tests (GPU-less via HIP mocking) and wire them into GitHub Actions CI; update CLI flag spellings and related docs/tests.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pip_requirements.txt | Adds pytest dependency for new test suite. |
| mlir/utils/performance/tuningRunner.py | Ports tuning enhancements: verification timeout, NUMA locking, canonicalization/state handling, debug schema checks, CLI tweaks. |
| mlir/utils/performance/perfRunner.py | Ports canonicalization + DB parsing improvements; updates CLI flags (with backward-compatible aliases). |
| mlir/utils/performance/perfCommonUtils.py | Minor regex literal fix (raw string). |
| mlir/utils/performance/analysis/quickTuningGen.py | Adds GemmGemm/ConvGemm support and kernel-type mapping updates. |
| mlir/utils/jenkins/Jenkinsfile | Updates perfRunner invocation flags to new dashed forms. |
| mlir/test/perf-scripts/runtime/perfRunner-help.py | Updates help-output checks for new dashed flags. |
| mlir/test/perf-scripts/attention-tuning-db-compat.py | Updates read_tuning_db call signature to include config class and fallback params. |
| .github/workflows/ci.yml | Adds a new containerized pytest job for performance scripts. |
| mlir/utils/performance/tests/test_tuningRunner.py | New unit tests for tuningRunner (mock HIP/GPU). |
| mlir/utils/performance/tests/test_perfRunner.py | New unit tests for perfRunner (mock HIP/GPU). |
| mlir/utils/performance/tests/mock_hip.py | New HIP + amd_arch_db mock module for CI environments without ROCm. |
| mlir/utils/performance/tests/init.py | New test package marker and brief description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note for reviewers: I will rebase onto the develop branch after #306 merged. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
mlir/utils/performance/tuningRunner.py:1112
- DebugFileWriter currently rejects appending when the column order differs from the existing header, even if the schemas are identical. This can happen when the existing file was produced by a different pandas/Python version (or any code path that emits the same columns in a different order), and it prevents safe resumption even though the data could be re-ordered to match the existing header.
Instead of requiring new_columns == existing_columns, consider treating it as a mismatch only when the column sets differ, and when they match, reindex the DataFrame to existing_columns before writing so appended rows align with the on-disk header.
df = pd.DataFrame(result.entries)
new_columns = list(df.columns)
if self._existing_columns is not None and new_columns != self._existing_columns:
raise ValueError(
f"Debug file '{self.filepath}' has a schema that does not match the current "
d4ac40a to
a89a167
Compare
[AIROCMLIR-673] Canonicalize tuningRunner output Co-authored-by: Cursor <cursoragent@cursor.com>
…support to quickTuningGen.py- #2262
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
c332a5a to
c247b48
Compare
Motivation
This PR examines the new changes on tuning scripts from rocMLIR side since the last porting in PR #192, this includes
tuningRunner.py,perfRunner.py, andquickTuningGen.py. This PR ports the new changes and also add new tests while keeping the rocmlirTriton specific changes.Technical Details
This PR includes several major changes on the rocMLIR side:
Also includes the two new pytests in MLIR
test_tuningRunner.pyandtest_perfRunner.py, rewired and refactored them into LIT test:TestParseTuningDbLine,TestReadTuningDb,TestParseDataTypes,TestLayoutHelpers,TestGetNanoseconds,TestGetProfilerOutputPath,TestGetMetricArgsForRocprof,TestGetMilisecondsperfRunner-test.pyTestFormatError,TestGetConfigClass,TestParseArguments,TestNumaTopologyParseCpuListtuningRunner-arg-validation.pyTestGetStateFilepath,TestTuningState,TestTuningStateFile,TestTunedConfigsCache,TestDebugFileWriter,TestGetGitCommitHashtuningRunner-state.pyTestCanonicalizeTestVectortuningRunner-canonicalization.pyTestNumaNodeLocktuningRunner-numa-lock.pyTestFindBestPerfconfig,TestTuneConfigtuningRunner-driver-results.pyChanges are intentionally left out:
amd_arch_dbis very different between the two repos.Divergence still presenting due to specific rocmlirTriton work:
--verify-modeis cpu only on rocmlirTriton introduced by Delete GPU verification (New) #94Test Plan
Test Result
Submission Checklist