From f0504b0ff21d12c87334a49f0d670207c477c4f8 Mon Sep 17 00:00:00 2001 From: scott Date: Thu, 2 Apr 2026 21:33:06 -0400 Subject: [PATCH] Fix ROCm 6.x hipBLAS API incompatibilities from ROCm 7 patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add hiprand-dev and hipcub-dev for missing headers - Patch cuda2hip_macros.hpp post-apply: downgrade hipDataType→hipblasDatatype_t and HIP_R_* → HIPBLAS_R_* since ROCm 6.2 hipblasGemmEx still uses the older hipblasDatatype_t signature (hipDataType wasn't wired into hipblasGemmEx until ROCm 7.0) Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 24bb4fe..5fc82cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git cmake cmake-curses-gui \ libopenblas-dev wget \ python3-dev python3-pip \ - hipblas-dev miopen-hip-dev rocthrust-dev \ + hipblas-dev miopen-hip-dev rocthrust-dev hiprand-dev hipcub-dev \ && rm -rf /var/lib/apt/lists/* # Build oneDNN as a static library (CPU fallback / conv ops) @@ -40,6 +40,14 @@ RUN git clone --branch v4.0.0 --depth 1 \ cd /build/CTranslate2 && \ git submodule update --init --recursive && \ git apply /tmp/ct2_4.0.0_rocm.patch && \ + sed -i \ + -e 's/hipDataType/hipblasDatatype_t/g' \ + -e 's/HIP_R_16F/HIPBLAS_R_16F/g' \ + -e 's/HIP_R_32F/HIPBLAS_R_32F/g' \ + -e 's/HIP_R_16BF/HIPBLAS_R_16BF/g' \ + -e 's/HIP_R_32I/HIPBLAS_R_32I/g' \ + -e 's/HIP_R_8I/HIPBLAS_R_8I/g' \ + src/cuda2hip_macros.hpp && \ mkdir build && cd build && \ cmake -DCMAKE_INSTALL_PREFIX=${CTRANSLATE2_ROOT} \ -DCMAKE_PREFIX_PATH=/opt/rocm \