Skip to content

if miopen/hipblas/rocblas are not enabled, send gemms to rocmlir - #5059

Merged
causten merged 3 commits into
developfrom
bdevorem/lower_conv
Jul 15, 2026
Merged

if miopen/hipblas/rocblas are not enabled, send gemms to rocmlir#5059
causten merged 3 commits into
developfrom
bdevorem/lower_conv

Conversation

@bdevorem

@bdevorem bdevorem commented Jul 13, 2026

Copy link
Copy Markdown
Member

Motivation

When external libraries are not enabled, gemm ops need to be sent to rocmlir so they are lowered properly.

Technical Details

Just adds a check for the libraries. If not enabled, then send relevant ops to rocmlir

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GPU MLIR fusion routing so that when external GPU libraries (MIOpen / rocBLAS / hipBLASLt) are disabled at build time, convolution and GEMM-like ops are routed through rocMLIR to ensure they are still lowered properly.

Changes:

  • Extend fuse_mlir’s mode selection to force rocMLIR routing for convolution when MIOpen is disabled, and for dot/fused_dot when GEMM libraries are disabled.
  • Update the dependency/source specification for rocMLIR in requirements.txt.
  • Add a changelog entry documenting the behavior change.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/targets/gpu/fuse_mlir.cpp Forces rocMLIR routing for conv/dot under specific “library disabled” build configurations.
requirements.txt Changes how rocMLIR is sourced for builds.
CHANGELOG.md Documents the new routing behavior in the changelog.

Comment thread src/targets/gpu/fuse_mlir.cpp
@bdevorem
bdevorem marked this pull request as ready for review July 13, 2026 18:47
@bdevorem
bdevorem requested review from a team and causten as code owners July 13, 2026 18:47
Comment thread src/targets/gpu/fuse_mlir.cpp Outdated
@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jul 13, 2026

Copy link
Copy Markdown
Test Batch New Rate (5a7f29) Old Rate (55ca93) Diff Status
torchvision-resnet50 64 3,151.33 3,169.20 -0.56%
torchvision-resnet50_fp16 64 6,584.57 6,721.88 -2.04%
torchvision-densenet121 32 2,569.27 2,712.99 -5.30% 🔴
torchvision-densenet121_fp16 32 2,479.06 4,578.90 -45.86% 🔴
torchvision-inceptionv3 32 1,771.36 1,805.02 -1.86%
torchvision-inceptionv3_fp16 32 1,279.87 2,855.31 -55.18% 🔴
cadene-inceptionv4 16 515.40 824.13 -37.46% 🔴
cadene-resnext64x4 16 782.46 785.46 -0.38%
slim-mobilenet 64 6,938.26 8,444.46 -17.84% 🔴
slim-nasnetalarge 64 145.55 229.50 -36.58% 🔴
slim-resnet50v2 64 3,093.28 3,185.35 -2.89%
bert-mrpc-onnx 8 1,169.12 1,173.56 -0.38%
bert-mrpc-tf 1 488.24 484.20 0.83%
pytorch-examples-wlang-gru 1 542.20 472.27 14.81% 🔆
pytorch-examples-wlang-lstm 1 389.61 386.76 0.74%
torchvision-resnet50_1 1 626.05 754.58 -17.03% 🔴
cadene-dpn92_1 1 315.96 444.58 -28.93% 🔴
cadene-resnext101_1 1 216.11 366.32 -41.00% 🔴
onnx-taau-downsample 1 87.57 402.99 -78.27% 🔴
dlrm-criteoterabyte 1 0.87 32.58 -97.32% 🔴
dlrm-criteoterabyte_fp16 1 35.24 52.65 -33.06% 🔴
agentmodel 1 9,257.72 7,784.58 18.92% 🔆
unet_fp16 2 5.76 57.48 -89.98% 🔴
resnet50v1_fp16 1 20.08 932.89 -97.85% 🔴
resnet50v1_int8 1 22.80 934.74 -97.56% 🔴
bert_base_cased_fp16 64 344.95 1,105.09 -68.79% 🔴
bert_large_uncased_fp16 32 150.02 347.51 -56.83% 🔴
bert_large_fp16 1 38.08 205.61 -81.48% 🔴
distilgpt2_fp16 16 1,243.42 2,104.89 -40.93% 🔴
yolov5s 1 69.55 559.63 -87.57% 🔴
tinyllama 1 13.65 46.13 -70.41% 🔴
vicuna-fastchat 1 22.20 44.16 -49.73% 🔴
whisper-tiny-encoder 1 193.75 415.45 -53.37% 🔴
whisper-tiny-decoder 1 61.27 412.20 -85.13% 🔴
llama2_7b 1 1.51 21.00 -92.79% 🔴
qwen1.5-7b 1 5.01 23.73 -78.90% 🔴
phi3-3.8b 1 19.42 26.83 -27.63% 🔴
llama3-8b 1 15.91 21.87 -27.28% 🔴
whisper-large-encoder 1 10.14 10.23 -0.93%
whisper-large-decoder 1 14.58 104.89 -86.10% 🔴
mistral-7b 1 4.97 23.89 -79.21% 🔴
FLUX.1-schnell 1 294.19 760.54 -61.32% 🔴

Regressions detected 🔴

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jul 13, 2026

Copy link
Copy Markdown
Test Status Result
bert-mrpc-onnx PASSED: MIGraphX meets tolerance
bert-mrpc-tf PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-gru PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-lstm PASSED: MIGraphX meets tolerance
dlrm-criteoterabyte PASSED: MIGraphX meets tolerance
agentmodel PASSED: MIGraphX meets tolerance
unet PASSED: MIGraphX meets tolerance
resnet50v1 PASSED: MIGraphX meets tolerance
bert_base_cased_fp16 PASSED: MIGraphX meets tolerance
bert_large_uncased_fp16 🔴 FAILED: MIGraphX is not within tolerance - check verbose output
bert_large PASSED: MIGraphX meets tolerance
yolov5s PASSED: MIGraphX meets tolerance
tinyllama PASSED: MIGraphX meets tolerance
vicuna-fastchat PASSED: MIGraphX meets tolerance
whisper-tiny-encoder PASSED: MIGraphX meets tolerance
whisper-tiny-decoder PASSED: MIGraphX meets tolerance
distilgpt2_fp16 PASSED: MIGraphX meets tolerance
llama2_7b PASSED: MIGraphX meets tolerance
qwen1.5-7b PASSED: MIGraphX meets tolerance
phi3-3.8b PASSED: MIGraphX meets tolerance
llama3-8b PASSED: MIGraphX meets tolerance
whisper-large-encoder PASSED: MIGraphX meets tolerance
whisper-large-decoder PASSED: MIGraphX meets tolerance
mistral-7b PASSED: MIGraphX meets tolerance
FLUX.1-schnell PASSED: MIGraphX meets tolerance

@bdevorem
bdevorem force-pushed the bdevorem/lower_conv branch from 237cf62 to 5a7f298 Compare July 15, 2026 15:06
@causten
causten merged commit 2999007 into develop Jul 15, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants