Skip to content

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

Merged
causten merged 3 commits into
ROCm:developfrom
nkotakal0107:fix/mlir-off-undefined-symbols
Aug 24, 2026
Merged

add missing MLIR wrapper stubs for MLIR-disabled builds#5154
causten merged 3 commits into
ROCm:developfrom
nkotakal0107:fix/mlir-off-undefined-symbols

Conversation

@nkotakal0107

Copy link
Copy Markdown
Contributor

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.

@TedThemistokleous TedThemistokleous added bugfix Fixes a bug found in the code. simple small or simple changes Cleanup Cleans up code from stale bits/warnings/previous changes for a previous feature PR labels Aug 20, 2026
@causten

causten commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Code changes look good. I'll rerun CI because your PR hit failures that appear unrelated

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CharlieL7
CharlieL7 removed their request for review August 24, 2026 19:26
@causten
causten merged commit 5a80dc9 into ROCm:develop Aug 24, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug found in the code. Cleanup Cleans up code from stale bits/warnings/previous changes for a previous feature PR ok-to-test simple small or simple changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants