From 7ffa22d8dec9a6ddb9f97502c8806d3cf4f884b3 Mon Sep 17 00:00:00 2001 From: Donato Capitella Date: Wed, 4 Feb 2026 14:50:32 +0000 Subject: [PATCH] fix: Add temporary workaround for ROCm 7 performance regression by setting HIP_LLVM_FLAGS. --- toolboxes/Dockerfile.rocm-7.2 | 3 +++ toolboxes/Dockerfile.rocm7-nightlies | 3 +++ 2 files changed, 6 insertions(+) diff --git a/toolboxes/Dockerfile.rocm-7.2 b/toolboxes/Dockerfile.rocm-7.2 index f4c0879..bc0468f 100644 --- a/toolboxes/Dockerfile.rocm-7.2 +++ b/toolboxes/Dockerfile.rocm-7.2 @@ -36,6 +36,9 @@ ENV ROCM_PATH=/opt/rocm \ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . +# Temporary workaround for ROCm 7 performance regression (https://github.com/ROCm/rocm-systems/issues/2865#issuecomment-3846679806) +ENV HIP_LLVM_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600" + # build RUN git clean -xdf \ && git submodule update --recursive \ diff --git a/toolboxes/Dockerfile.rocm7-nightlies b/toolboxes/Dockerfile.rocm7-nightlies index 2a0f997..d0c0eaf 100644 --- a/toolboxes/Dockerfile.rocm7-nightlies +++ b/toolboxes/Dockerfile.rocm7-nightlies @@ -57,6 +57,9 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . \ && git clean -xdf \ && git submodule update --recursive +# Temporary workaround for ROCm 7 performance regression (https://github.com/ROCm/rocm-systems/issues/2865#issuecomment-3846679806) +ENV HIP_LLVM_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600" + RUN cmake -S . -B build \ -DGGML_HIP=ON \ -DAMDGPU_TARGETS=gfx1151 \