Skip to content

add missing MLIR wrapper stubs for MLIR-disabled builds - #5154

Open
nkotakal0107 wants to merge 1 commit into
ROCm:developfrom
nkotakal0107:fix/mlir-off-undefined-symbols
Open

add missing MLIR wrapper stubs for MLIR-disabled builds#5154
nkotakal0107 wants to merge 1 commit into
ROCm:developfrom
nkotakal0107:fix/mlir-off-undefined-symbols

Conversation

@nkotakal0107

Copy link
Copy Markdown

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.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

…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).
@nkotakal0107
nkotakal0107 requested a review from causten as a code owner August 19, 2026 06:40
@github-actions

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants