[AIROCMLIR-555] Remove mhal.launch and mhal.await from the codebase#2333
Open
erizheng-amd wants to merge 28 commits intodevelopfrom
Open
[AIROCMLIR-555] Remove mhal.launch and mhal.await from the codebase#2333erizheng-amd wants to merge 28 commits intodevelopfrom
mhal.launch and mhal.await from the codebase#2333erizheng-amd wants to merge 28 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the remaining reliance on mhal.launch/mhal.dependency in MIGraphX-to-{Tosa,Linalg} boundary handling by switching the clone-harness wrapper path to func.call, and updates GPU lowering + LIT tests accordingly.
Changes:
- Update
rocmlir-genclone-harness wrapper generation to usefunc.calland ensure prefill initialization is inserted for bothmhal.launchandfunc.callpaths. - Remove
mhal.launchlegality/pattern handling from MIGraphXToTosa and MIGraphXToLinalg boundary conversions. - Extend MHAL→GPU lowering to handle bufferized
func.callto GPU kernels, and update e2e/LIT expectations for the new verification output.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mlir/tools/rocmlir-gen/rocmlir-gen.cpp | Switch clone-harness wrapper to func.call; run prefills before cloning; handle prefills for both launch/call. |
| external/mlir-hal/lib/Conversion/MHALToGPU/MHALToGPU.cpp | Add shared lowering for GPU kernels and support bufferized func.call lowering in addition to mhal.launch. |
| mlir/lib/Conversion/MIGraphXToTosa/MIGraphXToTosaPass.cpp | Remove mhal.launch dynamic legality from boundary conversion setup. |
| mlir/lib/Conversion/MIGraphXToTosa/MIGraphXToTosa.cpp | Remove the mhal.launch conversion pattern from boundary pattern population. |
| mlir/lib/Conversion/MIGraphXToLinalg/MIGraphXToLinalgPass.cpp | Remove mhal.launch dynamic legality and launcher conversion hookup. |
| mlir/lib/Conversion/MIGraphXToLinalg/MIGraphXToLinalg.cpp | Stop injecting mhal.launch legalization patterns into boundary conversion patterns. |
| mlir/include/mlir/Conversion/MIGraphXToTosa/MIGraphXToTosa.h | Adjust includes for pass registration usage (PassManager). |
| mlir/include/mlir/Conversion/MIGraphXToLinalg/MIGraphXToLinalg.h | Remove launcher-conversion API declaration and prune includes. |
| mlir/test/xmir/pr-e2e/resnet18_blk3/resnet18_blk3_part2.mlir | Update RUN line to always print verify results; adjust FileCheck expectations. |
| mlir/test/xmir/pr-e2e/resnet18_blk3/resnet18_blk3_part1.mlir | Same as above. |
| mlir/test/xmir/pr-e2e/resnet18_blk2/resnet18_blk2_part0.mlir | Same as above. |
| mlir/test/xmir/pr-e2e/resnet18_blk1/resnet18_blk_part2.mlir | Same as above. |
| mlir/test/xmir/pr-e2e/resnet18_blk1/resnet18_blk_part0.mlir | Same as above. |
| mlir/test/fusion/pr-e2e/tosa-to-rock-exp.e2e.mlir | Update verifier output checks for new always-print behavior. |
| mlir/test/fusion/pr-e2e/mixr-sd-explicit-broadcasting.mlir | Replace mhal.launch/mhal.await with func.call in wrapper. |
| mlir/test/fusion/pr-e2e/mixr-gemm/mixr-gemm-tr-folding2.mlir | Replace mhal.launch/mhal.await with func.call in wrapper. |
| mlir/test/fusion/pr-e2e/mixr-gemm/mixr-gemm-tr-folding.mlir | Replace mhal.launch/mhal.await with func.call in wrapper. |
| mlir/test/fusion/pr-e2e/mixr-conv-bias-clipped-relu.mlir | Replace mhal.launch/mhal.await with func.call in wrapper. |
| mlir/test/fusion/pr-e2e/mixr-dot-int4-f16.mlir | Update FileCheck expectation from mhal.launch to call @.... |
| mlir/test/fusion/pr-e2e/mixr-non-contiguous-strides.mlir | Update RUN + expectation to reflect full-tensor correctness. |
| mlir/test/fusion/pr-e2e/mixr-expand-strides-non-multiple.mlir | Update RUN + expectation to reflect full-tensor correctness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 48 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
umangyadav
reviewed
Apr 14, 2026
umangyadav
reviewed
Apr 14, 2026
umangyadav
reviewed
Apr 14, 2026
umangyadav
reviewed
Apr 14, 2026
mhal.dependency from MIGraphXTo* passesmhal.launch and mhal.await from the codebase
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 addresses the issue in ticket 555. It removes the dependency on mhal conversions from both Tosa and Linalg by modifying the clone-harness pipeline
Technical Details
mhal.launchandmhal.awaittofunc.callModifiedMHALToGPU.cppto adapt bothmhalandfunc.callloweringmhal.launchandmhal.awaitas they are no longer usedTest Plan
Tested with check-rocmlir
Test Result
All tests passed
Submission Checklist