From f0ab3c1d599c3ed00705d46eb14527235b629b12 Mon Sep 17 00:00:00 2001 From: scott Date: Mon, 6 Apr 2026 19:23:28 -0400 Subject: [PATCH] Add MIGraphX/half deps and use AMD onnxruntime wheel for ROCm 6.1.3 Per AMD docs (rocm.docs.amd.com install-onnx): - apt install migraphx, migraphx-dev, half (required by onnxruntime-rocm) - Switch to AMD-hosted wheel: onnxruntime_rocm-1.17.0-cp310 from repo.radeon.com - Pin numpy==1.26.4 (numpy 2.0 incompatible with this wheel) - Add MIGraphXExecutionProvider to provider list in engine.py Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile.rocm | 3 +++ engine.py | 6 +++++- requirements-rocm-init.txt | 5 ++++- requirements-rocm.txt | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile.rocm b/Dockerfile.rocm index ea0b365..3add5cc 100644 --- a/Dockerfile.rocm +++ b/Dockerfile.rocm @@ -14,6 +14,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ libsndfile1 \ hipblas \ + migraphx \ + migraphx-dev \ + half \ && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/engine.py b/engine.py index 56b5a4b..928fa66 100644 --- a/engine.py +++ b/engine.py @@ -37,7 +37,11 @@ def detect_device() -> str: def _get_providers(device: str) -> list: if device in ("rocm", "cuda"): - return [("ROCMExecutionProvider", {"device_id": 0}), "CPUExecutionProvider"] + return [ + "MIGraphXExecutionProvider", + ("ROCMExecutionProvider", {"device_id": 0}), + "CPUExecutionProvider", + ] return ["CPUExecutionProvider"] diff --git a/requirements-rocm-init.txt b/requirements-rocm-init.txt index 8c57eb8..3511c76 100644 --- a/requirements-rocm-init.txt +++ b/requirements-rocm-init.txt @@ -1 +1,4 @@ -onnxruntime-rocm +# AMD-provided onnxruntime wheel for ROCm 6.1.3 (Python 3.10) +# numpy must be pinned — 2.0 is incompatible with this wheel +https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/onnxruntime_rocm-1.17.0-cp310-cp310-linux_x86_64.whl +numpy==1.26.4 diff --git a/requirements-rocm.txt b/requirements-rocm.txt index 51ebf7e..1ac9dc9 100644 --- a/requirements-rocm.txt +++ b/requirements-rocm.txt @@ -1,5 +1,5 @@ # Audio processing -numpy>=1.24.0,<2.0.0 +numpy==1.26.4 soundfile librosa==0.11.0