add missing MLIR wrapper stubs for MLIR-disabled builds - #5154
Open
nkotakal0107 wants to merge 1 commit into
Open
add missing MLIR wrapper stubs for MLIR-disabled builds#5154nkotakal0107 wants to merge 1 commit into
nkotakal0107 wants to merge 1 commit into
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
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.