Skip to content

ci: add ROCm/HIP build to menlo-build.yml (#543) #500

ci: add ROCm/HIP build to menlo-build.yml (#543)

ci: add ROCm/HIP build to menlo-build.yml (#543) #500

Workflow file for this run

name: CI
on:
push:
tags: ["b[0-9]+"]
paths:
[
".github/scripts/**",
".github/workflows/build.yml",
".github/workflows/menlo-build.yml",
"**/CMakeLists.txt",
"**/Makefile",
"menlo/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"**/*.cc",
"**/*.cxx",
"llama.cpp",
"!docs/**",
"!.gitignore",
"!README.md",
]
workflow_dispatch:
env:
VULKAN_VERSION: 1.4.328.1
ROCM_VERSION: 7.2.1
HIPSDK_INSTALLER_VERSION: "26.Q1"
jobs:
create-draft-release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.get_version.outputs.version }}
permissions:
contents: write
steps:
- name: Extract tag name
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
env:
GITHUB_REF: ${{ github.ref }}
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
name: "${{ env.VERSION }}"
draft: true
generate_release_notes: true
prerelease: false
build-and-test:
runs-on: ${{ matrix.runs-on }}
needs: [create-draft-release]
timeout-minutes: 270
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "common_cpus-x64"
runs-on: "ubuntu-22-04-cuda-12-4"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "cuda-11-common_cpus-x64"
runs-on: "ubuntu-22-04-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "cuda-12-common_cpus-x64"
runs-on: "ubuntu-22-04-cuda-12-4"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "cuda-13-common_cpus-x64"
runs-on: "ubuntu-22-04-cuda-13-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES='75;80;86;87;89;120;121' -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "vulkan-common_cpus-x64"
runs-on: "ubuntu-22-04"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_VULKAN=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: true
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "noavx-x64"
runs-on: "ubuntu-20-04"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx-x64"
runs-on: "ubuntu-20-04"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx512-x64"
runs-on: "ubuntu-20-04"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "noavx-cuda-cu11.7-x64"
runs-on: "ubuntu-20-04-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx2-cuda-cu11.7-x64"
runs-on: "ubuntu-20-04-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx-cuda-cu11.7-x64"
runs-on: "ubuntu-20-04-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx512-cuda-cu11.7-x64"
runs-on: "ubuntu-20-04-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "noavx-cuda-cu12.0-x64"
runs-on: "ubuntu-20-04-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx2-cuda-cu12.0-x64"
runs-on: "ubuntu-20-04-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx-cuda-cu12.0-x64"
runs-on: "ubuntu-20-04-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "avx512-cuda-cu12.0-x64"
runs-on: "ubuntu-20-04-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON "
run-e2e: false
vulkan: false
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "vulkan-x64"
runs-on: "ubuntu-22-04"
cmake-flags: "-DBUILD_SHARED_LIBS=ON -DGGML_VULKAN=ON -DLLAMA_CURL=OFF -DGGML_NATIVE=OFF "
run-e2e: false
vulkan: true
ccache: true
ccache-dir: "/home/runner/.ccache"
- os: "linux"
name: "hip-common_cpus-x64"
runs-on: "ubuntu-22-04"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_HIP=ON -DHIP_PLATFORM=amd -DGPU_TARGETS='gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1151;gfx1150;gfx1200;gfx1201' -DGGML_HIP_ROCWMMA_FATTN=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release'"
run-e2e: false
vulkan: false
rocm: true
ccache: true
ccache-dir: "/home/runner/.ccache"
# DEPRECATED: macos-selfhosted-12 (Intel x64) runner is being phased out.
# - os: "macos"
# name: "x64"
# runs-on: "macos-selfhosted-12"
# cmake-flags: "-DCMAKE_BUILD_RPATH=\"@loader_path\" -DGGML_METAL=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON"
# run-e2e: false
# vulkan: false
# ccache: false
# ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "macos"
name: "arm64"
runs-on: "macos-selfhosted-14-arm64"
cmake-flags: "-DCMAKE_BUILD_RPATH=\"@loader_path\" -DGGML_METAL_EMBED_LIBRARY=OFF -DBUILD_SHARED_LIBS=ON DGGML_METAL_USE_BF16=ON"
run-e2e: false
vulkan: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "noavx-cuda-cu12.0-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx2-cuda-cu12.0-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx-cuda-cu12.0-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx512-cuda-cu12.0-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "noavx-cuda-cu11.7-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx2-cuda-cu11.7-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx-cuda-cu11.7-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx512-cuda-cu11.7-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx2-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: true
vulkan: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "noavx-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DBUILD_SHARED_LIBS=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF -DGGML_NATIVE=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: true
vulkan: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "avx512-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "vulkan-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DBUILD_SHARED_LIBS=ON -DGGML_VULKAN=ON -DLLAMA_CURL=OFF -DGGML_NATIVE=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
vulkan: true
run-e2e: false
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "common_cpus-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "cuda-11-common_cpus-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "cuda-12-common_cpus-x64"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "cuda-13-common_cpus-x64"
runs-on: "windows-cuda-13-0"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DGGML_NATIVE=OFF -DCMAKE_CUDA_ARCHITECTURES='75;80;86;87;89;120;121' -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "vulkan-common_cpus-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_VULKAN=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: true
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "hip-common_cpus-x64"
runs-on: "windows-cuda-11-7"
cmake-flags: ""
run-e2e: false
vulkan: false
rocm: true
gpu-targets: "gfx1150;gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
ccache: false
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
- os: "win"
name: "arm64"
runs-on: "windows-11-arm"
cmake-flags: "-DLLAMA_CURL=OFF -DBUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DCMAKE_TOOLCHAIN_FILE='cmake/arm64-windows-llvm.cmake' -DGGML_OPENMP=OFF -DLLAMA_BUILD_SERVER=ON -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: false
vulkan: false
ccache: true
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Replace our Makefile
run: |
cat menlo/Makefile | tee Makefile
- name: use python for linux
continue-on-error: true
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install tools on Windows
if: runner.os == 'Windows'
run: |
choco install ccache awscli make ccache ninja -y
- name: Install tools on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install -y ninja-build
python3 -m pip install awscli
if [ "${{ matrix.os }}${{ matrix.name }}" == "linuxarm64" ]; then
sudo apt-get install -y ccache
exit 0
fi
cd /tmp
wget https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz
tar -xvf ccache-4.10.2-linux-x86_64.tar.xz
sudo cp ccache-4.10.2-linux-x86_64/ccache /usr/bin/ccache
ccache -V
rm -rf /tmp/ccache-4.10.2-linux-x86_64.tar.xz /tmp/ccache-4.10.2-linux-x86_64
- name: Install NCCL (Linux CUDA)
if: runner.os == 'Linux' && contains(matrix.runs-on, 'cuda')
continue-on-error: true
run: |
sudo apt-get install -y libnccl2 libnccl-dev || \
echo "::warning::libnccl-dev not available via apt; multi-GPU allreduce will fall back to the internal pipeline"
- name: Set up homebrew path on macOS
if: runner.os == 'macOS'
run: |
# Add homebrew to path
echo "/opt/homebrew/bin" >> $GITHUB_PATH
echo "/opt/homebrew/sbin" >> $GITHUB_PATH
- name: Install coreutils macos
if: runner.os == 'macOS'
run: |
brew install coreutils
- name: Prepare Vulkan SDK Linux
if: ${{ matrix.vulkan && (matrix.os == 'linux') }}
run: |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update -y
sudo apt-get install -y build-essential vulkan-sdk
- name: Prepare ROCm SDK Linux
if: ${{ matrix.rocm && (matrix.os == 'linux') }}
run: |
sudo apt-get install -y build-essential git cmake wget
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VERSION} jammy main" \
| sudo tee /etc/apt/sources.list.d/rocm.list
printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' \
| sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt-get update
sudo apt-get install -y libssl-dev rocm-hip-sdk rocwmma-dev
# HIP compiler can't be passed via cmake-flags (make would re-expand $(...)), so export it.
echo "HIPCXX=$(hipconfig -l)/clang" >> $GITHUB_ENV
echo "HIP_PATH=$(hipconfig -R)" >> $GITHUB_ENV
echo "/opt/rocm/bin" >> $GITHUB_PATH
- name: Cache ROCm install (Windows)
id: cache-rocm-win
if: ${{ matrix.rocm && (matrix.os == 'win') }}
uses: actions/cache@v4
with:
path: 'C:\Program Files\AMD\ROCm'
key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
- name: Prepare ROCm SDK Windows
if: ${{ matrix.rocm && (matrix.os == 'win') }}
run: |
# rocWMMA headers ship only in the Linux .deb; extract them for the FATTN build.
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/${env:ROCM_VERSION}/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70201-81~24.04_amd64.deb"
7z x rocwmma.deb
7z x data.tar
if ("${{ steps.cache-rocm-win.outputs.cache-hit }}" -ne "true") {
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${env:HIPSDK_INSTALLER_VERSION}-Win11-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
$proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
$completed = $proc.WaitForExit(600000)
if (-not $completed) { $proc.Kill(); throw "ROCm install timed out" }
}
$hipPath = (Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Split-Path | Split-Path)
Add-Content $env:GITHUB_ENV "HIP_PATH=$hipPath"
- name: Install Clang for Windows Arm64
if: ${{ matrix.os == 'win' && matrix.name == 'arm64' }}
run: |
choco install llvm
clang --version
- name: Prepare Vulkan SDK Windows
if: ${{ matrix.vulkan && (matrix.os == 'win') }}
continue-on-error: true
run: |
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
- name: Get Cer for code signing
if: runner.os == 'macOS'
run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
shell: bash
env:
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
- uses: apple-actions/import-codesign-certs@v2
continue-on-error: true
if: runner.os == 'macOS'
with:
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
- uses: actions/setup-dotnet@v5
if: runner.os == 'Windows'
with:
dotnet-version: "10.0.x"
- name: Add msbuild to PATH
if: runner.os == 'Windows' && !(matrix.os == 'win' && matrix.name == 'arm64')
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: MSVC dev cmd (LLVM cross x64 ARM64)
if: matrix.os == 'win' && matrix.name == 'arm64'
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64_arm64
- name: Build
id: build-and-test
if: ${{ !(matrix.os == 'win' && matrix.rocm) }}
run: |
make build-lib CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}"
- name: Build (Windows ROCm)
if: ${{ matrix.os == 'win' && matrix.rocm }}
run: |
cmake -G "Unix Makefiles" -B build -S . `
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-${env:ROCM_VERSION}/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
-DCMAKE_BUILD_TYPE=Release `
-DLLAMA_CURL=OFF `
-DLLAMA_BUILD_TESTS=OFF `
-DLLAMA_BUILD_UI=OFF `
-DGGML_BACKEND_DL=ON `
-DGGML_CPU_ALL_VARIANTS=ON `
-DGGML_NATIVE=OFF `
-DBUILD_SHARED_LIBS=ON `
-DGPU_TARGETS="${{ matrix.gpu-targets }}" `
-DGGML_HIP_ROCWMMA_FATTN=ON `
-DGGML_HIP=ON
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} --target llama-server
# Bundle ROCm runtime DLLs alongside the binaries so the artifact is self-contained.
Copy-Item "${env:HIP_PATH}\bin\hipblas.dll","${env:HIP_PATH}\bin\hipblaslt.dll","${env:HIP_PATH}\bin\rocblas.dll" build\bin\ -ErrorAction SilentlyContinue
Copy-Item "${env:HIP_PATH}\bin\rocblas\library" build\bin\rocblas\library -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item "${env:HIP_PATH}\bin\hipblaslt\library" build\bin\hipblaslt\library -Recurse -Force -ErrorAction SilentlyContinue
- uses: 1arp/create-a-file-action@0.4.5
with:
path: 'llama'
isAbsolutePath: false
file: 'version.txt'
content: |
name: ${{ matrix.os }}-${{ matrix.name }}
version: ${{needs.create-draft-release.outputs.version}}
- name: Code Signing macOS
if: runner.os == 'macOS'
run: |
make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
- name: Install Quill for notarization
if: runner.os == 'macOS'
run: |
ARCH=$(uname -m)
echo "Detected architecture: $ARCH"
if [ "$ARCH" = "arm64" ]; then
INSTALL_DIR="/opt/homebrew/bin" # Apple Silicon Macs
else
INSTALL_DIR="/usr/local/bin" # Intel Macs
fi
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b $INSTALL_DIR
quill --version
- name: Prepare notary key
if: runner.os == 'macOS'
run: |
base64 -d <<< "$NOTARIZE_P8_BASE64" > /tmp/notary-key.p8
chmod 600 /tmp/notary-key.p8
env:
NOTARIZE_P8_BASE64: ${{ secrets.NOTARIZE_P8_BASE64 }}
- name: Notarize macOS binaries
if: runner.os == 'macOS'
run: |
make notarize NOTARIZE=true QUILL_NOTARY_KEY_ID="${{ secrets.NOTARY_KEY_ID }}" QUILL_NOTARY_ISSUER="${{ secrets.NOTARY_ISSUER }}" QUILL_NOTARY_KEY="/tmp/notary-key.p8"
- name: Cleanup notary key
if: runner.os == 'macOS'
run: |
rm -f /tmp/notary-key.p8
echo "Notary key cleaned up"
- name: Code Signing Windows
if: runner.os == 'Windows'
shell: cmd
run: |
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
make codesign CODE_SIGN=true AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}"
- name: Package
run: |
cat llama/version.txt
make package
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: llama-${{ matrix.os }}-${{ matrix.name }}
path: |
./llama
- name: Calculate SHA512 Checksum (macOS)
if: runner.os == 'macOS'
run: |
sha512sum ./llama.tar.gz | awk '{ print $1 }' > sha512.txt
size=$(stat -f%z ./llama.tar.gz) # Sử dụng -f%z cho macOS
echo "checksum=$(cat sha512.txt)" >> $GITHUB_ENV
echo "size=$size" >> $GITHUB_ENV
- name: Calculate SHA512 Checksum (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
CertUtil -hashfile ./llama.tar.gz SHA512 | Select-String -Pattern "^[0-9a-fA-F]+$" | Out-File sha512.txt
$size = (Get-Item ./llama.tar.gz).length
echo "checksum=$(Get-Content sha512.txt)" >> $env:GITHUB_ENV
echo "size=$size" >> $env:GITHUB_ENV
- name: Calculate SHA512 Checksum (Linux)
if: runner.os == 'Linux'
run: |
sha512sum ./llama.tar.gz | awk '{ print $1 }' > sha512.txt
size=$(stat -c%s ./llama.tar.gz)
echo "checksum=$(cat sha512.txt)" >> $GITHUB_ENV
echo "size=$size" >> $GITHUB_ENV
## Write for matrix outputs workaround
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ github.job }}
matrix-key: ${{ matrix.os }}-${{ matrix.name }}
outputs: |-
sha512: ${{ env.checksum }}
size: ${{ env.size }}
- uses: actions/upload-release-asset@v1.0.1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./llama.tar.gz
asset_name: llama-${{ needs.create-draft-release.outputs.version }}-bin-${{ matrix.os }}-${{ matrix.name }}.tar.gz
asset_content_type: application/gzip
- name: Remove Keychain
continue-on-error: true
if: always() && runner.os == 'macOS'
run: |
security delete-keychain signing_temp.keychain
## Read matrix outputs
read:
runs-on: ubuntu-latest
needs: [build-and-test]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build-and-test
outputs:
result: "${{ steps.read.outputs.result }}"
create-checksum-file:
runs-on: ubuntu-20-04
permissions:
contents: write
needs: [read, create-draft-release]
steps:
- name: Download cuda dependencies from s3 and create checksum
run: |
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/13.0/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/12.0/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/11.7/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu11.7-x64.tar.gz
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/13.0/windows/cuda.tar.gz -O /tmp/cudart-llama-bin-win-cu13.0-x64.tar.gz
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/12.0/windows/cuda.tar.gz -O /tmp/cudart-llama-bin-win-cu12.0-x64.tar.gz
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/11.7/windows/cuda.tar.gz -O /tmp/cudart-llama-bin-win-cu11.7-x64.tar.gz
version=${{ needs.create-draft-release.outputs.version }}
outputs=${{ toJson(needs.read.outputs.result) }}
echo $outputs
echo "version: $version" > checksum.yml
echo "files:" >> checksum.yml
echo "$outputs" | jq -r --arg version "$version" '
.sha512 as $sha512 |
.size as $size |
(.sha512 | keys[]) as $key |
"- url: llama-\($version)-\($key).tar.gz\n sha512: >-\n \($sha512[$key])\n size: \($size[$key])"
' >> checksum.yml
echo "- url: cudart-llama-bin-linux-cu13.0-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz)" >> checksum.yml
echo "- url: cudart-llama-bin-linux-cu12.0-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz)" >> checksum.yml
echo "- url: cudart-llama-bin-linux-cu11.7-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-linux-cu11.7-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-linux-cu11.7-x64.tar.gz)" >> checksum.yml
echo "- url: cudart-llama-bin-win-cu11.7-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-win-cu11.7-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-win-cu11.7-x64.tar.gz)" >> checksum.yml
echo "- url: cudart-llama-bin-win-cu12.0-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-win-cu12.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-win-cu12.0-x64.tar.gz)" >> checksum.yml
echo "- url: cudart-llama-bin-win-cu13.0-x64.tar.gz" >> checksum.yml
echo " sha512: >-" >> checksum.yml
echo " $(sha512sum /tmp/cudart-llama-bin-win-cu13.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
echo " size: $(stat -c%s /tmp/cudart-llama-bin-win-cu13.0-x64.tar.gz)" >> checksum.yml
cat checksum.yml
- name: Upload checksum.yml to GitHub Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./checksum.yml
asset_name: checksum.yml
asset_content_type: text/yaml
- name: upload cudart-llama-bin-linux-cu13.0-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz
asset_name: cudart-llama-bin-linux-cu13.0-x64.tar.gz
asset_content_type: application/gzip
- name: upload cudart-llama-bin-linux-cu12.0-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz
asset_name: cudart-llama-bin-linux-cu12.0-x64.tar.gz
asset_content_type: application/gzip
- name: upload cudart-llama-bin-linux-cu11.7-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-linux-cu11.7-x64.tar.gz
asset_name: cudart-llama-bin-linux-cu11.7-x64.tar.gz
asset_content_type: application/gzip
- name: upload cudart-llama-bin-win-cu13.0-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-win-cu13.0-x64.tar.gz
asset_name: cudart-llama-bin-win-cu13.0-x64.tar.gz
asset_content_type: application/gzip
- name: upload cudart-llama-bin-win-cu12.0-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-win-cu12.0-x64.tar.gz
asset_name: cudart-llama-bin-win-cu12.0-x64.tar.gz
asset_content_type: application/gzip
- name: upload cudart-llama-bin-win-cu11.7-x64.tar.gz to Github Release
uses: actions/upload-release-asset@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: /tmp/cudart-llama-bin-win-cu11.7-x64.tar.gz
asset_name: cudart-llama-bin-win-cu11.7-x64.tar.gz
asset_content_type: application/gzip