ci : Restore ROCm job for Ubuntu (#27399)

* Revert "ci : disable ubuntu-rocm (#26969)"

This reverts commit 9558fa44c9.

* ci: set ccache compiler_check=content for ROCm build

The ROCm toolchain is pip-installed fresh on every run, so the clang binary's
mtime changes each time. With ccache's default compiler_check=mtime that
invalidates the whole cache and warm builds only reached ~70% hits. Hash the
compiler contents instead so the cache survives toolchain reinstalls.

* Update ccache size to 1GB

We're waivering with so many architectures built, we need a bigger
ccache limit.

* merge fix

---------

Co-authored-by: Jim Wu <ywu@xilinx.com>
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
This commit is contained in:
Mario Limonciello
2026-08-22 13:28:30 +03:00
committed by GitHub
co-authored by Jim Wu Sigbjørn Skjæret
parent 2115b73d8e
commit e85caa81ea
+112 -100
View File
@@ -774,6 +774,7 @@ jobs:
with: with:
key: windows-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} key: windows-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}
evict-old-files: 1d evict-old-files: 1d
max-size: "1G"
# - name: Cache ROCm Installation # - name: Cache ROCm Installation
# id: cache-rocm # id: cache-rocm
@@ -1286,123 +1287,134 @@ jobs:
with: with:
key: release-ubuntu-24.04-sycl-${{ matrix.build }} key: release-ubuntu-24.04-sycl-${{ matrix.build }}
# ubuntu-22-rocm: ubuntu-22-rocm:
# needs: [check-release, get-version] needs: [check-release, get-version]
# if: ${{ needs.check-release.outputs.should_release == 'true' }} if: ${{ needs.check-release.outputs.should_release == 'true' }}
# runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
# permissions: permissions:
# actions: write actions: write
# strategy: strategy:
# matrix: matrix:
# include: include:
# - ROCM_VERSION: "7.14.0" - ROCM_VERSION: "7.14.0"
# gpu_targets: "gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201" gpu_targets: "gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201"
# build: 'x64' build: 'x64'
# steps: steps:
# - name: Clone - name: Clone
# id: checkout id: checkout
# uses: actions/checkout@v6 uses: actions/checkout@v6
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Setup Node.js - name: Setup Node.js
# uses: actions/setup-node@v6 uses: actions/setup-node@v6
# with: with:
# node-version: "24" node-version: "24"
# cache: "npm" cache: "npm"
# cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
# - name: Free up disk space - name: Free up disk space
# uses: ggml-org/free-disk-space@v1.3.1 uses: ggml-org/free-disk-space@v1.3.1
# with: with:
# tool-cache: true tool-cache: true
# # - name: ccache - name: ccache
# # uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
# # with: with:
# # key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }} key: release-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}
evict-old-files: 1d
max-size: "1G"
# - name: Dependencies - name: Tune ccache for reinstalled ROCm toolchain
# id: depends run: |
# run: | # ROCm is pip-installed fresh each run, so the clang binary's mtime
# sudo apt install -y build-essential git cmake wget # changes every time. With the default compiler_check=mtime that
# invalidates the cache; hash compiler contents instead so warm
# builds hit.
ccache --set-config=compiler_check=content
ccache --set-config=sloppiness=time_macros,include_file_mtime,include_file_ctime
# - name: Setup TheRock with Wheels - name: Dependencies
# id: therock_env id: depends
# run: | run: |
# # Create Python virtual environment sudo apt install -y build-essential git cmake wget
# python3 -m venv .venv
# source .venv/bin/activate
# # Install ROCm wheels for build - name: Setup TheRock with Wheels
# # libraries = HIP runtime and CMake configs needed for linking id: therock_env
# # devel = compilers, headers, static libs run: |
# python -m pip install --upgrade pip # Create Python virtual environment
# python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,devel]==${{ matrix.ROCM_VERSION }}" python3 -m venv .venv
source .venv/bin/activate
# # Get ROCm installation paths using the rocm-sdk CLI tool # Install ROCm wheels for build
# ROCM_PATH=$(rocm-sdk path --root) # libraries = HIP runtime and CMake configs needed for linking
# CMAKE_PATH=$(rocm-sdk path --cmake) # devel = compilers, headers, static libs
# BIN_PATH=$(rocm-sdk path --bin) python -m pip install --upgrade pip
# echo "ROCM_PATH=$ROCM_PATH" python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,devel]==${{ matrix.ROCM_VERSION }}"
# echo "CMAKE_PATH=$CMAKE_PATH"
# echo "BIN_PATH=$BIN_PATH"
# # Set environment variables # Get ROCm installation paths using the rocm-sdk CLI tool
# echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV ROCM_PATH=$(rocm-sdk path --root)
# echo "CMAKE_PREFIX_PATH=$CMAKE_PATH" >> $GITHUB_ENV CMAKE_PATH=$(rocm-sdk path --cmake)
# echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV BIN_PATH=$(rocm-sdk path --bin)
# echo "PATH=$BIN_PATH:${PATH}" >> $GITHUB_ENV echo "ROCM_PATH=$ROCM_PATH"
# echo "LD_LIBRARY_PATH=$ROCM_PATH/lib:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV echo "CMAKE_PATH=$CMAKE_PATH"
echo "BIN_PATH=$BIN_PATH"
# # Keep venv activated for subsequent steps # Set environment variables
# echo "$(pwd)/.venv/bin" >> $GITHUB_PATH echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$CMAKE_PATH" >> $GITHUB_ENV
echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV
echo "PATH=$BIN_PATH:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$ROCM_PATH/lib:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV
# - name: Build with native CMake HIP support # Keep venv activated for subsequent steps
# id: cmake_build echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
# run: |
# cmake -B build -S . \
# -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
# -DCMAKE_BUILD_TYPE=Release \
# -DGGML_BACKEND_DL=ON \
# -DGGML_NATIVE=OFF \
# -DCMAKE_INSTALL_RPATH='$ORIGIN' \
# -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
# -DGGML_CPU_ALL_VARIANTS=ON \
# -DGPU_TARGETS="${{ matrix.gpu_targets }}" \
# -DGGML_HIP=ON \
# -DHIP_PLATFORM=amd \
# -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
# ${{ env.CMAKE_ARGS }}
# cmake --build build --config Release -j $(nproc)
# - name: Determine tag name - name: Build with native CMake HIP support
# id: tag id: cmake_build
# uses: ./.github/actions/get-tag-name run: |
cmake -B build -S . \
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_BACKEND_DL=ON \
-DGGML_NATIVE=OFF \
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DGGML_CPU_ALL_VARIANTS=ON \
-DGPU_TARGETS="${{ matrix.gpu_targets }}" \
-DGGML_HIP=ON \
-DHIP_PLATFORM=amd \
-DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc)
# - name: Get ROCm short version - name: Determine tag name
# run: echo "ROCM_VERSION_SHORT=$(echo '${{ matrix.ROCM_VERSION }}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV id: tag
uses: ./.github/actions/get-tag-name
# - name: Pack artifacts - name: Get ROCm short version
# id: pack_artifacts run: echo "ROCM_VERSION_SHORT=$(echo '${{ matrix.ROCM_VERSION }}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV
# run: |
# cp LICENSE ./build/bin/
# tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
# - name: Upload artifacts - name: Pack artifacts
# uses: actions/upload-artifact@v6 id: pack_artifacts
# with: run: |
# path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz cp LICENSE ./build/bin/
# name: llama-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
# # - name: ccache-clear - name: Upload artifacts
# # uses: ./.github/actions/ccache-clear uses: actions/upload-artifact@v6
# # with: with:
# # key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }} path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz
name: llama-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}
ios-xcode: ios-xcode:
needs: [check-release, get-version] needs: [check-release, get-version]
@@ -1583,7 +1595,7 @@ jobs:
- windows-sycl - windows-sycl
- windows-rocm - windows-rocm
- windows-openvino - windows-openvino
#- ubuntu-22-rocm - ubuntu-22-rocm
- ubuntu-cpu - ubuntu-cpu
- ubuntu-vulkan - ubuntu-vulkan
- ubuntu-24-openvino - ubuntu-24-openvino
@@ -1714,7 +1726,7 @@ jobs:
- [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) - [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)
- [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 (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 arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-arm64.tar.gz) - [Ubuntu arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-arm64.tar.gz)
- Ubuntu x64 (ROCm 7.14)[DISABLED](https://github.com/ggml-org/llama.cpp/pull/26969) - [Ubuntu x64 (ROCm 7.14)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.14-x64.tar.gz)
- [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz) - [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz)
- [Ubuntu x64 (SYCL FP32)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp32-x64.tar.gz) - [Ubuntu x64 (SYCL FP32)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp32-x64.tar.gz)
- [Ubuntu x64 (SYCL FP16)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp16-x64.tar.gz) - [Ubuntu x64 (SYCL FP16)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp16-x64.tar.gz)