From 67522ea78d021220bb5399bc21c8ee4c403d8634 Mon Sep 17 00:00:00 2001 From: "Mario Limonciello (AMD)" Date: Sat, 7 Feb 2026 07:20:02 -0600 Subject: [PATCH 1/4] Update ROCm docker container to 7.2 release Also add gfx1150 (Strix Point) --- .devops/rocm.Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.devops/rocm.Dockerfile b/.devops/rocm.Dockerfile index 14936f8e9c..efa6611ea2 100644 --- a/.devops/rocm.Dockerfile +++ b/.devops/rocm.Dockerfile @@ -1,8 +1,8 @@ ARG UBUNTU_VERSION=24.04 # This needs to generally match the container host's environment. -ARG ROCM_VERSION=7.0 -ARG AMDGPU_VERSION=7.0 +ARG ROCM_VERSION=7.2 +ARG AMDGPU_VERSION=7.2 # Target the ROCm build image ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete @@ -16,7 +16,7 @@ FROM ${BASE_ROCM_DEV_CONTAINER} AS build # gfx803, gfx900, gfx906, gfx1032, gfx1101, gfx1102,not officialy supported # check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.4.1/reference/system-requirements.html -ARG ROCM_DOCKER_ARCH='gfx803;gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1010;gfx1030;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151' +ARG ROCM_DOCKER_ARCH='gfx803;gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1010;gfx1030;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1150;gfx1151' #ARG ROCM_DOCKER_ARCH='gfx1151' # Set ROCm architectures From bf53d29a6d6d883dae0e6ead8f7adfdd1f93832e Mon Sep 17 00:00:00 2001 From: "Mario Limonciello (AMD)" Date: Sat, 7 Feb 2026 07:57:29 -0600 Subject: [PATCH 2/4] DIsable ROCWMMA_FATTN which fails on gfx908 --- .devops/rocm.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.devops/rocm.Dockerfile b/.devops/rocm.Dockerfile index efa6611ea2..832caeca3e 100644 --- a/.devops/rocm.Dockerfile +++ b/.devops/rocm.Dockerfile @@ -38,7 +38,6 @@ COPY . . RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \ cmake -S . -B build \ -DGGML_HIP=ON \ - -DGGML_HIP_ROCWMMA_FATTN=ON \ -DAMDGPU_TARGETS="$ROCM_DOCKER_ARCH" \ -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \ -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \ From f6f13fb4938b6a4bb29bc8dc98713c303e718a72 Mon Sep 17 00:00:00 2001 From: "Mario Limonciello (AMD)" Date: Sat, 7 Feb 2026 09:07:27 -0600 Subject: [PATCH 3/4] Update github actions workflow to use ROCm 7.2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51a3dc76e9..a8302796c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -584,7 +584,7 @@ jobs: ubuntu-22-cmake-hip: runs-on: ubuntu-22.04 - container: rocm/dev-ubuntu-22.04:6.1.2 + container: rocm/dev-ubuntu-22.04:7.2 steps: - name: Clone From 373a1c389685e40daba02405afd8764cf5847d1f Mon Sep 17 00:00:00 2001 From: "Mario Limonciello (AMD)" Date: Sat, 7 Feb 2026 09:42:12 -0600 Subject: [PATCH 4/4] Add a build target to generate ROCm artifacts using ROCm 7.2 --- .github/workflows/release.yml | 114 ++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1914c08489..344dd0dc88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -516,6 +516,118 @@ jobs: path: llama-bin-win-sycl-x64.zip name: llama-bin-win-sycl-x64.zip + ubuntu-22-rocm: + runs-on: ubuntu-22.04 + container: rocm/dev-ubuntu-22.04:7.2 + + env: + ROCM_VERSION: "7.2" + + strategy: + matrix: + include: + - build: 'x64' + name: "rocm" + gpu_targets: "gfx1151;gfx1150;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032" + + steps: + - name: Clone + id: checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Dependencies + id: depends + run: | + sudo apt-get update + sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libssl-dev rocwmma-dev + + - name: Free disk space + run: | + # Remove preinstalled SDKs and caches not needed for this job + sudo rm -rf /usr/share/dotnet || true + sudo rm -rf /usr/local/lib/android || true + sudo rm -rf /opt/ghc || true + sudo rm -rf /usr/local/.ghcup || true + sudo rm -rf /opt/hostedtoolcache || true + + # Build case pattern from GPU_TARGETS + PATTERN=$(printf '%s' "$GPU_TARGETS" | sed 's/;/\*|\*/g') + PATTERN="*${PATTERN}*" + + # Remove library files for architectures we're not building for to save disk space + echo "Cleaning up unneeded architecture files..." + cd /opt/rocm/lib/rocblas/library + # Keep only our target architectures + for file in *; do + case "$file" in + $PATTERN) + ;; + *) + sudo rm -f "$file" ;; + esac; + done + + cd /opt/rocm/lib/hipblaslt/library + for file in *; do + case "$file" in + $PATTERN) + ;; + *) + sudo rm -f "$file" ;; + esac; + done + + # Remove old package lists and caches + sudo rm -rf /var/lib/apt/lists/* || true + sudo apt clean + + - name: ccache + uses: ggml-org/ccache-action@v1.2.16 + with: + key: linux-latest-cmake-rocm-${{ env.ROCM_VERSION }}-${{ matrix.name }}-x64 + evict-old-files: 1d + + - name: Build with native CMake HIP support + id: cmake_build + run: | + cmake -B build -S . \ + -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \ + -DCMAKE_BUILD_TYPE=Release \ + -DGGML_BACKEND_DL=ON \ + -DGGML_NATIVE=OFF \ + -DGGML_CPU=OFF \ + -DAMDGPU_TARGETS="${{ matrix.gpu_targets }}" \ + -DGGML_HIP_ROCWMMA_FATTN=ON \ + -DGGML_HIP=ON \ + -DLLAMA_BUILD_BORINGSSL=ON + cmake --build build --config Release -j $(nproc) + # Create directories for ROCm libraries + mkdir -p ./build/bin/rocblas/library + mkdir -p ./build/bin/hipblaslt/library + + # Copy ROCm runtime libraries + cp /opt/rocm/lib/librocsparse.so* ./build/bin/ + cp /opt/rocm/lib/libhsa-runtime64.so* ./build/bin/ + cp /opt/rocm/lib/libamdhip64.so* ./build/bin/ + cp /opt/rocm/lib/libhipblas.so* ./build/bin/ + cp /opt/rocm/lib/libhipblaslt.so* ./build/bin/ + cp /opt/rocm/lib/librocblas.so* ./build/bin/ + cp /opt/rocm/lib/rocblas/library/* ./build/bin/rocblas/library/ + cp /opt/rocm/lib/hipblaslt/library/* ./build/bin/hipblaslt/library/ + + - name: Pack artifacts + id: pack_artifacts + run: | + tar -czvf llama-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin . + + - name: Upload artifacts + uses: actions/upload-artifact@v6 + with: + path: llama-bin-ubuntu-rocm-${{ matrix.build }}.tar.gz + name: llama-bin-ubuntu-rocm-${{ matrix.build }}.tar.gz + windows-hip: runs-on: windows-2022 @@ -784,6 +896,7 @@ jobs: - windows-cuda - windows-sycl - windows-hip + - ubuntu-22-rocm - ubuntu-22-cpu - ubuntu-22-vulkan - macOS-arm64 @@ -868,6 +981,7 @@ jobs: **Linux:** - [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz) - [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz) + - [Ubuntu x64 (ROCm)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-x64.tar.gz) - [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz) **Windows:**