Skip to content

Can't run htdemucs with MIGraphX #28446

@jclsn

Description

@jclsn

Describe the issue

I am currently trying to add support for AMD GPUs in an onnxruntime-based project. I am using the ort wrapper for Rust. For some reason model loading fails. There are three initial spikes on the CPU followed by small ones on the GPU. Then one core keeps being maxed out at almost 100%. Nothing happens for two hours then it fails.

It works well on the CPU and CUDA. I am pretty new to machine learning. Here is the call

https://github.com/jclsn/stemgen/blob/c41cb010fa8bbd458723623264305e66fb87569d/src/demucs.rs#L126

and the log

❯ target/release/stemgen generate --device migraphx ~/Musik/some_track.mp3 ~/Musik/stem-out --model
htdemucs.onnx
[DEMUCS] Creating new Demucs instance with device: migraphx
[DEMUCS] Attempting to use MIGraphX execution provider
[DEMUCS] MIGraphX execution provider configured
[DEMUCS] ORT initialization took: 19.862µs
[DEMUCS] Loading model from local path: "htdemucs.onnx"
Error rewrite_reshapes: /usr/src/debug/migraphx/AMDMIGraphX-rocm-7.2.2/src/include/migraphx/check_shapes.hpp:220: same_dims:
 pointwise: Dimensions do not match
Dump: "/tmp/migraphx/rewrite_reshapes56920015489305.mxr"
Error fuse_reduce: /usr/src/debug/migraphx/AMDMIGraphX-rocm-7.2.2/src/include/migraphx/check_shapes.hpp:220: same_dims: poin
twise: Dimensions do not match
Dump: "/tmp/migraphx/fuse_reduce56973354655245.mxr"
Error fuse_pointwise_reduce: /usr/src/debug/migraphx/AMDMIGraphX-rocm-7.2.2/src/include/migraphx/check_shapes.hpp:220: same_
dims: pointwise: Dimensions do not match
Dump: "/tmp/migraphx/fuse_pointwise_reduce57024748904648.mxr"
migraphx_program_compile: Error: /usr/src/debug/migraphx/AMDMIGraphX-rocm-7.2.2/src/include/migraphx/check_shapes.hpp:220: s
ame_dims: pointwise: Dimensions do not match
2026-05-10 03:19:23.781696378 [E:onnxruntime:, inference_session.cc:2625 operator()] Exception during initialization: Failed
 to call function
Error: Error { code: RuntimeException, message: "Exception during initialization: Failed to call function", ptr: 0x55d8b4f48
e50 }

I was hoping you guys could give me some insight on why this isn't working. Thanks!

To reproduce

git clone https://github.com/jclsn/stemgen
git checkout feat/migraphx-support
export ORT_MIGRAPHX_MODEL_CACHE_PATH="$HOME/.cache/migraphx/models"
export ORT_MIGRAPHX_CACHE_PATH="$HOME/.cache/migraphx/"
cargo build --release --features migraphx && cargo build --release -p stemgen-cli --features migraphx 
target/release/stemgen generate --device migraphx testdata/Oddchap\ -\ Sound\ 104.mp3 .

Urgency

Not urgent

Platform

Linux

OS Version

Arch Linux

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.24.4-6

ONNX Runtime API

C

Architecture

X64

Execution Provider

MIGraphX

Execution Provider Library Version

7.2.2-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:MIGraphXissues related to AMD MI GraphX execution provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions