rocmlir-tuning-driver improvements#2249
Merged
mirza-halilcevic merged 13 commits intodevelopfrom Feb 27, 2026
Merged
Conversation
the concurrent queue.
umangyadav
approved these changes
Feb 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the rocmlir-tuning-driver to reduce memory usage and improve performance during tuning operations, particularly targeting issues on APU systems with limited memory.
Changes:
- Eliminates host buffer allocation by initializing GPU buffers directly with hipMemsetAsync
- Implements rate-adaptive concurrent queue to provide backpressure and prevent excessive memory accumulation
- Caches and reuses thread resources (MLIR contexts, PassManagers) across greedy tuning iterations
- Tracks effective tuning kind to avoid unnecessary iterations when greedy mode falls back to exhaustive
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mlir/tools/rocmlir-tuning-driver/rocmlir-tuning-driver.cpp | Refactored buffer management to use GPU-direct initialization, moved stream creation outside benchmarking loop, implemented thread resource caching, and added effectiveKind tracking |
| mlir/tools/rocmlir-tuning-driver/ConcurrentQueue.h | Added rate-adaptive queue with dynamic capacity adjustment to limit memory usage from compilation results |
| mlir/lib/Dialect/Rock/Tuning/RockTuningImpl.cpp | Set effectiveKind field when creating tuning space and when falling back from Greedy to Exhaustive |
| mlir/include/mlir/Dialect/Rock/Tuning/RockTuning.h | Added effectiveKind field to TuningParamSet struct to track actual tuning mode used |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mr-Anyone
pushed a commit
that referenced
this pull request
Mar 2, 2026
* Reuse resources between greedy tuning iterations. * Reuse hipStream and only do hostToDevice copy once. * Improve memory footprint by making host buffers temporary and bounding the concurrent queue. * Avoid extra iterations if falling back to greedy to exhaustive. * Use memset to initialize gpu buffers and void host memory overhead. * Fix bugs in ConcurrentQueue. * Avoid using minCapacity for ConcurrentQueue.
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
Improvements to reduce memory usage and improve performance when tuning. Excessive memory usage causes problems on APU systems.
Technical Details
rocmlir-tuning-driver.cpp:
ConcurrentQueue.h
Test Plan
Several problem configs that were previously crashing on Hark Point are now able to run.
Submission Checklist