add missing MLIR wrapper stubs for MLIR-disabled builds - #5154
Merged
causten merged 3 commits intoAug 24, 2026
Conversation
…ve no undefined symbols The MLIR wrappers are declared unconditionally in gpu/mlir.hpp and called unconditionally from gpu/jit/mlir.cpp, but mlir.cpp's #else (MLIR-off) branch defined only 5 of 9. The missing four (is_module_fusible, adjust_param_shapes, dump_mlir_to_file, dump_mlir_to_mxr) became undefined symbols when MLIR is off, so dlopen(RTLD_NOW) failed and the ORT MIGraphX EP fell back to CPU. Add no-op stubs for the four in the #else branch; is_module_fusible returns false so callers take the non-MLIR path. MLIR-on builds are unaffected (the #else block isn't compiled).
Contributor
|
Thank you for your contribution! Since this is an external pull request, a maintainer must review PR and add the "ok-to-test" label if it is approved for testing. |
TedThemistokleous
approved these changes
Aug 19, 2026
pfultz2
approved these changes
Aug 20, 2026
Collaborator
|
Code changes look good. I'll rerun CI because your PR hit failures that appear unrelated |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5154 +/- ##
========================================
Coverage 93.10% 93.10%
========================================
Files 622 622
Lines 33157 33157
========================================
Hits 30870 30870
Misses 2287 2287 🚀 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
When MIGraphX is built with MLIR off, libmigraphx_gpu.so fails to load with an undefined symbol error, so the ONNX Runtime MIGraphX EP can't initialize and falls back to CPU. This makes the "MLIR off" build usable instead of broken.
Technical Details
The MLIR wrappers are declared unconditionally in gpu/mlir.hpp and called unconditionally from gpu/jit/mlir.cpp, but mlir.cpp's #else (MLIR-off) branch defined only 5 of 9. The missing four (is_module_fusible, adjust_param_shapes, dump_mlir_to_file, dump_mlir_to_mxr) became undefined symbols, so dlopen(RTLD_NOW) failed. This adds no-op stubs for them in the #else branch (is_module_fusible returns false → callers take the non-MLIR path). MLIR-on builds are unaffected since the #else block isn't compiled.
so added missing MLIR wrapper stubs for MLIR-disabled builds
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.