> $GITHUB_ENV
- echo "$REQUESTS_PROCESSING" >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
-
- - name: Extract image url
- id: extract_image_url
- continue-on-error: true
- run: |
- set -eux
-
- echo "IMAGE_O=${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[0] }}" >> $GITHUB_ENV
- echo "IMAGE_1=${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[1] }}" >> $GITHUB_ENV
- echo "IMAGE_2=${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[2] }}" >> $GITHUB_ENV
- echo "IMAGE_3=${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[3] }}" >> $GITHUB_ENV
-
- - name: Comment PR
- uses: mshick/add-pr-comment@v2
- id: comment_pr
- if: ${{ github.event.pull_request != '' && matrix.pr_comment_enabled == 'true' }}
- with:
- message-id: bench-server-${{ github.job }}-${{ env.RUNNER_LABEL }}-${{ matrix.model }}-${{ matrix.ftype }}
- message: |
-
-
- 📈 **llama.cpp server** for _${{ github.job }}_ on _${{ env.RUNNER_LABEL }}_ for `${{ matrix.model }}`-`${{ matrix.ftype }}`: **${{ env.BENCH_ITERATIONS}} iterations** 🚀
-
-
-
-
-
- Expand details for performance related PR only
-
- - Concurrent users: ${{ env.N_USERS }}, duration: ${{ github.event.inputs.duration || env.DURATION }}
- - HTTP request : avg=${{ env.HTTP_REQ_DURATION_AVG }}ms p(95)=${{ env.HTTP_REQ_DURATION_P_95_ }}ms fails=${{ env.HTTP_REQ_FAILED_PASSES }}, finish reason: stop=${{ env.LLAMACPP_COMPLETIONS_STOP_RATE_PASSES }} truncated=${{ env.LLAMACPP_COMPLETIONS_TRUNCATED_RATE_PASSES }}
- - Prompt processing (pp): avg=${{ env.LLAMACPP_PROMPT_PROCESSING_SECOND_AVG }}tk/s p(95)=${{ env.LLAMACPP_PROMPT_PROCESSING_SECOND_P_95_ }}tk/s
- - Token generation (tg): avg=${{ env.LLAMACPP_TOKENS_SECOND_AVG }}tk/s p(95)=${{ env.LLAMACPP_TOKENS_SECOND_P_95_ }}tk/s
- - ${{ env.BENCH_GRAPH_XLABEL }}
-
-
-
-
-
-
-
-
- More
-
- ```mermaid
- ${{ env.PROMPT_TOKENS_SECONDS }}
- ```
-
-
-
-
-
-
- More
-
- ```mermaid
- ${{ env.PREDICTED_TOKENS_SECONDS }}
- ```
-
-
-
-
-
-
-
- Details
-
-
-
-
-
-
- More
-
- ```mermaid
- ${{ env.KV_CACHE_USAGE_RATIO }}
- ```
-
-
-
-
-
-
- More
-
- ```mermaid
- ${{ env.REQUESTS_PROCESSING }}
- ```
-
-
-
-
-
-
diff --git a/.github/workflows/build-3rd-party.yml b/.github/workflows/build-3rd-party.yml
deleted file mode 100644
index 82e53db..0000000
--- a/.github/workflows/build-3rd-party.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-name: CI (3rd-party)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-3rd-party.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-24-llguidance:
- runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_LLGUIDANCE=ON
- cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
diff --git a/.github/workflows/build-and-test-snapdragon.yml b/.github/workflows/build-and-test-snapdragon.yml
deleted file mode 100644
index 3e857d4..0000000
--- a/.github/workflows/build-and-test-snapdragon.yml
+++ /dev/null
@@ -1,148 +0,0 @@
-name: CI (snapdragon)
-
-on:
- workflow_dispatch:
- push:
- branches:
- - master
- paths:
- - '.github/workflows/build-and-test-snapdragon.yml'
- - 'ggml/include/ggml-hexagon.h'
- - 'ggml/src/ggml-hexagon/**'
- - 'docs/backend/snapdragon/**'
- - 'scripts/snapdragon/**'
- - 'CMakePresets.json'
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths:
- - '.github/workflows/build-and-test-snapdragon.yml'
- - 'ggml/include/ggml-hexagon.h'
- - 'ggml/src/ggml-hexagon/**'
- - 'docs/backend/snapdragon/**'
- - 'scripts/snapdragon/**'
- - 'CMakePresets.json'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- android-ndk-snapdragon:
- runs-on: ubuntu-latest
- container:
- image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.7'
- defaults:
- run:
- shell: bash
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- lfs: false
-
- - name: Build Llama.CPP for Snapdragon Android
- id: build_llama_cpp_snapdragon_android
- run: |
- cp docs/backend/snapdragon/CMakeUserPresets.json .
- cmake --preset arm64-android-snapdragon-release -B build
- cmake --build build
- cmake --install build --prefix pkg-snapdragon/llama.cpp
-
- - name: Upload Llama.CPP Snapdragon Android Build Artifact
- if: ${{ always() && steps.build_llama_cpp_snapdragon_android.outcome == 'success' }}
- uses: actions/upload-artifact@v6
- with:
- name: llama-cpp-android-arm64-snapdragon
- path: pkg-snapdragon/llama.cpp
-
- linux-iot-snapdragon:
- runs-on: ubuntu-latest
- container:
- image: 'ghcr.io/snapdragon-toolchain/arm64-linux:v0.7'
- defaults:
- run:
- shell: bash
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- lfs: false
-
- - name: Build Llama.CPP for Snapdragon Linux IoT
- id: build_llama_cpp_snapdragon_linux
- run: |
- cp docs/backend/snapdragon/CMakeUserPresets.json .
- cmake --preset arm64-linux-snapdragon-release -B build-snapdragon -DGGML_OPENCL=ON
- cmake --build build-snapdragon -j $(nproc)
- cmake --install build-snapdragon --prefix pkg-snapdragon/llama.cpp
-
- - name: Upload Llama.CPP Snapdragon Linux IoT Build Artifact
- if: ${{ always() && steps.build_llama_cpp_snapdragon_linux.outcome == 'success' }}
- uses: actions/upload-artifact@v6
- with:
- name: llama-cpp-linux-arm64-snapdragon
- path: pkg-snapdragon/llama.cpp
-
- test-snapdragon-qdc:
- name: Test on QDC Device (${{ matrix.device }})
- needs: [android-ndk-snapdragon, linux-iot-snapdragon]
- runs-on: ubuntu-24.04-arm
- timeout-minutes: 90
- strategy:
- fail-fast: false
- matrix:
- device: [SM8750, SM8850, QCS9075M]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v6
-
- - name: Download build artifact
- uses: actions/download-artifact@v7
- with:
- name: ${{ startsWith(matrix.device, 'QCS') && 'llama-cpp-linux-arm64-snapdragon' || 'llama-cpp-android-arm64-snapdragon' }}
- path: pkg-snapdragon/llama.cpp
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.x'
- cache: pip
-
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y curl unzip
-
- - name: Install QDC SDK wheel
- run: |
- curl -fSL -o qdc_sdk.zip https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Device_Cloud_SDK/All/0.2.3/qualcomm_device_cloud_sdk-0.2.3.zip
- unzip qdc_sdk.zip -d qdc_sdk
- pip install qdc_sdk/qualcomm_device_cloud_sdk-0.2.3-py3-none-any.whl
-
- - name: Check QDC API key
- id: check_secret
- env:
- QDC_API_KEY: ${{ secrets.QDC_API_KEY }}
- run: echo "has-qdc-key=${{ env.QDC_API_KEY != '' }}" >> "$GITHUB_OUTPUT"
-
- - name: Run QDC tests (${{ matrix.device }})
- if: steps.check_secret.outputs.has-qdc-key == 'true'
- run: |
- python scripts/snapdragon/qdc/run_qdc_jobs.py \
- --test all \
- --pkg-dir pkg-snapdragon/llama.cpp \
- --model-url "https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_0.gguf" \
- --device ${{ matrix.device }} \
- ${{ startsWith(matrix.device, 'QCS') && '--retries 2 --retry-delay 300' || '' }}
- env:
- QDC_API_KEY: ${{ secrets.QDC_API_KEY }}
-
- - name: Cleanup
- if: always()
- run: rm -rf pkg-snapdragon qdc_sdk qdc_sdk.zip
diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml
deleted file mode 100644
index a05248e..0000000
--- a/.github/workflows/build-android.yml
+++ /dev/null
@@ -1,149 +0,0 @@
-name: CI (android)
-
-on:
- workflow_dispatch:
- push:
- branches:
- - master
- paths:
- - '.github/workflows/build-android.yml'
- - '**/CMakeLists.txt'
- - '**/.cmake'
- - '**/*.h'
- - '**/*.hpp'
- - '**/*.c'
- - '**/*.cpp'
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths:
- - '.github/workflows/build-android.yml'
- - 'examples/llama.android/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- default:
- runs-on: ubuntu-latest
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- lfs: false
-
- - name: Set up JDK
- uses: actions/setup-java@v5
- with:
- java-version: 17
- distribution: zulu
-
- - name: Setup Android SDK
- uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
- with:
- log-accepted-android-sdk-licenses: false
-
- - name: Build
- run: |
- cd examples/llama.android
- ./gradlew build --no-daemon
-
- ndk:
- runs-on: ubuntu-latest
- container:
- image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.3'
- defaults:
- run:
- shell: bash
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- lfs: false
-
- - name: Dependencies
- run: |
- apt-get update
- apt-get install -y build-essential
-
- - name: Build
- id: ndk_build
- run: |
- cmake -D ANDROID_ABI=arm64-v8a -D ANDROID_PLATFORM=android-31 -D CMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -D GGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm -G Ninja -D LLAMA_OPENSSL=OFF -D GGML_OPENMP=OFF -B build
- cmake --build build
- cmake --install build --prefix pkg-adb/llama.cpp
-
- - name: Upload Android Build Artifact
- if: ${{ always() && steps.ndk_build.outcome == 'success' }}
- uses: actions/upload-artifact@v6
- with:
- name: llama-cpp-android-arm64-cpu
- path: pkg-adb/llama.cpp
-
- arm64:
- runs-on: ubuntu-latest
-
- env:
- NDK_VERSION: "29.0.14206865"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789)
- # for some reason, the ccache does not improve the build time in this case
- # example:
- # cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831
- # cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394
- #
- #- name: ccache
- # uses: ggml-org/ccache-action@v1.2.21
- # with:
- # key: android-ubuntu-arm64
- # evict-old-files: 1d
- # save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Set up JDK
- uses: actions/setup-java@v5
- with:
- java-version: 17
- distribution: temurin
-
- - name: Setup Android SDK
- uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
- with:
- log-accepted-android-sdk-licenses: false
-
- - name: Install NDK
- run: |
- sdkmanager "ndk;${{ env.NDK_VERSION }}"
- echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
- -DANDROID_ABI=arm64-v8a \
- -DANDROID_PLATFORM=android-28 \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DGGML_BACKEND_DL=ON \
- -DGGML_NATIVE=OFF \
- -DGGML_CPU_ALL_VARIANTS=ON \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(nproc)
diff --git a/.github/workflows/build-apple.yml b/.github/workflows/build-apple.yml
deleted file mode 100644
index 2b3d14d..0000000
--- a/.github/workflows/build-apple.yml
+++ /dev/null
@@ -1,268 +0,0 @@
-name: CI (apple)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-apple.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.swift',
- '**/*.m',
- '**/*.metal'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-apple.yml',
- 'ggml/src/ggml-metal/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- macos-latest-arm64:
- runs-on: macos-latest
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: apple-arm64
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build \
- -DCMAKE_BUILD_RPATH="@loader_path" \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=OFF \
- -DGGML_METAL_SHADER_DEBUG=ON \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
- leaks -atExit -- ./build/bin/test-thread-safety -hf ggml-org/gemma-3-270m-qat-GGUF -ngl 99 -p "$(printf 'hello %.0s' {1..128})" -n 16 -c 512 -ub 32 -np 2 -t 2 -lv 1
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main -E "test-llama-archs" --verbose --timeout 900
-
- macos-latest-x64:
- runs-on: macos-15-intel
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: apple-x64
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- # Metal is disabled due to intermittent failures with Github runners not having a GPU:
- # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
- cmake -B build \
- -DCMAKE_BUILD_RPATH="@loader_path" \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DGGML_METAL=OFF \
- -DGGML_RPC=ON \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3
- time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- macos-latest-ios-xcode:
- runs-on: macos-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - name: Setup Xcode
- uses: ggml-org/setup-xcode@v1
- with:
- xcode-version: latest-stable
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build -G Xcode \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=ON \
- -DLLAMA_OPENSSL=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_SERVER=OFF \
- -DCMAKE_SYSTEM_NAME=iOS \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
-
- - name: xcodebuild for swift package
- id: xcodebuild
- run: |
- ./build-xcframework.sh
-
- - name: Upload xcframework artifact
- uses: actions/upload-artifact@v6
- with:
- name: llama-xcframework
- path: build-apple/llama.xcframework/
- retention-days: 1
-
- - name: Build Xcode project
- run: |
- xcodebuild -downloadPlatform iOS
- xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
-
- macos-latest-tvos:
- runs-on: macos-latest
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # TODO: this likely does not do anything - if yes, remove it
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: apple-tvos
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build -G Xcode \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=ON \
- -DLLAMA_BUILD_COMMON=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_SERVER=OFF \
- -DCMAKE_SYSTEM_NAME=tvOS \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
-
- macos-latest-visionos:
- runs-on: macos-latest
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # TODO: this likely does not do anything - if yes, remove it
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: apple-visionos
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build -G Xcode \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=ON \
- -DLLAMA_BUILD_COMMON=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_SERVER=OFF \
- -DCMAKE_SYSTEM_NAME=visionOS \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
-
- macos-latest-swift:
- runs-on: macos-latest
- needs: macos-latest-ios-xcode
-
- strategy:
- matrix:
- destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # TODO: this likely does not do anything - if yes, remove it
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: apple-swift
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Download xcframework artifact
- uses: actions/download-artifact@v7
- with:
- name: llama-xcframework
- path: build-apple/llama.xcframework/
-
- - name: Build llama.cpp with CMake
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build -G Xcode \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=ON \
- -DLLAMA_OPENSSL=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_SERVER=OFF \
- -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml
deleted file mode 100644
index 327f719..0000000
--- a/.github/workflows/build-cache.yml
+++ /dev/null
@@ -1,145 +0,0 @@
-name: Build Actions Cache
-
-on:
- workflow_dispatch: # allows manual triggering
- schedule:
- - cron: '0 * * * *'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- ubuntu-24-vulkan-cache:
- runs-on: ubuntu-24.04
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Get latest Vulkan SDK version
- id: vulkan_sdk_version
- run: |
- echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-sdk
- with:
- path: ./vulkan_sdk
- key: cache-gha-vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
-
- - name: Setup Vulkan SDK
- if: steps.cache-sdk.outputs.cache-hit != 'true'
- uses: ./.github/actions/linux-setup-vulkan
- with:
- path: ./vulkan_sdk
- version: ${{ env.VULKAN_SDK_VERSION }}
-
- #ubuntu-24-spacemit-cache:
- # runs-on: ubuntu-24.04
-
- # env:
- # # Make sure this is in sync with build-linux-cross.yml
- # SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
-
- # steps:
- # - name: Clone
- # id: checkout
- # uses: actions/checkout@v6
-
- # - name: Setup Cache
- # uses: actions/cache@v5
- # id: cache-toolchain
- # with:
- # path: ./spacemit_toolchain
- # key: cache-gha-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
-
- # - name: Setup SpacemiT Toolchain
- # if: steps.cache-toolchain.outputs.cache-hit != 'true'
- # uses: ./.github/actions/linux-setup-spacemit
- # with:
- # path: ./spacemit_toolchain
- # version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
-
- ubuntu-24-openvino-cache:
- runs-on: ubuntu-24.04
-
- env:
- # Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-openvino
- with:
- path: ./openvino_toolkit
- key: cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
-
- - name: Setup OpenVINO Toolkit
- if: steps.cache-openvino.outputs.cache-hit != 'true'
- uses: ./.github/actions/linux-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- windows-2022-openvino-cache:
- runs-on: windows-2022
-
- env:
- # Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-openvino
- with:
- path: ./openvino_toolkit
- key: cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
-
- - name: Setup OpenVINO Toolkit
- if: steps.cache-openvino.outputs.cache-hit != 'true'
- uses: ./.github/actions/windows-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- windows-2022-rocm-cache:
- runs-on: windows-2022
-
- env:
- # Make sure this is in sync with build.yml
- HIPSDK_INSTALLER_VERSION: "26.Q1"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-rocm
- with:
- path: C:\Program Files\AMD\ROCm
- key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
-
- - name: Setup ROCm
- if: steps.cache-rocm.outputs.cache-hit != 'true'
- uses: ./.github/actions/windows-setup-rocm
- with:
- version: ${{ env.HIPSDK_INSTALLER_VERSION }}
diff --git a/.github/workflows/build-cann.yml b/.github/workflows/build-cann.yml
deleted file mode 100644
index 6d76ed4..0000000
--- a/.github/workflows/build-cann.yml
+++ /dev/null
@@ -1,104 +0,0 @@
-name: CI (cann)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-cann.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-cann.yml',
- 'ggml/src/ggml-cann/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
-# TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23705)
-# in order to enable it again, we have to provision dedicated runners to run it
-# openEuler-latest-cann:
-# defaults:
-# run:
-# shell: bash -el {0}
-# strategy:
-# matrix:
-# arch: [x86, aarch64]
-# chip_type: ['910b', '310p']
-# build: ['Release']
-# use_acl_graph: ['on', 'off']
-# exclude:
-# # 310P does not support USE_ACL_GRAPH=on
-# - chip_type: '310p'
-# use_acl_graph: 'on'
-# runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v6
-# with:
-# fetch-depth: 0
-#
-# - name: Free up disk space
-# uses: ggml-org/free-disk-space@v1.3.1
-# with:
-# tool-cache: true
-#
-# - name: Set container image
-# id: cann-image
-# run: |
-# image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.5.0-910b-openeuler24.03-py3.11' || '8.5.0-310p-openeuler24.03-py3.11' }}"
-# echo "image=${image}" >> "${GITHUB_OUTPUT}"
-#
-# - name: Pull container image
-# run: docker pull "${{ steps.cann-image.outputs.image }}"
-#
-# - name: Build
-# env:
-# BUILD_TYPE: ${{ matrix.build }}
-# SOC_TYPE: ascend${{ matrix.chip_type }}
-# USE_ACL_GRAPH: ${{ matrix.use_acl_graph }}
-# run: |
-# HOST_UID=$(id -u)
-# HOST_GID=$(id -g)
-#
-# docker run --rm \
-# -v "${PWD}:/workspace" \
-# -w /workspace \
-# -e SOC_TYPE=${SOC_TYPE} \
-# -e BUILD_TYPE=${BUILD_TYPE} \
-# -e USE_ACL_GRAPH=${USE_ACL_GRAPH} \
-# "${{ steps.cann-image.outputs.image }}" \
-# bash -lc '
-# set -e
-# yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake openssl-devel
-# yum clean all && rm -rf /var/cache/yum
-# git config --global --add safe.directory "/workspace"
-# export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
-# cmake -S . -B build \
-# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-# -DGGML_CANN=on \
-# -DSOC_TYPE=${SOC_TYPE} \
-# -DUSE_ACL_GRAPH=${USE_ACL_GRAPH}
-# cmake --build build -j $(nproc)
-#
-# chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build
-# '
diff --git a/.github/workflows/build-cmake-pkg.yml b/.github/workflows/build-cmake-pkg.yml
deleted file mode 100644
index 5becff0..0000000
--- a/.github/workflows/build-cmake-pkg.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: Build relocatable cmake package
-on:
- workflow_dispatch:
- workflow_call:
-
-jobs:
- linux:
- runs-on: [self-hosted, Linux, CPU]
- steps:
- - uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Build
- run: |
- PREFIX="$(pwd)"/inst
- cmake -S . -B build \
- -DCMAKE_PREFIX_PATH="$PREFIX" \
- -DLLAMA_OPENSSL=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DCMAKE_BUILD_TYPE=Release
- cmake --build build --config Release
- cmake --install build --prefix "$PREFIX" --config Release
-
- export LLAMA_CONFIG="$PREFIX"/lib/cmake/llama/llama-config.cmake
- tclsh <<'EOF'
- set build(commit) [string trim [exec git rev-parse --short HEAD]]
- set build(number) [string trim [exec git rev-list --count HEAD]]
- set build(version) "0.0.$build(number)"
-
- set llamaconfig [read [open "$env(LLAMA_CONFIG)" r]]
- set checks [list "set\\(LLAMA_VERSION \\s+$build(version)\\)" \
- "set\\(LLAMA_BUILD_COMMIT\\s+$build(commit)\\)" \
- "set\\(LLAMA_BUILD_NUMBER\\s+$build(number)\\)"]
-
- puts -nonewline "Checking llama-config.cmake version... "
- foreach check $checks {
- if {![regexp -expanded -- $check $llamaconfig]} {
- puts "\"$check\" failed!"
- exit 1
- }
- }
- puts "success."
- EOF
-
- cd examples/simple-cmake-pkg
- cmake -S . -B build -DCMAKE_PREFIX_PATH="$PREFIX"/lib/cmake
- cmake --build build
diff --git a/.github/workflows/build-cpu.yml b/.github/workflows/build-cpu.yml
deleted file mode 100644
index 8f62e1a..0000000
--- a/.github/workflows/build-cpu.yml
+++ /dev/null
@@ -1,215 +0,0 @@
-name: CI (cpu)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-cpu.yml',
- '.github/workflows/build-cmake-pkg.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-cpu.yml',
- '.github/workflows/build-cmake-pkg.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- build-cmake-pkg:
- uses: ./.github/workflows/build-cmake-pkg.yml
-
- ubuntu:
- strategy:
- matrix:
- include:
- - build: 'x64'
- os: ubuntu-22.04
- - build: 'arm64'
- os: ubuntu-24.04-arm
-
- runs-on: ${{ matrix.os }}
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: cpu-${{ matrix.os }}
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build Dependencies
- id: build_depends
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- python3 python3-pip python3-dev python3-wheel \
- libjpeg-dev build-essential libssl-dev \
- git-lfs
-
- - name: Toolchain workaround (GCC 14)
- if: ${{ contains(matrix.os, 'ubuntu-24.04') }}
- run: |
- sudo apt-get install -y gcc-14 g++-14
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
-
- - name: Python Dependencies
- id: python_depends
- run: |
- export PIP_BREAK_SYSTEM_PACKAGES="1"
- python3 -m pip install --upgrade pip setuptools
- pip3 install ./gguf-py
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- - name: Test llama2c conversion
- id: llama2c_test
- run: |
- cd build
- echo "Fetch tokenizer"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
- echo "Fetch llama2c model"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
- ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
- ./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
-
- windows:
- runs-on: windows-2025
-
- env:
- OPENBLAS_VERSION: 0.3.23
- SDE_VERSION: 9.33.0-2024-01-07
- VULKAN_VERSION: 1.4.313.2
-
- strategy:
- matrix:
- include:
- - build: 'x64-cpu-static'
- arch: 'x64'
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF'
- - build: 'x64-openblas'
- arch: 'x64'
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
- - build: 'x64-vulkan'
- arch: 'x64'
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
- - build: 'arm64'
- arch: 'arm64'
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: cpu-windows-2025-${{ matrix.build }}
- variant: ccache
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Download OpenBLAS
- id: get_openblas
- if: ${{ matrix.build == 'x64-openblas' }}
- run: |
- curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}/OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip"
- curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
- mkdir $env:RUNNER_TEMP/openblas
- tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
- $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
- $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
- $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
- & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
-
- - name: Install Vulkan SDK
- id: get_vulkan
- if: ${{ matrix.build == 'x64-vulkan' }}
- 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: Install Ninja
- id: install_ninja
- run: |
- choco install ninja
-
- - name: Build
- id: cmake_build
- run: |
- cmake -S . -B build ${{ matrix.defines }} `
- -DLLAMA_BUILD_BORINGSSL=ON
- cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
-
- - name: Add libopenblas.dll
- id: add_libopenblas_dll
- if: ${{ matrix.build == 'x64-openblas' }}
- run: |
- cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
- cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
-
- - name: Test
- id: cmake_test
- if: ${{ matrix.arch == 'x64' }}
- run: |
- cd build
- ctest -L main -C Release --verbose --timeout 900
-
- # TODO: disabled for now, consider adding tests for all CPU variants instead
- # - name: Test (Intel SDE)
- # id: cmake_test_sde
- # if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
- # run: |
- # curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
- # # for some weird reason windows tar doesn't like sde tar.xz
- # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
- # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
- # $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
- # cd build
- # $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
- # & $sde -future -- ctest -L main -C Release --verbose --timeout 900
diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml
deleted file mode 100644
index eef78b6..0000000
--- a/.github/workflows/build-cross.yml
+++ /dev/null
@@ -1,317 +0,0 @@
-name: CI (cross)
-on:
- # only manual triggers due to low-importance of the workflows
- # TODO: for regular runs, provision dedicated self-hosted runners
- workflow_dispatch:
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-cross.yml',
- 'ggml/src/spacemit/*',
- 'ggml/src/arch/loongarch/*'
- ]
- # run once every week
- schedule:
- - cron: '0 0 * * 0'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-
-jobs:
- # ubuntu-24-riscv64-cpu-cross:
- # runs-on: ubuntu-24.04
-
- # steps:
- # - uses: actions/checkout@v6
- # - name: Setup Riscv
- # run: |
- # sudo dpkg --add-architecture riscv64
-
- # # Add arch-specific repositories for non-amd64 architectures
- # cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
- # EOF
-
- # sudo apt-get update || true ;# Prevent failure due to missing URLs.
-
- # sudo apt-get install -y --no-install-recommends \
- # build-essential \
- # gcc-14-riscv64-linux-gnu \
- # g++-14-riscv64-linux-gnu
-
- # - name: Build
- # run: |
- # cmake -B build -DLLAMA_OPENSSL=OFF \
- # -DCMAKE_BUILD_TYPE=Release \
- # -DGGML_OPENMP=OFF \
- # -DLLAMA_BUILD_EXAMPLES=ON \
- # -DLLAMA_BUILD_TOOLS=ON \
- # -DLLAMA_BUILD_TESTS=OFF \
- # -DCMAKE_SYSTEM_NAME=Linux \
- # -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
- # -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
- # -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
- # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- # -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
- # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-
- # cmake --build build --config Release -j $(nproc)
-
- # ubuntu-24-riscv64-vulkan-cross:
- # runs-on: ubuntu-24.04
-
- # steps:
- # - uses: actions/checkout@v6
- # - name: Setup Riscv
- # run: |
- # sudo dpkg --add-architecture riscv64
-
- # # Add arch-specific repositories for non-amd64 architectures
- # cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
- # deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
- # EOF
-
- # sudo apt-get update || true ;# Prevent failure due to missing URLs.
-
- # sudo apt-get install -y --no-install-recommends \
- # build-essential \
- # glslc \
- # gcc-14-riscv64-linux-gnu \
- # g++-14-riscv64-linux-gnu \
- # libvulkan-dev:riscv64
-
- # - name: Build
- # run: |
- # cmake -B build -DLLAMA_OPENSSL=OFF \
- # -DCMAKE_BUILD_TYPE=Release \
- # -DGGML_VULKAN=ON \
- # -DGGML_OPENMP=OFF \
- # -DLLAMA_BUILD_EXAMPLES=ON \
- # -DLLAMA_BUILD_TOOLS=ON \
- # -DLLAMA_BUILD_TESTS=OFF \
- # -DCMAKE_SYSTEM_NAME=Linux \
- # -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
- # -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
- # -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
- # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- # -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
- # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-
- # cmake --build build --config Release -j $(nproc)
-
- # ubuntu-24-arm64-vulkan-cross:
- # runs-on: ubuntu-24.04
-
- # steps:
- # - uses: actions/checkout@v6
- # - name: Setup Arm64
- # run: |
- # sudo dpkg --add-architecture arm64
-
- # # Add arch-specific repositories for non-amd64 architectures
- # cat << EOF | sudo tee /etc/apt/sources.list.d/arm64-ports.list
- # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
- # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
- # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
- # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
- # EOF
-
- # sudo apt-get update || true ;# Prevent failure due to missing URLs.
-
- # sudo apt-get install -y --no-install-recommends \
- # build-essential \
- # glslc \
- # crossbuild-essential-arm64 \
- # libvulkan-dev:arm64
-
- # - name: Build
- # run: |
- # cmake -B build -DLLAMA_OPENSSL=OFF \
- # -DCMAKE_BUILD_TYPE=Release \
- # -DGGML_VULKAN=ON \
- # -DGGML_OPENMP=OFF \
- # -DLLAMA_BUILD_EXAMPLES=ON \
- # -DLLAMA_BUILD_TOOLS=ON \
- # -DLLAMA_BUILD_TESTS=OFF \
- # -DCMAKE_SYSTEM_NAME=Linux \
- # -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
- # -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
- # -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
- # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- # -DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64-linux-gnu \
- # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-
- # cmake --build build --config Release -j $(nproc)
-
- debian-13-loongarch64-cpu-cross:
- runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
- container: debian@sha256:653dfb9f86c3782e8369d5f7d29bb8faba1f4bff9025db46e807fa4c22903671
-
- steps:
- - uses: actions/checkout@v6
- - name: Setup LoongArch
- run: |
- rm -f /etc/apt/sources.list.d/*
- cat << EOF | tee /etc/apt/sources.list.d/debian-ports.list
- deb http://snapshot.debian.org/archive/debian/20250515T202920Z/ trixie main
- EOF
- ( echo 'quiet "true";'; \
- echo 'APT::Get::Assume-Yes "true";'; \
- echo 'APT::Install-Recommends "false";'; \
- echo 'Acquire::Check-Valid-Until "false";'; \
- echo 'Acquire::Retries "5";'; \
- ) > /etc/apt/apt.conf.d/99snapshot-repos
-
- apt-get update
- apt-get install -y ca-certificates debian-ports-archive-keyring cmake git zip
- dpkg --add-architecture loong64
-
- # Add arch-specific repositories for non-amd64 architectures
- cat << EOF | tee /etc/apt/sources.list.d/loong64-ports.list
- deb [arch=loong64] http://snapshot.debian.org/archive/debian-ports/20250515T194251Z/ sid main
- EOF
-
- apt-get update || true ;# Prevent failure due to missing URLs.
-
- apt-get install -y --no-install-recommends \
- build-essential \
- gcc-14-loongarch64-linux-gnu \
- g++-14-loongarch64-linux-gnu
-
- - name: Build
- run: |
- cmake -B build -DLLAMA_OPENSSL=OFF \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=OFF \
- -DCMAKE_SYSTEM_NAME=Linux \
- -DCMAKE_SYSTEM_PROCESSOR=loongarch64 \
- -DCMAKE_C_COMPILER=loongarch64-linux-gnu-gcc-14 \
- -DCMAKE_CXX_COMPILER=loongarch64-linux-gnu-g++-14 \
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- -DCMAKE_FIND_ROOT_PATH=/usr/lib/loongarch64-linux-gnu \
- -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-
- cmake --build build --config Release -j $(nproc)
-
- debian-13-loongarch64-vulkan-cross:
- runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
- container: debian@sha256:653dfb9f86c3782e8369d5f7d29bb8faba1f4bff9025db46e807fa4c22903671
-
- steps:
- - uses: actions/checkout@v6
- - name: Setup LoongArch
- run: |
- rm -f /etc/apt/sources.list.d/*
- cat << EOF | tee /etc/apt/sources.list.d/debian-ports.list
- deb http://snapshot.debian.org/archive/debian/20250515T202920Z/ trixie main
- EOF
- ( echo 'quiet "true";'; \
- echo 'APT::Get::Assume-Yes "true";'; \
- echo 'APT::Install-Recommends "false";'; \
- echo 'Acquire::Check-Valid-Until "false";'; \
- echo 'Acquire::Retries "5";'; \
- ) > /etc/apt/apt.conf.d/99snapshot-repos
-
- apt-get update
- apt-get install -y ca-certificates debian-ports-archive-keyring cmake git zip
- dpkg --add-architecture loong64
-
- # Add arch-specific repositories for non-amd64 architectures
- cat << EOF | tee /etc/apt/sources.list.d/loong64-ports.list
- deb [arch=loong64] http://snapshot.debian.org/archive/debian-ports/20250515T194251Z/ sid main
- EOF
-
- apt-get update || true ;# Prevent failure due to missing URLs.
-
- apt-get install -y --no-install-recommends \
- build-essential \
- glslc \
- spirv-headers \
- gcc-14-loongarch64-linux-gnu \
- g++-14-loongarch64-linux-gnu \
- libvulkan-dev:loong64
-
- - name: Build
- run: |
- cmake -B build -DLLAMA_OPENSSL=OFF \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_VULKAN=ON \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=OFF \
- -DCMAKE_SYSTEM_NAME=Linux \
- -DCMAKE_SYSTEM_PROCESSOR=loongarch64 \
- -DCMAKE_C_COMPILER=loongarch64-linux-gnu-gcc-14 \
- -DCMAKE_CXX_COMPILER=loongarch64-linux-gnu-g++-14 \
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- -DCMAKE_FIND_ROOT_PATH=/usr/lib/loongarch64-linux-gnu \
- -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
-
- cmake --build build --config Release -j $(nproc)
-
- ubuntu-24-riscv64-cpu-spacemit-ime-cross:
- runs-on: ubuntu-24.04
-
- env:
- # Make sure this is in sync with build-cache.yml
- SPACEMIT_IME_TOOLCHAIN_VERSION: "1.2.4"
-
- steps:
- - uses: actions/checkout@v6
-
- #- name: Use SpacemiT Toolchain Cache
- # uses: actions/cache@v5
- # id: cache-toolchain
- # with:
- # path: ./spacemit_toolchain
- # key: cache-gha-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
-
- - name: Setup SpacemiT Toolchain
- #if: steps.cache-toolchain.outputs.cache-hit != 'true'
- uses: ./.github/actions/linux-setup-spacemit
- with:
- path: ./spacemit_toolchain
- version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
-
- - name: Build
- run: |
- export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain
- cmake -B build -DLLAMA_OPENSSL=OFF \
- -DCMAKE_BUILD_TYPE=Release \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DGGML_CPU_REPACK=OFF \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=OFF \
- -DGGML_CPU_RISCV64_SPACEMIT=ON \
- -DGGML_RVV=ON \
- -DGGML_RV_ZVFH=ON \
- -DGGML_RV_ZFH=ON \
- -DGGML_RV_ZICBOP=ON \
- -DGGML_RV_ZIHINTPAUSE=ON \
- -DGGML_RV_ZBA=ON \
- -DCMAKE_TOOLCHAIN_FILE=${PWD}/cmake/riscv64-spacemit-linux-gnu-gcc.cmake
-
- cmake --build build --config Release -j $(nproc)
diff --git a/.github/workflows/build-cuda-ubuntu.yml b/.github/workflows/build-cuda-ubuntu.yml
deleted file mode 100644
index 6271b22..0000000
--- a/.github/workflows/build-cuda-ubuntu.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-name: CI (CUDA, ubuntu)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-cuda-ubuntu.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.cuh'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-cuda-ubuntu.yml',
- 'ggml/src/ggml-cuda/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- cuda:
- runs-on: ubuntu-24.04
- container: nvidia/cuda:12.6.2-devel-ubuntu24.04
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Install dependencies
- env:
- DEBIAN_FRONTEND: noninteractive
- run: |
- apt update
- apt install -y cmake build-essential ninja-build libgomp1 git libssl-dev
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: cuda-ubuntu-24.04-cuda
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build with CMake
- # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
- run: |
- cmake -S . -B build -G Ninja \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_CUDA_ARCHITECTURES=89-real \
- -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
- -DGGML_NATIVE=OFF \
- -DGGML_CUDA=ON \
- -DGGML_CUDA_CUB_3DOT2=ON
- cmake --build build
-
- hip:
- runs-on: ubuntu-22.04
- container: rocm/dev-ubuntu-22.04:6.1.2
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - 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: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: cuda-ubuntu-22.04-hip
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build with native CMake HIP support
- id: cmake_build
- run: |
- cmake -B build -S . \
- -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
- -DGGML_HIP_ROCWMMA_FATTN=ON \
- -DGPU_TARGETS="gfx1030" \
- -DGGML_HIP=ON
- cmake --build build --config Release -j $(nproc)
-
- musa:
- runs-on: ubuntu-22.04
- container: mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- apt-get update
- apt-get install -y build-essential git cmake libssl-dev
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: cuda-ubuntu-22.04-musa
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build with native CMake MUSA support
- id: cmake_build
- run: |
- cmake -B build -S . \
- -DGGML_MUSA=ON
- time cmake --build build --config Release -j $(nproc)
diff --git a/.github/workflows/build-cuda-windows.yml b/.github/workflows/build-cuda-windows.yml
deleted file mode 100644
index e9e9414..0000000
--- a/.github/workflows/build-cuda-windows.yml
+++ /dev/null
@@ -1,162 +0,0 @@
-name: CI (CUDA, windows)
-
-# TODO: this workflow is only triggered manually because it is very heavy on the CI
-# when we provision dedicated windows runners, we can enable it for pushes too
-# note: running this workflow manually will populate the ccache for the release builds
-# this can be used before merging a PR to speed up the release workflow
-on:
- workflow_dispatch: # allows manual triggering
-
-# note: this will run in queue with the release workflow
-concurrency:
- group: release
- queue: max
-
-env:
- GH_TOKEN: ${{ github.token }}
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- cuda:
- runs-on: windows-2022
-
- permissions:
- actions: write
-
- strategy:
- matrix:
- cuda: ['12.4', '13.3']
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
-
- - name: Install Cuda Toolkit
- uses: ./.github/actions/windows-setup-cuda
- with:
- cuda_version: ${{ matrix.cuda }}
-
- - name: Install Ninja
- id: install_ninja
- run: |
- choco install ninja
-
- - name: Build
- id: cmake_build
- shell: cmd
- # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
- cmake -S . -B build -G "Ninja Multi-Config" ^
- -DLLAMA_BUILD_SERVER=ON ^
- -DLLAMA_BUILD_BORINGSSL=ON ^
- -DGGML_NATIVE=OFF ^
- -DGGML_BACKEND_DL=ON ^
- -DGGML_CPU_ALL_VARIANTS=ON ^
- -DGGML_CUDA=ON ^
- -DGGML_RPC=ON ^
- -DGGML_CUDA_CUB_3DOT2=ON
- set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
- cmake --build build --config Release -j %NINJA_JOBS% -t ggml
- cmake --build build --config Release
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
-
- hip:
- runs-on: windows-2022
-
- permissions:
- actions: write
-
- env:
- # Make sure this is in sync with build-cache.yml
- HIPSDK_INSTALLER_VERSION: "26.Q1"
-
- strategy:
- matrix:
- include:
- # sync with release.yml
- - name: "radeon"
- gpu_targets: "gfx1150;gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Grab rocWMMA package
- id: grab_rocwmma
- run: |
- curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2.1/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70201-81~24.04_amd64.deb"
- 7z x rocwmma.deb
- 7z x data.tar
-
- - name: Use ROCm Installation Cache
- uses: actions/cache@v5
- id: cache-rocm
- with:
- path: C:\Program Files\AMD\ROCm
- key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
-
- - name: Setup ROCm
- if: steps.cache-rocm.outputs.cache-hit != 'true'
- uses: ./.github/actions/windows-setup-rocm
- with:
- version: ${{ env.HIPSDK_INSTALLER_VERSION }}
-
- - name: Verify ROCm
- id: verify
- run: |
- # Find and test ROCm installation
- $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
- if (-not $clangPath) {
- Write-Error "ROCm installation not found"
- exit 1
- }
- & $clangPath.FullName --version
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- # TODO: this build does not match the build in release.yml, so we use a different cache key
- # ideally, the builds should match, similar to the CUDA build above so that we would be able
- # to populate the ccache for the release with manual runs of this workflow
- #key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
- key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
-
- - name: Build
- id: cmake_build
- run: |
- $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
- $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
- 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-7.2.1/include/" `
- -DCMAKE_BUILD_TYPE=Release `
- -DLLAMA_BUILD_BORINGSSL=ON `
- -DROCM_DIR="${env:HIP_PATH}" `
- -DGGML_HIP=ON `
- -DGGML_HIP_ROCWMMA_FATTN=ON `
- -DGPU_TARGETS="gfx1100" `
- -DGGML_RPC=ON
- cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- #key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
- key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
diff --git a/.github/workflows/build-ibm.yml b/.github/workflows/build-ibm.yml
deleted file mode 100644
index d2e4f3c..0000000
--- a/.github/workflows/build-ibm.yml
+++ /dev/null
@@ -1,150 +0,0 @@
-name: CI (ibm)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-ibm.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-ibm.yml',
- 'ggml/src/ggml-cpu/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
-
- ubuntu-24-s390x:
- runs-on: ubuntu-24.04-s390x
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Build Dependencies
- id: build_depends
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- python3 python3-pip python3-dev python3-wheel \
- libjpeg-dev build-essential libssl-dev \
- git-lfs
-
- - name: Toolchain workaround (GCC 14)
- run: |
- sudo apt-get install -y gcc-14 g++-14
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
-
- - name: Python Dependencies
- id: python_depends
- run: |
- export PIP_BREAK_SYSTEM_PACKAGES="1"
- python3 -m pip install --upgrade pip setuptools
- pip3 install ./gguf-py
-
- - name: Swap Endianness
- id: endianness
- run: |
- for f in models/*.gguf; do
- echo YES | python3 gguf-py/gguf/scripts/gguf_convert_endian.py $f big
- done
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- - name: Test llama2c (s390x)
- id: llama2c_test_s390x
- run: |
- cd build
- echo "Fetch llama2c big-endian model"
- wget https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K-be.gguf
- ./bin/llama-completion -m stories260K-be.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
-
- ubuntu-24-ppc64le:
- runs-on: ubuntu-24.04-ppc64le
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Build Dependencies
- id: build_depends
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- python3 python3-pip python3-dev python3-wheel \
- libjpeg-dev build-essential libssl-dev \
- git-lfs
-
- - name: Toolchain workaround (GCC 14)
- run: |
- sudo apt-get install -y gcc-14 g++-14
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
-
- - name: Python Dependencies
- id: python_depends
- run: |
- export PIP_BREAK_SYSTEM_PACKAGES="1"
- python3 -m pip install --upgrade pip setuptools
- pip3 install ./gguf-py
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- - name: Test llama2c conversion
- id: llama2c_test
- run: |
- cd build
- echo "Fetch tokenizer"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
- echo "Fetch llama2c model"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
- ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
- ./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
diff --git a/.github/workflows/build-msys.yml b/.github/workflows/build-msys.yml
deleted file mode 100644
index 15c55cf..0000000
--- a/.github/workflows/build-msys.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-name: CI (msys)
-
-on:
- # only manual triggers due to low-importance of the workflows
- # TODO: for regular runs, provision dedicated self-hosted runners
- workflow_dispatch:
- # run once every week
- schedule:
- - cron: '0 0 * * 0'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- windows-msys2:
- runs-on: windows-2025
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - { sys: UCRT64, env: ucrt-x86_64, compiler: gcc, build: Release }
- - { sys: CLANG64, env: clang-x86_64, compiler: clang, build: Release }
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
-
- #- name: ccache
- # uses: ggml-org/ccache-action@v1.2.16
- # with:
- # key: msys-windows-2025-x64
- # variant: ccache
- # evict-old-files: 1d
- # save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Setup ${{ matrix.sys }}
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2
- with:
- update: true
- msystem: ${{matrix.sys}}
- install: >-
- mingw-w64-${{matrix.env}}-${{matrix.compiler}}
- mingw-w64-${{matrix.env}}-cmake
- mingw-w64-${{matrix.env}}-openblas
-
- - name: Build using CMake
- shell: msys2 {0}
- run: |
- cmake -B build
- cmake --build build --config ${{ matrix.build }} -j $(nproc)
-
- - name: Clean after building using CMake
- shell: msys2 {0}
- run: |
- rm -rf build
-
- - name: Build using CMake w/ OpenBLAS
- shell: msys2 {0}
- run: |
- cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
- cmake --build build --config ${{ matrix.build }} -j $(nproc)
diff --git a/.github/workflows/build-opencl.yml b/.github/workflows/build-opencl.yml
deleted file mode 100644
index 251b1f8..0000000
--- a/.github/workflows/build-opencl.yml
+++ /dev/null
@@ -1,82 +0,0 @@
-name: CI (opencl)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-opencl.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cl'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-opencl.yml',
- 'ggml/src/ggml-opencl/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- windows-2025-opencl-adreno:
- runs-on: windows-2025
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: opencl-windows-2025-x64
- variant: ccache
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Install Ninja
- id: install_ninja
- run: |
- choco install ninja
-
- - name: Install OpenCL Headers and Libs
- id: install_opencl
- run: |
- git clone https://github.com/KhronosGroup/OpenCL-Headers
- cd OpenCL-Headers
- cmake -B build `
- -DBUILD_TESTING=OFF `
- -DOPENCL_HEADERS_BUILD_TESTING=OFF `
- -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF `
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
- cmake --build build --target install
- git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
- cd OpenCL-ICD-Loader
- cmake -B build-arm64-release `
- -A arm64 `
- -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" `
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
- cmake --build build-arm64-release --target install --config release
-
- - name: Build
- id: cmake_build
- run: |
- cmake -S . -B build -G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON -DLLAMA_BUILD_BORINGSSL=ON
- cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
diff --git a/.github/workflows/build-openvino.yml b/.github/workflows/build-openvino.yml
deleted file mode 100644
index 938cde3..0000000
--- a/.github/workflows/build-openvino.yml
+++ /dev/null
@@ -1,169 +0,0 @@
-name: CI (openvino)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-openvino.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-openvino.yml',
- 'ggml/src/ggml-openvino/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-24-openvino:
- runs-on: [self-hosted, Linux, Intel, OpenVINO]
-
- env:
- # Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential libssl-dev libtbb12 cmake ninja-build python3-pip
- sudo apt-get install -y ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers intel-opencl-icd
-
- - name: Setup OpenVINO Toolkit
- uses: ./.github/actions/linux-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- - name: Install OpenVINO dependencies
- run: |
- cd ./openvino_toolkit
- chmod +x ./install_dependencies/install_openvino_dependencies.sh
- echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
-
- - name: Build
- id: cmake_build
- run: |
- source ./openvino_toolkit/setupvars.sh
- cmake -B build/ReleaseOV -G Ninja \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_OPENVINO=ON
- time cmake --build build/ReleaseOV --config Release --parallel
-
- - name: Test (CPU)
- id: cmake_test_cpu
- # TODO: fix and re-enable the `test-llama-archs` test below
- run: |
- cd ${{ github.workspace }}
- ctest --test-dir build/ReleaseOV -L main -E "test-llama-archs" --verbose --timeout 2000
-
- - name: Test (GPU)
- id: cmake_test_gpu
- # TODO: fix and re-enable the `test-llama-archs` test below
- run: |
- cd ${{ github.workspace }}
- export GGML_OPENVINO_DEVICE=GPU
- ctest --test-dir build/ReleaseOV -L main -E "test-llama-archs" --verbose --timeout 3000
-
- openvino-windows-2022:
- runs-on: windows-2022
-
- env:
- # Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: openvino-windows-2022
- variant: ccache
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-openvino
- with:
- path: ./openvino_toolkit
- key: cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
-
- - name: Setup OpenVINO Toolkit
- if: steps.cache-openvino.outputs.cache-hit != 'true'
- uses: ./.github/actions/windows-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- - name: Install OpenCL using vcpkg
- shell: powershell
- run: |
- git clone https://github.com/microsoft/vcpkg C:\vcpkg
- C:\vcpkg\bootstrap-vcpkg.bat
- C:\vcpkg\vcpkg install opencl
-
- - name: Build
- id: cmake_build
- shell: cmd
- run: |
- REM Find extracted OpenVINO folder dynamically
- for /d %%i in (openvino_toolkit\*) do set OPENVINO_ROOT=%%i
-
- if not exist "%OPENVINO_ROOT%\runtime\cmake\OpenVINOConfig.cmake" (
- echo ERROR: OpenVINOConfig.cmake not found
- exit /b 1
- )
-
- call "%OPENVINO_ROOT%\setupvars.bat"
-
- cmake -B build\ReleaseOV -G "Visual Studio 17 2022" ^
- -A x64 ^
- -DCMAKE_BUILD_TYPE=Release ^
- -DGGML_OPENVINO=ON ^
- -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
-
- cmake --build build\ReleaseOV --config Release -- /m
-
- - name: Test (CPU)
- id: cmake_test_cpu
- shell: cmd
- # TODO: fix and re-enable the `test-llama-archs` test below
- run: |
- REM Find extracted OpenVINO folder dynamically
- for /d %%i in (openvino_toolkit\*) do set OPENVINO_ROOT=%%i
- call "%OPENVINO_ROOT%\setupvars.bat"
-
- cd build
- ctest --test-dir ReleaseOV -L main -E "test-llama-archs" -C Release --verbose --timeout 3000
diff --git a/.github/workflows/build-riscv.yml b/.github/workflows/build-riscv.yml
deleted file mode 100644
index 7061537..0000000
--- a/.github/workflows/build-riscv.yml
+++ /dev/null
@@ -1,188 +0,0 @@
-name: CI (riscv)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-riscv.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-riscv.yml',
- 'ggml/src/ggml-cpu/arch/riscv/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-cpu-riscv64-native:
- runs-on: ubuntu-24.04-riscv
-
- steps:
- - name: Install dependencies
- run: |
- # Install necessary packages
- sudo apt-get update
- sudo apt-get install -y libssl-dev
-
- # Set gcc-14 and g++-14 as the default compilers
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
-
- git lfs install
-
- - name: Check environment
- run: |
- uname -a
- gcc --version
- g++ --version
- ldd --version
- cmake --version
- rustc --version
- env
- echo "nproc=$(nproc)"
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # note: sparing some ccache since these jobs run on dedicated runners that are not part of the organitzation
- #- name: ccache
- # uses: ggml-org/ccache-action@afde29e5b5422e5da23cb1f639e8baecadeadfc3 # https://github.com/ggml-org/ccache-action/pull/1
- # with:
- # key: riscv-ubuntu-native
- # evict-old-files: 1d
- # save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=ON \
- -DCMAKE_C_COMPILER_LAUNCHER=ccache \
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- -DGGML_RPC=ON \
- -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
- -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14
-
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- - name: Test llama2c conversion
- id: llama2c_test
- run: |
- cd build
- echo "Fetch tokenizer"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
- echo "Fetch llama2c model"
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
- ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
- ./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
-
- ubuntu-riscv64-native-sanitizer:
- runs-on: ubuntu-24.04-riscv
-
- continue-on-error: true
-
- strategy:
- matrix:
- sanitizer: [ADDRESS, THREAD, UNDEFINED]
- build_type: [Debug]
-
- steps:
- - name: Install dependencies
- run: |
- # Set gcc-14 and g++-14 as the default compilers
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
-
- git lfs install
-
- - name: GCC version check
- run: |
- gcc --version
- g++ --version
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # note: sparing some ccache since these jobs run on dedicated runners that are not part of the organitzation
- #- name: ccache
- # uses: ggml-org/ccache-action@afde29e5b5422e5da23cb1f639e8baecadeadfc3 # https://github.com/ggml-org/ccache-action/pull/1
- # with:
- # key: riscv-ubuntu-native-sanitizer-${{ matrix.sanitizer }}-${{ matrix.build_type }}
- # evict-old-files: 1d
- # save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- if: ${{ matrix.sanitizer != 'THREAD' }}
- run: |
- cmake -B build \
- -DLLAMA_OPENSSL=OFF \
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
- -DGGML_OPENMP=ON \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=OFF \
- -DCMAKE_C_COMPILER_LAUNCHER=ccache \
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
- -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14
-
- cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
-
- - name: Build (no OpenMP)
- id: cmake_build_no_openmp
- if: ${{ matrix.sanitizer == 'THREAD' }}
- run: |
- cmake -B build \
- -DLLAMA_OPENSSL=OFF \
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_EXAMPLES=ON \
- -DLLAMA_BUILD_TOOLS=ON \
- -DLLAMA_BUILD_TESTS=OFF \
- -DCMAKE_C_COMPILER_LAUNCHER=ccache \
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
- -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14
-
- cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
diff --git a/.github/workflows/build-rpc.yml b/.github/workflows/build-rpc.yml
deleted file mode 100644
index d04dc37..0000000
--- a/.github/workflows/build-rpc.yml
+++ /dev/null
@@ -1,66 +0,0 @@
-name: CI (rpc)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-rpc.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-rpc.yml',
- 'ggml/src/ggml-rpc/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-24-rpc:
- runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
-
- continue-on-error: true
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev ninja-build
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -G "Ninja" \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_RPC=ON
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose
diff --git a/.github/workflows/build-sanitize.yml b/.github/workflows/build-sanitize.yml
deleted file mode 100644
index e242abc..0000000
--- a/.github/workflows/build-sanitize.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-name: CI (sanitize)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-sanitize.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ctest:
- runs-on: [self-hosted, X64, CPU, Linux]
-
- continue-on-error: true
-
- strategy:
- matrix:
- sanitizer: [ADDRESS, THREAD, UNDEFINED]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- # with UNDEFINED sanitizer, we have to build in Debug to avoid GCC 13 false-positive warnings
- - name: Build (undefined)
- id: cmake_build_undefined
- if: ${{ matrix.sanitizer == 'UNDEFINED' }}
- run: |
- cmake -B build \
- -DCMAKE_BUILD_TYPE=Debug \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON
-
- cmake --build build --config Debug -j $(nproc)
-
- - name: Build
- id: cmake_build
- if: ${{ matrix.sanitizer == 'ADDRESS' }}
- run: |
- cmake -B build \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON
-
- cmake --build build --config RelWithDebInfo -j $(nproc)
-
- - name: Build (no OpenMP)
- id: cmake_build_no_openmp
- if: ${{ matrix.sanitizer == 'THREAD' }}
- run: |
- cmake -B build \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON \
- -DGGML_OPENMP=OFF
-
- cmake --build build --config RelWithDebInfo -j $(nproc)
-
- - name: Test
- id: cmake_test
- # skip run in Debug - very slow
- if: ${{ matrix.sanitizer != 'UNDEFINED' }}
- run: |
- cd build
- ctest -L main -E tokenizer --verbose --timeout 900
diff --git a/.github/workflows/build-self-hosted.yml b/.github/workflows/build-self-hosted.yml
deleted file mode 100644
index 441a897..0000000
--- a/.github/workflows/build-self-hosted.yml
+++ /dev/null
@@ -1,389 +0,0 @@
-name: CI (self-hosted)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-self-hosted.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.cuh',
- '**/*.swift',
- '**/*.m',
- '**/*.metal',
- '**/*.comp',
- '**/*.glsl',
- '**/*.wgsl'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-self-hosted.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.cuh',
- '**/*.swift',
- '**/*.m',
- '**/*.metal',
- '**/*.comp',
- '**/*.glsl',
- '**/*.wgsl'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- # note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302)
- HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- gpu-cuda:
- runs-on: [self-hosted, Linux, NVIDIA]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- nvidia-smi
- GG_BUILD_CUDA=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-vulkan-nvidia-cm:
- runs-on: [self-hosted, Linux, NVIDIA]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- vulkaninfo --summary
- GG_BUILD_VULKAN=1 GGML_VK_DISABLE_COOPMAT2=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-vulkan-nvidia-cm2:
- runs-on: [self-hosted, Linux, NVIDIA, COOPMAT2]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- vulkaninfo --summary
- GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-webgpu-nvidia:
- runs-on: [self-hosted, Linux, NVIDIA, X64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dawn Dependency
- id: dawn-depends
- run: |
- DAWN_VERSION="v20260317.182325"
- DAWN_OWNER="google"
- DAWN_REPO="dawn"
- DAWN_ASSET_NAME="Dawn-18eb229ef5f707c1464cc581252e7603c73a3ef0-ubuntu-latest-Release"
- echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- curl -L -o artifact.tar.gz \
- "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- mkdir dawn
- tar -xvf artifact.tar.gz -C dawn --strip-components=1
-
- - name: Test
- id: ggml-ci
- run: |
- GG_BUILD_WEBGPU=1 \
- GG_BUILD_WEBGPU_DAWN_PREFIX="$GITHUB_WORKSPACE/dawn" \
- GG_BUILD_WEBGPU_DAWN_DIR="$GITHUB_WORKSPACE/dawn/lib64/cmake/Dawn" \
- bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- # TODO: provision AMX-compatible machine
- #cpu-amx:
- # runs-on: [self-hosted, Linux, CPU, AMX]
-
- # steps:
- # - name: Clone
- # id: checkout
- # uses: actions/checkout@v6
-
- # - name: Test
- # id: ggml-ci
- # run: |
- # bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- # TODO: provision AMD GPU machine
- # amd-vulkan:
- # runs-on: [self-hosted, Linux, AMD]
-
- # steps:
- # - name: Clone
- # id: checkout
- # uses: actions/checkout@v6
-
- # - name: Test
- # id: ggml-ci
- # run: |
- # vulkaninfo --summary
- # GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- # TODO: provision AMD GPU machine
- # amd-rocm:
- # runs-on: [self-hosted, Linux, AMD]
-
- # steps:
- # - name: Clone
- # id: checkout
- # uses: actions/checkout@v6
-
- # - name: Test
- # id: ggml-ci
- # run: |
- # amd-smi static
- # GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-metal:
- runs-on: [self-hosted, macOS, ARM64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- GG_BUILD_METAL=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-webgpu-apple:
- runs-on: [self-hosted, macOS, ARM64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dawn Dependency
- id: dawn-depends
- run: |
- DAWN_VERSION="v20260317.182325"
- DAWN_OWNER="google"
- DAWN_REPO="dawn"
- DAWN_ASSET_NAME="Dawn-18eb229ef5f707c1464cc581252e7603c73a3ef0-macos-latest-Release"
- echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- curl -L -o artifact.tar.gz \
- "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- mkdir dawn
- tar -xvf artifact.tar.gz -C dawn --strip-components=1
-
- - name: Test
- id: ggml-ci
- run: |
- GG_BUILD_WEBGPU=1 GG_BUILD_WEBGPU_DAWN_PREFIX="$GITHUB_WORKSPACE/dawn" \
- bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-vulkan-apple:
- runs-on: [self-hosted, macOS, ARM64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- vulkaninfo --summary
- GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-vulkan-intel-linux:
- runs-on: [self-hosted, Linux, Intel]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- persist-credentials: false
-
- - name: Test
- id: ggml-ci
- run: |
- vulkaninfo --summary
- GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- gpu-vulkan-intel-windows:
- runs-on: [self-hosted, Windows, X64, Intel]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- shell: C:\msys64\usr\bin\bash.exe --noprofile --norc -eo pipefail "{0}"
- env:
- MSYSTEM: UCRT64
- CHERE_INVOKING: 1
- PATH: C:\msys64\ucrt64\bin;C:\msys64\usr\bin;C:\Windows\System32;${{ env.PATH }}
- run: |
- vulkaninfo --summary
- # Skip python related tests with GG_BUILD_LOW_PERF=1 since Windows MSYS2 UCRT64 currently fails to create
- # a valid python environment for testing
- LLAMA_FATAL_WARNINGS=OFF GG_BUILD_NINJA=1 GG_BUILD_VULKAN=1 GG_BUILD_LOW_PERF=1 ./ci/run.sh ./results/llama.cpp ./mnt/llama.cpp
-
- gpu-openvino-low-perf:
- runs-on: [self-hosted, Linux, Intel, OpenVINO]
-
- env:
- # Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup OpenVINO Toolkit
- uses: ./.github/actions/linux-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- - name: Install OpenVINO dependencies
- run: |
- cd ./openvino_toolkit
- chmod +x ./install_dependencies/install_openvino_dependencies.sh
- echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
-
- - name: Test
- id: ggml-ci
- run: |
- source ./openvino_toolkit/setupvars.sh
- GG_BUILD_OPENVINO=1 GGML_OPENVINO_DEVICE=GPU GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- cpu-x64-high-perf:
- runs-on: [self-hosted, Linux, X64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Test
- id: ggml-ci
- run: |
- LLAMA_ARG_THREADS=$(nproc) GG_BUILD_HIGH_PERF=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- cpu-arm64-high-perf-graviton4:
- runs-on: ah-ubuntu_22_04-c8g_8x
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- set -euxo pipefail
- sudo apt-get update
- sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
- apt-get install -y \
- build-essential \
- python3-venv \
- gpg \
- wget \
- time \
- git-lfs
-
- git lfs install
-
- # install the latest cmake
- sudo install -d /usr/share/keyrings
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
- | gpg --dearmor \
- | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
- | sudo tee /etc/apt/sources.list.d/kitware.list
- sudo apt-get update
- sudo apt-get install -y cmake
-
- - name: Test
- id: ggml-ci
- run: |
- LLAMA_ARG_THREADS=$(nproc) GG_BUILD_HIGH_PERF=1 GG_BUILD_NO_BF16=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
-
- cpu-arm64-graviton4-kleidiai:
- runs-on: ah-ubuntu_22_04-c8g_8x
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- set -euxo pipefail
- sudo apt-get update
- sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
- apt-get install -y \
- build-essential \
- python3-venv \
- gpg \
- wget \
- time \
- git-lfs
-
- git lfs install
-
- # install the latest cmake
- sudo install -d /usr/share/keyrings
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
- | gpg --dearmor \
- | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
- | sudo tee /etc/apt/sources.list.d/kitware.list
- sudo apt-get update
- sudo apt-get install -y cmake
-
- - name: Test
- id: ggml-ci
- run: |
- GG_BUILD_KLEIDIAI=1 \
- GG_BUILD_EXTRA_TESTS_0=1 \
- bash ./ci/run.sh ./tmp/results ./tmp/mnt
diff --git a/.github/workflows/build-sycl.yml b/.github/workflows/build-sycl.yml
deleted file mode 100644
index deb0e54..0000000
--- a/.github/workflows/build-sycl.yml
+++ /dev/null
@@ -1,141 +0,0 @@
-name: CI (sycl)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-sycl.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-sycl.yml',
- 'ggml/src/ggml-sycl/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-24-sycl:
- strategy:
- matrix:
- build: [fp32, fp16]
- include:
- - build: fp32
- fp16: OFF
- - build: fp16
- fp16: ON
-
- runs-on: ubuntu-24.04
-
- env:
- ONEAPI_ROOT: /opt/intel/oneapi/
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
- LEVEL_ZERO_VERSION: "1.28.2"
- LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
-
- continue-on-error: true
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Download & Install oneAPI
- shell: bash
- run: |
- cd /tmp
- wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/56f7923a-adb8-43f3-8b02-2b60fcac8cab/intel-deep-learning-essentials-2025.3.3.16_offline.sh -O intel-deep-learning-essentials_offline.sh
- sudo bash intel-deep-learning-essentials_offline.sh -s -a --silent --eula accept
-
- - name: Install Level Zero SDK
- shell: bash
- run: |
- cd /tmp
- wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero.deb
- wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero-devel_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero-devel.deb
- sudo apt-get install -y ./level-zero.deb ./level-zero-devel.deb
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: sycl-ubuntu-24-${{ matrix.build }}
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- source /opt/intel/oneapi/setvars.sh
- cmake -B build \
- -G "Ninja" \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_SYCL=ON \
- -DCMAKE_C_COMPILER=icx \
- -DCMAKE_CXX_COMPILER=icpx \
- -DLLAMA_OPENSSL=OFF \
- -DGGML_NATIVE=OFF \
- -DGGML_SYCL_F16=${{ matrix.fp16 }}
- time cmake --build build --config Release -j $(nproc)
-
- windows-latest-sycl:
- runs-on: windows-2022
-
- defaults:
- run:
- shell: bash
-
- env:
- WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b60765d1-2b85-4e85-86b6-cb0e9563a699/intel-deep-learning-essentials-2025.3.3.18_offline.exe
- WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
- LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip
- ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Download & Install oneAPI
- shell: bash
- run: |
- scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
-
- - name: Install Level Zero SDK
- shell: pwsh
- run: |
- Invoke-WebRequest -Uri "${{ env.LEVEL_ZERO_SDK_URL }}" -OutFile "level-zero-win-sdk.zip"
- Expand-Archive -Path "level-zero-win-sdk.zip" -DestinationPath "C:/level-zero-sdk" -Force
- "LEVEL_ZERO_V1_SDK_PATH=C:/level-zero-sdk" | Out-File -FilePath $env:GITHUB_ENV -Append
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: sycl-windows-latest
- variant: ccache
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- # TODO: add ssl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
-
- - name: Build
- id: cmake_build
- run: examples/sycl/win-build-sycl.bat
diff --git a/.github/workflows/build-virtgpu.yml b/.github/workflows/build-virtgpu.yml
deleted file mode 100644
index 5b74059..0000000
--- a/.github/workflows/build-virtgpu.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: CI (virtgpu)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-virtgpu.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-virtgpu.yml',
- 'ggml/src/ggml-virtgpu/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- ubuntu-24-virtgpu:
- runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential libdrm-dev pkg-config libssl-dev
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DGGML_VIRTGPU=ON \
- -DGGML_VIRTGPU_BACKEND=ON
- cmake --build build --config Release -j $(nproc)
diff --git a/.github/workflows/build-vulkan.yml b/.github/workflows/build-vulkan.yml
deleted file mode 100644
index a103c50..0000000
--- a/.github/workflows/build-vulkan.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-name: CI (vulkan)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-vulkan.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.comp',
- '**/*.glsl'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-vulkan.yml',
- 'ggml/src/ggml-vulkan/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-arm64:
- runs-on: ubuntu-24.04-arm
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: vulkan-ubuntu-24.04-arm-new
- variant: ccache
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Configure
- id: cmake_configure
- run: |
- cmake -B build \
- -G "Ninja" \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_VULKAN=ON
-
- - name: Build
- id: cmake_build
- run: |
- time cmake --build build -j $(nproc)
-
- ubuntu-llvmpipe:
- runs-on: ubuntu-24.04
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo add-apt-repository -y ppa:kisak/kisak-mesa
- sudo apt-get update -y
- sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev
-
- - name: Get latest Vulkan SDK version
- id: vulkan_sdk_version
- run: |
- echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
-
- - name: Use Vulkan SDK Cache
- uses: actions/cache@v5
- id: cache-sdk
- with:
- path: ./vulkan_sdk
- key: cache-gha-vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
-
- - name: Setup Vulkan SDK
- if: steps.cache-sdk.outputs.cache-hit != 'true'
- uses: ./.github/actions/linux-setup-vulkan
- with:
- path: ./vulkan_sdk
- version: ${{ env.VULKAN_SDK_VERSION }}
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: vulkan-ubuntu-24.04-llvmpipe
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- source ./vulkan_sdk/setup-env.sh
- cmake -B build \
- -DGGML_VULKAN=ON
- cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- export GGML_VK_VISIBLE_DEVICES=0
- export GGML_VK_DISABLE_F16=1
- export GGML_VK_DISABLE_COOPMAT=1
- # This is using llvmpipe and runs slower than other backends
- # test-backend-ops is too slow on llvmpipe, skip it
- ctest -L main -E test-backend-ops --verbose --timeout 900
diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml
deleted file mode 100644
index aa7ae88..0000000
--- a/.github/workflows/build-wasm.yml
+++ /dev/null
@@ -1,90 +0,0 @@
-name: CI (wasm)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-wasm.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.wgsl',
- '**/*.tmpl',
- 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-wasm.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.wgsl',
- '**/*.tmpl',
- 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-webgpu:
- runs-on: ubuntu-24.04-arm
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: webgpu-ubuntu-24.04-arm-wasm
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Install Emscripten
- run: |
- git clone https://github.com/emscripten-core/emsdk.git
- cd emsdk
- ./emsdk install latest
- ./emsdk activate latest
-
- - name: Fetch emdawnwebgpu
- run: |
- DAWN_TAG="v20260317.182325"
- EMDAWN_PKG="emdawnwebgpu_pkg-${DAWN_TAG}.zip"
- echo "Downloading ${EMDAWN_PKG}"
- curl -L -o emdawn.zip \
- "https://github.com/google/dawn/releases/download/${DAWN_TAG}/${EMDAWN_PKG}"
- unzip emdawn.zip
-
- - name: Build WASM WebGPU
- run: |
- source emsdk/emsdk_env.sh
- emcmake cmake -B build-wasm \
- -G "Ninja" \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_WEBGPU=ON \
- -DGGML_OPENMP=OFF \
- -DLLAMA_OPENSSL=OFF \
- -DEMDAWNWEBGPU_DIR=emdawnwebgpu_pkg
-
- time cmake --build build-wasm --config Release --target test-backend-ops -j $(nproc)
diff --git a/.github/workflows/build-webgpu.yml b/.github/workflows/build-webgpu.yml
deleted file mode 100644
index ed73c18..0000000
--- a/.github/workflows/build-webgpu.yml
+++ /dev/null
@@ -1,155 +0,0 @@
-name: CI (webgpu)
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/build-webgpu.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.wgsl',
- '**/*.tmpl',
- 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/build-webgpu.yml',
- 'ggml/src/ggml-webgpu/**'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- format:
- runs-on: ubuntu-24.04
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
-
- - name: Install clang-format 22
- run: |
- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key |
- sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
- sudo add-apt-repository -y \
- "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main"
- sudo apt-get update
- sudo apt-get install -y clang-format-22
-
- - name: Check formatting
- run: |
- find ggml/src/ggml-webgpu \
- -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' \) \
- -print0 |
- xargs -0 clang-format-22 --dry-run --Werror
-
- macos:
- runs-on: macos-latest
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: webgpu-macos-latest
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Dawn Dependency
- id: dawn-depends
- run: |
- DAWN_VERSION="v20260317.182325"
- DAWN_OWNER="google"
- DAWN_REPO="dawn"
- DAWN_ASSET_NAME="Dawn-18eb229ef5f707c1464cc581252e7603c73a3ef0-macos-latest-Release"
- echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- curl -L -o artifact.tar.gz \
- "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- mkdir dawn
- tar -xvf artifact.tar.gz -C dawn --strip-components=1
-
- - name: Build
- id: cmake_build
- run: |
- export CMAKE_PREFIX_PATH=dawn
- cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DGGML_WEBGPU=ON -DGGML_METAL=OFF -DGGML_BLAS=OFF
- time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- ctest -L main --verbose --timeout 900
-
- ubuntu:
- runs-on: ubuntu-24.04
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: webgpu-ubuntu-24.04
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Dependencies
- id: depends
- run: |
- sudo add-apt-repository -y ppa:kisak/kisak-mesa
- sudo apt-get update -y
- sudo apt-get install -y build-essential mesa-vulkan-drivers \
- libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev
-
- - name: Dawn Dependency
- id: dawn-depends
- run: |
- sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev libxi-dev
- DAWN_VERSION="v20260317.182325"
- DAWN_OWNER="google"
- DAWN_REPO="dawn"
- DAWN_ASSET_NAME="Dawn-18eb229ef5f707c1464cc581252e7603c73a3ef0-ubuntu-latest-Release"
- echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- curl -L -o artifact.tar.gz \
- "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
- mkdir dawn
- tar -xvf artifact.tar.gz -C dawn --strip-components=1
-
- - name: Build
- id: cmake_build
- run: |
- export Dawn_DIR=dawn/lib64/cmake/Dawn
- cmake -B build \
- -DGGML_WEBGPU=ON
- time cmake --build build --config Release -j $(nproc)
-
- - name: Test
- id: cmake_test
- run: |
- cd build
- # This is using llvmpipe and runs slower than other backends
- # test-backend-ops is too slow on llvmpipe, skip it
- ctest -L main -E test-backend-ops --verbose --timeout 900
diff --git a/.github/workflows/check-vendor.yml b/.github/workflows/check-vendor.yml
deleted file mode 100644
index 015629f..0000000
--- a/.github/workflows/check-vendor.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-name: Check vendor
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- 'vendor/**',
- 'scripts/sync_vendor.py'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- 'vendor/**',
- 'scripts/sync_vendor.py'
- ]
-
-jobs:
- check-vendor:
- runs-on: [self-hosted, fast]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.x'
-
- - name: Run vendor sync
- run: |
- set -euo pipefail
- python3 scripts/sync_vendor.py
-
- - name: Check for changes
- run: |
- set -euo pipefail
- # detect modified or untracked files
- changed=$(git status --porcelain --untracked-files=all || true)
- if [ -n "$changed" ]; then
- echo "Vendor sync modified files:"
- echo "$changed" | awk '{ print $2 }' | sed '/^$/d'
- echo "Failing because vendor files mismatch. Please update scripts/sync_vendor.py"
- exit 1
- else
- echo "Vendor files are up-to-date."
- fi
diff --git a/.github/workflows/close-issue.yml b/.github/workflows/close-issue.yml
deleted file mode 100644
index 4698cee..0000000
--- a/.github/workflows/close-issue.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: Close inactive issues
-on:
- schedule:
- - cron: "42 0 * * *"
-
-# Fine-grant permission
-# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
-permissions:
- issues: write
-
-jobs:
- close-issues:
- runs-on: ubuntu-slim
- permissions:
- issues: write
- pull-requests: write
- steps:
- - uses: actions/stale@v10
- with:
- exempt-issue-labels: "refactoring,help wanted,good first issue,research 🔬,bug,roadmap,security"
- days-before-issue-stale: 30
- days-before-issue-close: 14
- stale-issue-label: "stale"
- close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
- days-before-pr-stale: -1
- days-before-pr-close: -1
- operations-per-run: 10000
- repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml
deleted file mode 100644
index 50b598b..0000000
--- a/.github/workflows/code-style.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: Code Style Checker
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- model-naming:
- runs-on: [self-hosted, fast]
- steps:
- - uses: actions/checkout@v6
- - name: Check model naming conventions
- run: |
- python3 - << 'EOF'
- import re, os, sys
-
- pairs = re.findall(
- r'case\s+(LLM_ARCH_\w+)\s*:\s*\n\s+return new (llama_model_\w+)\s*\(',
- open("src/llama-model.cpp").read())
-
- errors = []
- for arch, cls in pairs:
- suffix = arch[len("LLM_ARCH_"):]
- csuffix = cls[len("llama_model_"):]
- fname = csuffix.replace("_", "-") + ".cpp"
-
- if not re.fullmatch(r'[A-Z][A-Z0-9_]*', suffix):
- errors.append(f"{arch}: suffix not upper snake case, example: LLM_ARCH_MY_MODEL")
-
- if not re.fullmatch(r'[a-z][a-z0-9_]*', csuffix):
- errors.append(f"{arch}: class suffix not lower snake case, example: llama_model_my_model")
-
- elif suffix.lower() != csuffix:
- errors.append(f"{arch}: arch/class name mismatch, expected class 'llama_model_{suffix.lower()}' but got '{cls}'")
-
- elif not os.path.isfile(f"src/models/{fname}"):
- errors.append(f"{arch}: expects model file name to be src/models/{fname}, but not found")
-
- if errors:
- print('\n'.join(f" - {e}" for e in errors)); sys.exit(1)
- print(f"OK: {len(pairs)} mappings validated.")
- EOF
diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
deleted file mode 100644
index 6f648ba..0000000
--- a/.github/workflows/copilot-setup-steps.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-name: "Copilot Setup Steps"
-
-# Automatically run the setup steps when they are changed to allow for easy validation, and
-# allow manual testing through the repository's "Actions" tab
-on:
- workflow_dispatch:
- push:
- paths:
- - .github/workflows/copilot-setup-steps.yml
- pull_request:
- paths:
- - .github/workflows/copilot-setup-steps.yml
-
-jobs:
- # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
- copilot-setup-steps:
- runs-on: ubuntu-latest
-
- # Set the permissions to the lowest permissions possible needed for your steps.
- # Copilot will be given its own token for its operations.
- permissions:
- # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
- contents: read
-
- # You can define any steps you want, and they will run before the agent starts.
- # If you do not check out your code, Copilot will do this for you.
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: copilot-setup-steps
- evict-old-files: 1d
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev
- # Install git-clang-format script for formatting only changed code
- wget -O /tmp/git-clang-format https://raw.githubusercontent.com/llvm/llvm-project/release/18.x/clang/tools/clang-format/git-clang-format
- sudo cp /tmp/git-clang-format /usr/local/bin/git-clang-format
- sudo chmod +x /usr/local/bin/git-clang-format
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install Python dependencies
- run: |
- python3 -m venv .venv
- source .venv/bin/activate
- pip install -r requirements/requirements-all.txt -r tools/server/tests/requirements.txt
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
deleted file mode 100644
index afe4b7c..0000000
--- a/.github/workflows/docker.yml
+++ /dev/null
@@ -1,529 +0,0 @@
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
-# GitHub recommends pinning actions to a commit SHA.
-# To get a newer version, you will need to update the SHA.
-# You can also reference a tag or branch, but the action may change without warning.
-
-name: Publish Docker image
-
-on:
- workflow_dispatch: # allows manual triggering
- inputs:
- skip_s390x:
- description: "Skip the s390x build target (useful for fast test runs that do not need the IBM Z runner)"
- type: boolean
- default: false
- schedule:
- # Rebuild daily rather than on every push because it is expensive
- - cron: '12 4 * * *'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-# Fine-grant permission
-# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
-permissions:
- packages: write
-
-jobs:
- create_tag:
- name: Create and push git tag
- runs-on: ubuntu-slim
- permissions:
- contents: write
- outputs:
- source_tag: ${{ steps.srctag.outputs.name }}
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Determine source tag name
- id: srctag
- uses: ./.github/actions/get-tag-name
- env:
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
-
- - name: Create and push git tag
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- git tag ${{ steps.srctag.outputs.name }} || exit 0
- git push origin ${{ steps.srctag.outputs.name }} || exit 0
-
- build_ui:
- name: Build UI
- needs: create_tag
- uses: ./.github/workflows/ui-build.yml
- with:
- hf_ui_version: ${{ needs.create_tag.outputs.source_tag }}
-
- prepare_matrices:
- name: Prepare Docker matrices
- runs-on: ubuntu-24.04
- outputs:
- build_matrix: ${{ steps.matrices.outputs.build_matrix }}
- merge_matrix: ${{ steps.matrices.outputs.merge_matrix }}
-
- steps:
- - name: Generate build and merge matrices
- id: matrices
- shell: bash
- env:
- SKIP_S390X: ${{ inputs.skip_s390x || 'false' }}
- run: |
- set -euo pipefail
-
- # Keep all build targets in one place and derive merge targets from it.
- cat > build-matrix.json <<'JSON'
- [
- { "tag": "cpu", "dockerfile": ".devops/cpu.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04" },
- { "tag": "cpu", "dockerfile": ".devops/cpu.Dockerfile", "platforms": "linux/arm64", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04-arm" },
- { "tag": "cpu", "dockerfile": ".devops/s390x.Dockerfile", "platforms": "linux/s390x", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04-s390x", "prebuilt_ui": true },
- { "tag": "cuda cuda12", "dockerfile": ".devops/cuda.Dockerfile", "cuda_version": "12.8.1", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04" },
- { "tag": "cuda cuda12", "dockerfile": ".devops/cuda.Dockerfile", "cuda_version": "12.8.1", "platforms": "linux/arm64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04-arm" },
- { "tag": "cuda13", "dockerfile": ".devops/cuda.Dockerfile", "cuda_version": "13.3.0", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04" },
- { "tag": "cuda13", "dockerfile": ".devops/cuda.Dockerfile", "cuda_version": "13.3.0", "platforms": "linux/arm64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04-arm" },
- { "tag": "musa", "dockerfile": ".devops/musa.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04" },
- { "tag": "intel", "dockerfile": ".devops/intel.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04" },
- { "tag": "vulkan", "dockerfile": ".devops/vulkan.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04" },
- { "tag": "vulkan", "dockerfile": ".devops/vulkan.Dockerfile", "platforms": "linux/arm64", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04-arm" },
- { "tag": "rocm", "dockerfile": ".devops/rocm.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": true, "runs_on": "ubuntu-24.04" },
- { "tag": "openvino", "dockerfile": ".devops/openvino.Dockerfile", "platforms": "linux/amd64", "full": true, "light": true, "server": true, "free_disk_space": false, "runs_on": "ubuntu-24.04" }
- ]
- JSON
-
- if [ "${SKIP_S390X}" = "true" ]; then
- jq 'map(select(.platforms != "linux/s390x"))' build-matrix.json > build-matrix.json.tmp
- mv build-matrix.json.tmp build-matrix.json
- fi
-
- BUILD_MATRIX="$(jq -c . build-matrix.json)"
- MERGE_MATRIX="$(jq -c '
- reduce .[] as $entry ({}; .[$entry.tag] |= (
- . // {
- tag: $entry.tag,
- arches: [],
- full: false,
- light: false,
- server: false
- }
- | .full = (.full or ($entry.full // false))
- | .light = (.light or ($entry.light // false))
- | .server = (.server or ($entry.server // false))
- | .arches += [($entry.platforms | sub("^linux/"; ""))]
- ))
- # Backward compatibility: s390x tags are aliases of cpu for the linux/s390x platform.
- | if (has("cpu") and (((.cpu.arches // []) | index("s390x")) != null)) then
- . + {
- s390x: {
- tag: "s390x",
- arches: ["s390x"],
- full: .cpu.full,
- light: .cpu.light,
- server: .cpu.server
- }
- }
- else
- .
- end
- | [.[] | .arches = (.arches | unique | sort | join(" "))]
- ' build-matrix.json)"
-
- echo "build_matrix=$BUILD_MATRIX" >> "$GITHUB_OUTPUT"
- echo "merge_matrix=$MERGE_MATRIX" >> "$GITHUB_OUTPUT"
-
- push_to_registry:
- name: Push Docker image to Docker Registry
- needs: [prepare_matrices, create_tag, build_ui]
-
- runs-on: ${{ matrix.config.runs_on }}
- strategy:
- fail-fast: false
- matrix:
- config: ${{ fromJSON(needs.prepare_matrices.outputs.build_matrix) }}
- steps:
- - name: Check out the repo
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ needs.create_tag.outputs.source_tag }}
-
- - name: Download prebuilt UI
- if: ${{ matrix.config.prebuilt_ui == true }}
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
- with:
- name: ui-build
- path: tools/ui/dist
-
- - name: Set up QEMU
- if: ${{ contains(matrix.config.platforms, 'linux/amd64') }}
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
- with:
- image: tonistiigi/binfmt:qemu-v10.2.1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
-
- - name: Log in to Docker Registry
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Determine image metadata
- id: meta
- shell: bash
- run: |
- set -euo pipefail
-
- REPO_OWNER="${GITHUB_REPOSITORY_OWNER@L}" # to lower case
- REPO_NAME="${{ github.event.repository.name }}"
- IMAGE_REPO="ghcr.io/${REPO_OWNER}/${REPO_NAME}"
- PREFIX="${IMAGE_REPO}:"
- PLATFORM="${{ matrix.config.platforms }}"
- ARCH_SUFFIX="${PLATFORM#linux/}"
-
- # list all tags possible
- tags="${{ matrix.config.tag }}"
- for tag in $tags; do
- if [[ "$tag" == "cpu" ]]; then
- TYPE=""
- else
- TYPE="-$tag"
- fi
- CACHETAG="${PREFIX}buildcache${TYPE}-${ARCH_SUFFIX}"
- done
-
- SAFE_TAGS="$(echo "$tags" | tr ' ' '_')"
-
- echo "image_repo=$IMAGE_REPO" >> $GITHUB_OUTPUT
- echo "arch_suffix=$ARCH_SUFFIX" >> $GITHUB_OUTPUT
- echo "cache_output_tag=$CACHETAG" >> $GITHUB_OUTPUT
- echo "digest_artifact_suffix=${SAFE_TAGS}-${ARCH_SUFFIX}" >> $GITHUB_OUTPUT
- echo "cache_output_tag=$CACHETAG" # print out for debugging
- env:
- GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
-
- - name: Get build date
- id: build_date
- run: echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
-
- - name: Free Disk Space (Ubuntu)
- if: ${{ matrix.config.free_disk_space == true }}
- uses: ggml-org/free-disk-space@v1.3.1
- with:
- # this might remove tools that are actually needed,
- # if set to "true" but frees about 6 GB
- tool-cache: false
-
- # all of these default to true, but feel free to set to
- # "false" if necessary for your workflow
- android: true
- dotnet: true
- haskell: true
- large-packages: true
- docker-images: true
- swap-storage: true
-
- - name: Build and push Full Docker image by digest
- id: build_full
- if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.full == true }}
- uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
- with:
- context: .
- platforms: ${{ matrix.config.platforms }}
- outputs: type=image,name=${{ steps.meta.outputs.image_repo }},push-by-digest=true,name-canonical=true,push=true,oci-mediatypes=true
- file: ${{ matrix.config.dockerfile }}
- target: full
- provenance: false
- build-args: |
- BUILD_DATE=${{ steps.build_date.outputs.date }}
- APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
- APP_REVISION=${{ steps.checkout.outputs.commit }}
- IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
- IMAGE_SOURCE=${{ github.server_url }}/${{ github.repository }}
- ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
- ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
- annotations: |
- manifest:org.opencontainers.image.created=${{ steps.build_date.outputs.date }}
- manifest:org.opencontainers.image.version=${{ needs.create_tag.outputs.source_tag }}
- manifest:org.opencontainers.image.revision=${{ steps.checkout.outputs.commit }}
- manifest:org.opencontainers.image.title=llama.cpp
- manifest:org.opencontainers.image.description=LLM inference in C/C++
- manifest:org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
- manifest:org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
- # using github experimental cache
- #cache-from: type=gha
- #cache-to: type=gha,mode=max
- # return to this if the experimental github cache is having issues
- #cache-to: type=local,dest=/tmp/.buildx-cache
- #cache-from: type=local,src=/tmp/.buildx-cache
- # using registry cache (no storage limit)
- cache-from: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }}
- cache-to: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }},mode=max
-
- - name: Build and push Light Docker image by digest
- id: build_light
- if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }}
- uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
- with:
- context: .
- platforms: ${{ matrix.config.platforms }}
- outputs: type=image,name=${{ steps.meta.outputs.image_repo }},push-by-digest=true,name-canonical=true,push=true,oci-mediatypes=true
- file: ${{ matrix.config.dockerfile }}
- target: light
- provenance: false
- build-args: |
- BUILD_DATE=${{ steps.build_date.outputs.date }}
- APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
- APP_REVISION=${{ steps.checkout.outputs.commit }}
- IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
- IMAGE_SOURCE=${{ github.server_url }}/${{ github.repository }}
- ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
- ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
- annotations: |
- manifest:org.opencontainers.image.created=${{ steps.build_date.outputs.date }}
- manifest:org.opencontainers.image.version=${{ needs.create_tag.outputs.source_tag }}
- manifest:org.opencontainers.image.revision=${{ steps.checkout.outputs.commit }}
- manifest:org.opencontainers.image.title=llama.cpp
- manifest:org.opencontainers.image.description=LLM inference in C/C++
- manifest:org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
- manifest:org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
- # using github experimental cache
- #cache-from: type=gha
- #cache-to: type=gha,mode=max
- # return to this if the experimental github cache is having issues
- #cache-to: type=local,dest=/tmp/.buildx-cache
- #cache-from: type=local,src=/tmp/.buildx-cache
- # using registry cache (no storage limit)
- cache-from: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }}
- cache-to: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }},mode=max
-
- - name: Build and push Server Docker image by digest
- id: build_server
- if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }}
- uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
- with:
- context: .
- platforms: ${{ matrix.config.platforms }}
- outputs: type=image,name=${{ steps.meta.outputs.image_repo }},push-by-digest=true,name-canonical=true,push=true,oci-mediatypes=true
- file: ${{ matrix.config.dockerfile }}
- target: server
- provenance: false
- build-args: |
- BUILD_DATE=${{ steps.build_date.outputs.date }}
- APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
- APP_REVISION=${{ steps.checkout.outputs.commit }}
- IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
- IMAGE_SOURCE=${{ github.server_url }}/${{ github.repository }}
- ${{ matrix.config.ubuntu_version && format('UBUNTU_VERSION={0}', matrix.config.ubuntu_version) || '' }}
- ${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
- annotations: |
- manifest:org.opencontainers.image.created=${{ steps.build_date.outputs.date }}
- manifest:org.opencontainers.image.version=${{ needs.create_tag.outputs.source_tag }}
- manifest:org.opencontainers.image.revision=${{ steps.checkout.outputs.commit }}
- manifest:org.opencontainers.image.title=llama.cpp
- manifest:org.opencontainers.image.description=LLM inference in C/C++
- manifest:org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
- manifest:org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
- # using github experimental cache
- #cache-from: type=gha
- #cache-to: type=gha,mode=max
- # return to this if the experimental github cache is having issues
- #cache-to: type=local,dest=/tmp/.buildx-cache
- #cache-from: type=local,src=/tmp/.buildx-cache
- # using registry cache (no storage limit)
- cache-from: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }}
- cache-to: type=registry,ref=${{ steps.meta.outputs.cache_output_tag }},mode=max
-
- - name: Export digest metadata
- shell: bash
- run: |
- set -euo pipefail
-
- TAGS="${{ matrix.config.tag }}"
- ARCH_SUFFIX="${{ steps.meta.outputs.arch_suffix }}"
- DIGEST_FILE="/tmp/digests/${{ steps.meta.outputs.digest_artifact_suffix }}.tsv"
- mkdir -p /tmp/digests
-
- add_digest_rows() {
- local image_type="$1"
- local digest="$2"
-
- if [[ -z "$digest" ]]; then
- echo "Missing digest for image_type=${image_type}" >&2
- exit 1
- fi
-
- for tag in $TAGS; do
- printf '%s\t%s\t%s\t%s\n' "$tag" "$ARCH_SUFFIX" "$image_type" "$digest" >> "$DIGEST_FILE"
- done
- }
-
- if [[ "${{ matrix.config.full }}" == "true" ]]; then
- add_digest_rows "full" "${{ steps.build_full.outputs.digest }}"
- fi
-
- if [[ "${{ matrix.config.light }}" == "true" ]]; then
- add_digest_rows "light" "${{ steps.build_light.outputs.digest }}"
- fi
-
- if [[ "${{ matrix.config.server }}" == "true" ]]; then
- add_digest_rows "server" "${{ steps.build_server.outputs.digest }}"
- fi
-
- - name: Upload digest metadata
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
- with:
- name: digests-${{ steps.meta.outputs.digest_artifact_suffix }}
- path: /tmp/digests/${{ steps.meta.outputs.digest_artifact_suffix }}.tsv
- if-no-files-found: error
-
- merge_arch_tags:
- name: Create shared tags from digests
- needs: [prepare_matrices, push_to_registry, create_tag]
- runs-on: ubuntu-24.04
- strategy:
- fail-fast: false
- matrix:
- config: ${{ fromJSON(needs.prepare_matrices.outputs.merge_matrix) }}
-
- steps:
- - name: Check out the repo
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Get build date
- id: build_date
- run: echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
-
- - name: Download digest metadata
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
- with:
- pattern: digests-*
- path: /tmp/digests
- merge-multiple: true
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
-
- - name: Log in to Docker Registry
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Create tags from digests
- shell: bash
- run: |
- set -euo pipefail
-
- REPO_OWNER="${GITHUB_REPOSITORY_OWNER@L}" # to lower case
- REPO_NAME="${{ github.event.repository.name }}"
- IMAGE_REPO="ghcr.io/${REPO_OWNER}/${REPO_NAME}"
- PREFIX="${IMAGE_REPO}:"
- SRC_TAG="${{ needs.create_tag.outputs.source_tag }}"
- BUILD_DATE="${{ steps.build_date.outputs.date }}"
- COMMIT_SHA="${{ steps.checkout.outputs.commit }}"
- TAGS="${{ matrix.config.tag }}"
- ARCHES="${{ matrix.config.arches }}"
- DIGEST_GLOB="/tmp/digests/*.tsv"
-
- if ! ls ${DIGEST_GLOB} >/dev/null 2>&1; then
- echo "No digest metadata found in /tmp/digests" >&2
- exit 1
- fi
-
- if [[ -z "$SRC_TAG" ]]; then
- echo "Missing source tag from create_tag" >&2
- exit 1
- fi
-
- find_digest() {
- local tag_name="$1"
- local arch="$2"
- local image_type="$3"
- local digest
-
- digest="$(awk -F '\t' -v t="$tag_name" -v a="$arch" -v i="$image_type" '$1 == t && $2 == a && $3 == i { print $4; exit }' ${DIGEST_GLOB})"
-
- # Backward compatibility: s390x tags are aliases of cpu for the linux/s390x platform.
- if [[ -z "$digest" && "$tag_name" == "s390x" && "$arch" == "s390x" ]]; then
- digest="$(awk -F '\t' -v t="cpu" -v a="$arch" -v i="$image_type" '$1 == t && $2 == a && $3 == i { print $4; exit }' ${DIGEST_GLOB})"
- fi
-
- if [[ -z "$digest" ]]; then
- echo "Missing digest for tag=${tag_name} arch=${arch} image_type=${image_type}" >&2
- exit 1
- fi
-
- echo "$digest"
- }
-
- create_manifest_tags() {
- local image_type="$1"
- local tag_name="$2"
- local suffix="$3"
-
- local merged_tag="${PREFIX}${image_type}${suffix}"
- local merged_versioned_tag="${merged_tag}-${SRC_TAG}"
-
- local refs=()
-
- for arch in $ARCHES; do
- local digest
- digest="$(find_digest "$tag_name" "$arch" "$image_type")"
- refs+=("${IMAGE_REPO}@${digest}")
- done
-
- local annotations=(
- --annotation "index:org.opencontainers.image.created=${BUILD_DATE}"
- --annotation "index:org.opencontainers.image.version=${SRC_TAG}"
- --annotation "index:org.opencontainers.image.revision=${COMMIT_SHA}"
- --annotation "index:org.opencontainers.image.title=llama.cpp"
- --annotation "index:org.opencontainers.image.description=LLM inference in C/C++"
- --annotation "index:org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}"
- --annotation "index:org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}"
- )
-
- echo "Creating ${merged_tag} from ${refs[*]}"
- docker buildx imagetools create "${annotations[@]}" --tag "${merged_tag}" "${refs[@]}"
-
- echo "Creating ${merged_versioned_tag} from ${refs[*]}"
- docker buildx imagetools create "${annotations[@]}" --tag "${merged_versioned_tag}" "${refs[@]}"
- }
-
- for tag in $TAGS; do
- if [[ "$tag" == "cpu" ]]; then
- TYPE=""
- else
- TYPE="-$tag"
- fi
-
- if [[ "${{ matrix.config.full }}" == "true" ]]; then
- create_manifest_tags "full" "$tag" "$TYPE"
- fi
-
- if [[ "${{ matrix.config.light }}" == "true" ]]; then
- create_manifest_tags "light" "$tag" "$TYPE"
- fi
-
- if [[ "${{ matrix.config.server }}" == "true" ]]; then
- create_manifest_tags "server" "$tag" "$TYPE"
- fi
- done
- env:
- GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml
deleted file mode 100644
index 59159cd..0000000
--- a/.github/workflows/editorconfig.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: EditorConfig Checker
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- editorconfig:
- runs-on: [self-hosted, fast]
- steps:
- - uses: actions/checkout@v6
- - uses: editorconfig-checker/action-editorconfig-checker@840e866d93b8e032123c23bac69dece044d4d84c # v2.2.0
- with:
- version: v3.0.3
- - run: editorconfig-checker
diff --git a/.github/workflows/gguf-publish.yml b/.github/workflows/gguf-publish.yml
deleted file mode 100644
index fb8eab3..0000000
--- a/.github/workflows/gguf-publish.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-# This workflow will upload a Python Package using Twine when a GGUF release is created
-# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
-
-# See `gguf-py/README.md` for how to make a release.
-
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
-name: Upload Python Package
-
-on:
- workflow_dispatch:
- push:
- # Pattern matched against refs/tags
- tags:
- - 'gguf-v*' # Push events to every version tag
-
-
-jobs:
- deploy:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v6
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- pip-install: poetry==2.4.0
- - name: Install dependencies
- run: |
- cd gguf-py
- poetry install
-
- - name: Build package
- run: cd gguf-py && poetry build
- - name: Publish package
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
- with:
- password: ${{ secrets.PYPI_API_TOKEN }}
- packages-dir: gguf-py/dist
diff --git a/.github/workflows/hip-quality-check.yml b/.github/workflows/hip-quality-check.yml
deleted file mode 100644
index 5d23f01..0000000
--- a/.github/workflows/hip-quality-check.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-name: HIP quality check
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/hip-quality-check.yml',
- '**/*.cu',
- '**/*.cuh',
- 'ggml/src/ggml-hip/CMakeLists.txt',
- 'ggml/src/ggml-cuda/vendors/hip.h',
- 'scripts/hip/gcn-cdna-vgpr-check.py'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/hip-quality-check.yml',
- '**/*.cu',
- '**/*.cuh',
- 'ggml/src/ggml-hip/CMakeLists.txt',
- 'ggml/src/ggml-cuda/vendors/hip.h',
- 'scripts/hip/gcn-cdna-vgpr-check.py'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-env:
- GGML_NLOOP: 3
- GGML_N_THREADS: 1
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
-
-jobs:
- ubuntu-22-hip-quality-check:
- runs-on: ubuntu-22.04
- container: rocm/dev-ubuntu-22.04:7.2.1
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libssl-dev python3
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: hip-quality-check-ubuntu-22.04
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build with Werror
- id: cmake_build
- run: |
- cmake -B build -S . \
- -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
- -DGPU_TARGETS=gfx942 \
- -DGGML_HIP=ON \
- -DGGML_HIP_EXPORT_METRICS=Off \
- -DCMAKE_HIP_FLAGS="-Werror -Wno-tautological-compare" \
- -DCMAKE_BUILD_TYPE=Release
- cd build
- make -j $(nproc)
-
- - name: Check for major VGPR spills
- id: vgpr_check
- run: |
- cmake -B build -S . \
- -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
- -DGPU_TARGETS=gfx908 \
- -DGGML_HIP=ON \
- -DGGML_HIP_EXPORT_METRICS=On \
- -DCMAKE_HIP_FLAGS="" \
- -DCMAKE_BUILD_TYPE=Release
- cd build
- make -j $(nproc) 2>&1 | tee metrics.log | grep -v 'Rpass-analysis=kernel-resource-usage\|remark:\|^$'
- python3 ../scripts/hip/gcn-cdna-vgpr-check.py metrics.log
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
deleted file mode 100644
index eab20c6..0000000
--- a/.github/workflows/labeler.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: "Pull Request Labeler"
-on:
-- pull_request_target
-
-jobs:
- labeler:
- permissions:
- contents: read
- pull-requests: write
- runs-on: ubuntu-slim
- steps:
- - uses: actions/checkout@v6
- with:
- repository: "ggml-org/llama.cpp"
- - uses: actions/labeler@v6
- with:
- configuration-path: '.github/labeler.yml'
diff --git a/.github/workflows/pre-tokenizer-hashes.yml b/.github/workflows/pre-tokenizer-hashes.yml
deleted file mode 100644
index 3e440b6..0000000
--- a/.github/workflows/pre-tokenizer-hashes.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Check Pre-Tokenizer Hashes
-
-on:
- push:
- paths:
- - 'conversion/base.py'
- - 'convert_hf_to_gguf_update.py'
- pull_request:
- paths:
- - 'conversion/base.py'
- - 'convert_hf_to_gguf_update.py'
-
-jobs:
- pre-tokenizer-hashes:
- runs-on: [self-hosted, fast]
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install Python dependencies
- run: |
- python3 -m venv .venv
- .venv/bin/pip install -r requirements/requirements-convert_hf_to_gguf_update.txt
-
- - name: Update pre-tokenizer hashes
- run: |
- cp conversion/base.py /tmp
- .venv/bin/python convert_hf_to_gguf_update.py --check-missing
-
- - name: Check if committed pre-tokenizer hashes matches generated version
- run: |
- if ! diff -q conversion/base.py /tmp/base.py; then
- echo "Model pre-tokenizer hashes (in conversion/base.py) do not match generated hashes (from convert_hf_to_gguf_update.py)."
- echo "To fix: run ./convert_hf_to_gguf_update.py and commit the updated conversion/base.py along with your changes"
- echo "Differences found:"
- diff conversion/base.py /tmp/base.py || true
- exit 1
- fi
- echo "Model pre-tokenizer hashes are up to date."
diff --git a/.github/workflows/python-check-requirements.yml b/.github/workflows/python-check-requirements.yml
deleted file mode 100644
index 2c7fab4..0000000
--- a/.github/workflows/python-check-requirements.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Python check requirements.txt
-
-on:
- push:
- paths:
- - '.github/workflows/python-check-requirements.yml'
- - 'scripts/check-requirements.sh'
- - 'convert*.py'
- - '**/requirements*.txt'
- pull_request:
- paths:
- - '.github/workflows/python-check-requirements.yml'
- - 'scripts/check-requirements.sh'
- - 'convert*.py'
- - '**/requirements*.txt'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- python-check-requirements:
- runs-on: [self-hosted, CPU, fast]
- name: check-requirements
- steps:
- - name: Check out source repository
- uses: actions/checkout@v6
- - name: Set up Python environment
- uses: actions/setup-python@v6
- with:
- python-version: "3.11"
- - name: Run check-requirements.sh script
- run: bash scripts/check-requirements.sh
diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml
deleted file mode 100644
index 0424f37..0000000
--- a/.github/workflows/python-lint.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: flake8 Lint
-
-on:
- push:
- branches:
- - master
- paths: [
- '.github/workflows/python-lint.yml',
- '**/*.py'
- ]
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/python-lint.yml',
- '**/*.py'
- ]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- flake8-lint:
- runs-on: [self-hosted, fast]
- name: Lint
- steps:
- - name: Check out source repository
- uses: actions/checkout@v6
- - name: Set up Python environment
- uses: actions/setup-python@v6
- with:
- python-version: "3.11"
- - name: flake8 Lint
- uses: py-actions/flake8@84ec6726560b6d5bd68f2a5bed83d62b52bb50ba # v2
- with:
- plugins: "flake8-no-print"
diff --git a/.github/workflows/python-type-check.yml b/.github/workflows/python-type-check.yml
deleted file mode 100644
index 14edb1a..0000000
--- a/.github/workflows/python-type-check.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: Python Type-Check
-
-on:
- push:
- paths:
- - '.github/workflows/python-type-check.yml'
- - 'ty.toml'
- - '**.py'
- - '**/requirements*.txt'
- # - 'pyrightconfig.json'
- pull_request:
- paths:
- - '.github/workflows/python-type-check.yml'
- - 'ty.toml'
- - '**.py'
- - '**/requirements*.txt'
- # - 'pyrightconfig.json'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- python-type-check:
- runs-on: [self-hosted, fast]
- name: python type-check
- steps:
- - name: Check out source repository
- uses: actions/checkout@v6
- - name: Set up Python environment
- uses: actions/setup-python@v6
- with:
- python-version: "3.11"
- pip-install: -r requirements/requirements-all.txt ty==0.0.35
- # - name: Type-check with Pyright
- # uses: jakebailey/pyright-action@v2
- # with:
- # version: 1.1.382
- # level: warning
- # warnings: true
- - name: Type-check with ty
- run: |
- ty check --output-format=github
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 778574c..0000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,1732 +0,0 @@
-name: Release
-
-on:
- workflow_dispatch: # allows manual triggering
- inputs:
- create_release:
- description: 'Create new release'
- required: true
- type: boolean
- push:
- branches:
- - master
- paths: [
- '.github/workflows/release.yml',
- '**/CMakeLists.txt',
- '**/.cmake',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.cuh',
- '**/*.swift',
- '**/*.m',
- '**/*.metal',
- '**/*.comp',
- '**/*.glsl'
- ]
-
-env:
- GH_TOKEN: ${{ github.token }}
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
- CMAKE_ARGS: "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON"
-
-# note: run this workflow one at a time for better cache reuse
-concurrency:
- group: release
- queue: max
-
-jobs:
- check-release:
- runs-on: ubuntu-slim
-
- outputs:
- should_release: ${{ steps.check.outputs.should_release }}
-
- steps:
- - id: check
- env:
- COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
- run: |
- if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "should_release=true" >> $GITHUB_OUTPUT
- elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then
- if echo "$COMMIT_MESSAGE" | grep -q '\[no release\]'; then
- echo "should_release=false" >> $GITHUB_OUTPUT
- else
- echo "should_release=true" >> $GITHUB_OUTPUT
- fi
- else
- echo "should_release=false" >> $GITHUB_OUTPUT
- fi
-
- get-version:
- runs-on: ubuntu-slim
- outputs:
- ui_version: ${{ steps.version.outputs.ui_version }}
- steps:
- - uses: actions/checkout@v6
- with:
- fetch-depth: 0
- - id: version
- run: |
- # Resolve UI version: BUILD_NUMBER from cmake/build-info.cmake > git hash + epoch > fallback
- version=""
- if grep -q "BUILD_NUMBER" cmake/build-info.cmake; then
- build_number=$(grep "set(BUILD_NUMBER" cmake/build-info.cmake | grep -oP '\d+')
- if [ -n "$build_number" ] && [ "$build_number" -gt 0 ]; then
- version="b${build_number}"
- fi
- fi
- if [ -z "$version" ]; then
- version=$(git rev-parse --short HEAD)-$(date +%s)
- fi
- echo "ui_version=${version}" >> $GITHUB_OUTPUT
-
- macos-cpu:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
- strategy:
- matrix:
- include:
- - build: 'arm64'
- arch: 'arm64'
- os: macos-26
- defines: "-DGGML_METAL_USE_BF16=ON -DGGML_METAL_EMBED_LIBRARY=ON"
- # TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23780)
- # in order to enable it again, we have to provision dedicated runners to run it
- #- build: 'arm64-kleidiai'
- # arch: 'arm64'
- # os: macos-14
- # defines: "-DGGML_METAL_USE_BF16=ON -DGGML_METAL_EMBED_LIBRARY=ON -DGGML_CPU_KLEIDIAI=ON"
- - build: 'x64'
- arch: 'x64'
- os: macos-15-intel
- # Metal is disabled on x64 due to intermittent failures with Github runners not having a GPU:
- # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
- defines: "-DGGML_METAL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3"
-
- runs-on: ${{ matrix.os }}
-
- permissions:
- actions: write
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-${{ matrix.os }}-${{ matrix.arch }}
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build \
- ${{ matrix.defines }} \
- -DCMAKE_INSTALL_RPATH='@loader_path' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-${{ matrix.os }}-${{ matrix.arch }}
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- cp LICENSE ./build/bin/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz
- name: llama-bin-macos-${{ matrix.build }}.tar.gz
-
- ubuntu-cpu:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
- strategy:
- matrix:
- include:
- - build: 'x64'
- os: ubuntu-22.04
- - build: 'arm64'
- os: ubuntu-24.04-arm
- - build: 's390x'
- os: ubuntu-24.04-s390x
-
- runs-on: ${{ matrix.os }}
-
- permissions:
- actions: write
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev
-
- - name: Toolchain workaround (GCC 14)
- if: ${{ contains(matrix.os, 'ubuntu-24.04') }}
- run: |
- sudo apt-get install -y gcc-14 g++-14
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
-
- - name: ccache
- if: ${{ matrix.build != 's390x' }}
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-${{ matrix.os }}-cpu
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_INSTALL_RPATH='$ORIGIN' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DGGML_BACKEND_DL=ON \
- -DGGML_NATIVE=OFF \
- -DGGML_CPU_ALL_VARIANTS=ON \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release -j $(nproc)
-
- - name: ccache-clear
- if: ${{ matrix.build != 's390x' }}
- uses: ./.github/actions/ccache-clear
- with:
- key: release-${{ matrix.os }}-cpu
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- cp LICENSE ./build/bin/
- tar -czvf llama-${{ steps.tag.outputs.name }}-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-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz
- name: llama-bin-ubuntu-${{ matrix.build }}.tar.gz
-
- ubuntu-vulkan:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- strategy:
- matrix:
- include:
- - build: 'x64'
- os: ubuntu-22.04
- - build: 'arm64'
- os: ubuntu-24.04-arm
-
- runs-on: ${{ matrix.os }}
-
- permissions:
- actions: write
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Dependencies
- id: depends
- run: |
- if [[ "${{ matrix.os }}" =~ "ubuntu-22.04" ]]; then
- 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 mesa-vulkan-drivers vulkan-sdk libssl-dev
- else
- sudo apt-get update -y
- sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build
- echo "CC=gcc-14" >> "$GITHUB_ENV"
- echo "CXX=g++-14" >> "$GITHUB_ENV"
- fi
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-${{ matrix.os }}-vulkan
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_INSTALL_RPATH='$ORIGIN' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DGGML_BACKEND_DL=ON \
- -DGGML_NATIVE=OFF \
- -DGGML_CPU_ALL_VARIANTS=ON \
- -DGGML_VULKAN=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release -j $(nproc)
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-${{ matrix.os }}-vulkan
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- cp LICENSE ./build/bin/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ 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-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
- name: llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
-
- android-arm64:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: ubuntu-latest
-
- #permissions:
- # actions: write
-
- env:
- NDK_VERSION: "29.0.14206865"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Set up JDK
- uses: actions/setup-java@v5
- with:
- java-version: 17
- distribution: temurin
-
- - name: Setup Android SDK
- uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
- with:
- log-accepted-android-sdk-licenses: false
-
- - name: Install NDK
- run: |
- sdkmanager "ndk;${{ env.NDK_VERSION }}"
- echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV
-
- # note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789)
- # for some reason, the ccache does not improve the build time in this case
- # example:
- # cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831
- # cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394
- #
- #- name: ccache
- # uses: ggml-org/ccache-action@v1.2.21
- # with:
- # key: release-android-arm64
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
- -DANDROID_ABI=arm64-v8a \
- -DANDROID_PLATFORM=android-28 \
- -DCMAKE_INSTALL_RPATH='$ORIGIN' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DGGML_BACKEND_DL=ON \
- -DGGML_NATIVE=OFF \
- -DGGML_CPU_ALL_VARIANTS=ON \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DGGML_OPENMP=OFF \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release -j $(nproc)
-
- #- name: ccache-clear
- # uses: ./.github/actions/ccache-clear
- # with:
- # key: release-android-arm64
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- cp LICENSE ./build/bin/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz
- name: llama-bin-android-arm64.tar.gz
-
- ubuntu-24-openvino:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: ubuntu-24.04
-
- permissions:
- actions: write
-
- outputs:
- openvino_version: ${{ steps.openvino_version.outputs.value }}
-
- env:
- # Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Set OpenVINO version output
- id: openvino_version
- run: echo "value=${{ env.OPENVINO_VERSION_MAJOR }}" >> $GITHUB_OUTPUT
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-ubuntu-24.04-openvino-release-no-preset-v1
-
- - name: Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential libssl-dev libtbb12 cmake ninja-build python3-pip
- sudo apt install ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers intel-opencl-icd
-
- - name: Use OpenVINO Toolkit Cache
- uses: actions/cache@v5
- id: cache-openvino
- with:
- path: ./openvino_toolkit
- key: cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
-
- - name: Setup OpenVINO Toolkit
- if: steps.cache-openvino.outputs.cache-hit != 'true'
- uses: ./.github/actions/linux-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- - name: Install OpenVINO dependencies
- run: |
- cd ./openvino_toolkit
- chmod +x ./install_dependencies/install_openvino_dependencies.sh
- echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
-
- - name: Build
- id: cmake_build
- run: |
- source ./openvino_toolkit/setupvars.sh
- cmake -B build/ReleaseOV -G Ninja \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_OPENVINO=ON \
- -DCMAKE_INSTALL_RPATH='$ORIGIN' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build/ReleaseOV --config Release --parallel
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-ubuntu-24.04-openvino-release-no-preset-v1
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- dest=./build/ReleaseOV/bin
- OPENVINO_ROOT=./openvino_toolkit
- ov_lib="$OPENVINO_ROOT/runtime/lib/intel64"
-
- # Bundle OpenVINO runtime libs + TBB. Binaries built with RPATH=$ORIGIN
- # load these siblings without setupvars.sh / LD_LIBRARY_PATH.
- cp -P "$ov_lib"/libopenvino.so* \
- "$ov_lib"/libopenvino_c.so* \
- "$ov_lib"/libopenvino_*_plugin.so \
- "$ov_lib"/libopenvino_intel_npu_compiler*.so \
- "$OPENVINO_ROOT"/runtime/3rdparty/tbb/lib/*.so* \
- "$dest"
- cp -P /usr/lib/x86_64-linux-gnu/libOpenCL.so.1* "$dest" 2>/dev/null || true
- cp "$ov_lib"/cache.json "$dest" 2>/dev/null || true
-
- # OpenVINO licensing
- cp -r "$OPENVINO_ROOT"/docs/licensing "$dest"/openvino-licensing
-
- cp LICENSE "$dest"
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C "$dest" .
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz
- name: llama-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz
-
- windows-openvino:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2022
-
- outputs:
- openvino_version: ${{ steps.openvino_version.outputs.value }}
-
- env:
- # Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.2.1"
- OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
-
- steps:
- - name: Set OpenVINO version output
- id: openvino_version
- shell: bash
- run: echo "value=${{ env.OPENVINO_VERSION_MAJOR }}" >> $GITHUB_OUTPUT
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2022-openvino
- variant: ccache
- evict-old-files: 1d
-
- - name: Setup Cache
- uses: actions/cache@v5
- id: cache-openvino
- with:
- path: ./openvino_toolkit
- key: cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
-
- - name: Setup OpenVINO Toolkit
- if: steps.cache-openvino.outputs.cache-hit != 'true'
- uses: ./.github/actions/windows-setup-openvino
- with:
- path: ./openvino_toolkit
- version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
- version_full: ${{ env.OPENVINO_VERSION_FULL }}
-
- - name: Install OpenCL using vcpkg
- shell: powershell
- run: |
- git clone https://github.com/microsoft/vcpkg C:\vcpkg
- C:\vcpkg\bootstrap-vcpkg.bat
- C:\vcpkg\vcpkg install opencl
-
- - name: Build
- id: cmake_build
- shell: cmd
- run: |
- REM Find extracted OpenVINO folder dynamically
- for /d %%i in (openvino_toolkit\*) do set OPENVINO_ROOT=%%i
-
- if not exist "%OPENVINO_ROOT%\runtime\cmake\OpenVINOConfig.cmake" (
- echo ERROR: OpenVINOConfig.cmake not found
- exit /b 1
- )
-
- call "%OPENVINO_ROOT%\setupvars.bat"
-
- cmake -B build\ReleaseOV -G "Visual Studio 17 2022" ^
- -A x64 ^
- -DCMAKE_BUILD_TYPE=Release ^
- -DGGML_OPENVINO=ON ^
- -DLLAMA_BUILD_BORINGSSL=ON ^
- -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^
- ${{ env.CMAKE_ARGS }}
-
- cmake --build build\ReleaseOV --config Release -- /m
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2022-openvino
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- shell: powershell
- run: |
- # Locate the extracted OpenVINO toolkit root (same pattern as the Build step).
- $OPENVINO_ROOT = (Get-ChildItem -Directory openvino_toolkit | Select-Object -First 1).FullName
- if (-not $OPENVINO_ROOT) {
- Write-Error "OpenVINO toolkit folder not found under .\openvino_toolkit"
- exit 1
- }
-
- $dest = ".\build\ReleaseOV\bin\Release"
-
- $ovBin = Join-Path $OPENVINO_ROOT 'runtime\bin\intel64\Release'
- Copy-Item -Path (Join-Path $ovBin '*.dll') -Destination $dest -Force
- Copy-Item -Path (Join-Path $ovBin 'cache.json') -Destination $dest -Force
-
- $tbbBin = Join-Path $OPENVINO_ROOT 'runtime\3rdparty\tbb\bin'
- Copy-Item -Path (Join-Path $tbbBin 'tbb*.dll') -Destination $dest -Force
-
- # OpenVINO licensing
- $licensingDest = Join-Path $dest 'openvino-licensing'
- New-Item -ItemType Directory -Force -Path $licensingDest | Out-Null
- Copy-Item -Path (Join-Path $OPENVINO_ROOT 'docs\licensing\*') -Destination $licensingDest -Recurse -Force
-
- Copy-Item LICENSE $dest
- 7z a -snl llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip $dest\*
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip
- name: llama-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip
-
- windows-cpu:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2025-vs2026
-
- permissions:
- actions: write
-
- strategy:
- matrix:
- include:
- - arch: 'x64'
- - arch: 'arm64'
-
- steps:
- - name: Clone
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install Ninja
- run: |
- choco install ninja
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2025-vs2026-${{ matrix.arch }}-cpu
-
- - name: Build
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }}
- cmake -S . -B build -G "Ninja Multi-Config" ^
- -D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-windows-llvm.cmake ^
- -DLLAMA_BUILD_BORINGSSL=ON ^
- -DGGML_NATIVE=OFF ^
- -DGGML_BACKEND_DL=ON ^
- -DGGML_CPU_ALL_VARIANTS=${{ matrix.arch == 'x64' && 'ON' || 'OFF' }} ^
- -DGGML_OPENMP=ON ^
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2025-vs2026-${{ matrix.arch }}-cpu
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- Copy-Item "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Redist\MSVC\14.51.36231\debug_nonredist\${{ matrix.arch }}\Microsoft.VC145.OpenMP.LLVM\libomp140.${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}.dll" .\build\bin\Release\
- 7z a -snl llama-bin-win-cpu-${{ matrix.arch }}.zip .\build\bin\Release\*
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-bin-win-cpu-${{ matrix.arch }}.zip
- name: llama-bin-win-cpu-${{ matrix.arch }}.zip
-
- windows:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2025
-
- permissions:
- actions: write
-
- env:
- OPENBLAS_VERSION: 0.3.23
- VULKAN_VERSION: 1.4.313.2
-
- strategy:
- matrix:
- include:
- - backend: 'vulkan'
- arch: 'x64'
- defines: '-DGGML_VULKAN=ON'
- target: 'ggml-vulkan'
- - backend: 'opencl-adreno'
- arch: 'arm64'
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON'
- target: 'ggml-opencl'
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install Vulkan SDK
- id: get_vulkan
- if: ${{ matrix.backend == 'vulkan' }}
- 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: Install Ninja
- id: install_ninja
- run: |
- choco install ninja
-
- # TODO: these jobs need to use llvm toolchain in order to utilize the ccache
- #- name: ccache
- # uses: ggml-org/ccache-action@v1.2.21
- # with:
- # key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }}
-
- - name: Install OpenCL Headers and Libs
- id: install_opencl
- if: ${{ matrix.backend == 'opencl-adreno' && matrix.arch == 'arm64' }}
- run: |
- git clone https://github.com/KhronosGroup/OpenCL-Headers
- cd OpenCL-Headers
- cmake -B build `
- -DBUILD_TESTING=OFF `
- -DOPENCL_HEADERS_BUILD_TESTING=OFF `
- -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF `
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
- cmake --build build --target install
- git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
- cd OpenCL-ICD-Loader
- cmake -B build-arm64-release `
- -A arm64 `
- -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" `
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
- cmake --build build-arm64-release --target install --config release
-
- - name: Build
- id: cmake_build
- run: |
- cmake -S . -B build ${{ matrix.defines }} -DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_BACKEND_DL=ON -DLLAMA_BUILD_BORINGSSL=ON
- cmake --build build --config Release --target ${{ matrix.target }}
-
- #- name: ccache-clear
- # uses: ./.github/actions/ccache-clear
- # with:
- # key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }}
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- 7z a -snl llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip .\build\bin\Release\${{ matrix.target }}.dll
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
- name: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
-
- windows-cuda:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2022
-
- permissions:
- actions: write
-
- strategy:
- matrix:
- cuda: ['12.4', '13.3']
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install Cuda Toolkit
- uses: ./.github/actions/windows-setup-cuda
- with:
- cuda_version: ${{ matrix.cuda }}
-
- - name: Install Ninja
- id: install_ninja
- run: |
- choco install ninja
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
-
- - name: Build
- id: cmake_build
- shell: cmd
- # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
- cmake -S . -B build -G "Ninja Multi-Config" ^
- -DGGML_BACKEND_DL=ON ^
- -DGGML_NATIVE=OFF ^
- -DGGML_CPU=OFF ^
- -DGGML_CUDA=ON ^
- -DLLAMA_BUILD_BORINGSSL=ON ^
- -DGGML_CUDA_CUB_3DOT2=ON
- set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
- cmake --build build --config Release -j %NINJA_JOBS% --target ggml-cuda
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- 7z a -snl llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip .\build\bin\Release\ggml-cuda.dll
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip
- name: llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip
-
- - name: Copy and pack Cuda runtime
- run: |
- echo "Cuda install location: ${{ env.CUDA_PATH }}"
- $dst='.\build\bin\cudart\'
- robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
- robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
- robocopy "${{env.CUDA_PATH}}\bin\x64" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
- 7z a cudart-llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip $dst\*
-
- - name: Upload Cuda runtime
- uses: actions/upload-artifact@v6
- with:
- path: cudart-llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip
- name: cudart-llama-bin-win-cuda-${{ matrix.cuda }}-x64.zip
-
- windows-sycl:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2022
-
- defaults:
- run:
- shell: bash
-
- env:
- WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b60765d1-2b85-4e85-86b6-cb0e9563a699/intel-deep-learning-essentials-2025.3.3.18_offline.exe
- WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
- LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip
- ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Download & Install oneAPI
- shell: bash
- run: |
- scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
-
- - name: Install Level Zero SDK
- shell: pwsh
- run: |
- Invoke-WebRequest -Uri "${{ env.LEVEL_ZERO_SDK_URL }}" -OutFile "level-zero-win-sdk.zip"
- Expand-Archive -Path "level-zero-win-sdk.zip" -DestinationPath "C:/level-zero-sdk" -Force
- "LEVEL_ZERO_V1_SDK_PATH=C:/level-zero-sdk" | Out-File -FilePath $env:GITHUB_ENV -Append
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2022-x64-sycl
-
- - name: Build
- id: cmake_build
- shell: cmd
- run: |
- call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force
- cmake -G "Ninja" -B build ^
- -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx ^
- -DCMAKE_BUILD_TYPE=Release ^
- -DGGML_BACKEND_DL=ON -DBUILD_SHARED_LIBS=ON ^
- -DGGML_CPU=OFF -DGGML_SYCL=ON ^
- -DLLAMA_BUILD_BORINGSSL=ON
- cmake --build build --target ggml-sycl -j %NUMBER_OF_PROCESSORS%
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2022-x64-sycl
-
- - name: Build the release package
- id: pack_artifacts
- run: |
- echo "cp oneAPI running time dll files in ${{ env.ONEAPI_ROOT }} to ./build/bin"
-
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.5.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.2.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.2.dll" ./build/bin
-
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero_v2.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_opencl.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin
- ZE_LOADER_DLL=$(find "${{ env.ONEAPI_ROOT }}" "$LEVEL_ZERO_V1_SDK_PATH" -iname ze_loader.dll -print -quit 2>/dev/null || true)
- if [ -n "$ZE_LOADER_DLL" ]; then
- echo "Using Level Zero loader: $ZE_LOADER_DLL"
- cp "$ZE_LOADER_DLL" ./build/bin
- else
- echo "Level Zero loader DLL not found in oneAPI or SDK; relying on system driver/runtime"
- fi
-
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl8.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl-ls.exe" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libsycl-fallback-bfloat16.spv" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libsycl-native-bfloat16.spv" ./build/bin
-
- cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin
-
- cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/tcm.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/libhwloc-15.dll" ./build/bin
- cp "${{ env.ONEAPI_ROOT }}/umf/latest/bin/umf.dll" ./build/bin
-
- echo "cp oneAPI running time dll files to ./build/bin done"
- 7z a -snl llama-bin-win-sycl-x64.zip ./build/bin/*
-
- - name: Upload the release package
- uses: actions/upload-artifact@v6
- with:
- path: llama-bin-win-sycl-x64.zip
- name: llama-bin-win-sycl-x64.zip
-
- ubuntu-24-sycl:
- needs: [check-release]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- strategy:
- matrix:
- build: [fp32, fp16]
- include:
- - build: fp32
- fp16: OFF
- - build: fp16
- fp16: ON
-
- runs-on: ubuntu-24.04
-
- env:
- ONEAPI_ROOT: /opt/intel/oneapi/
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
- LEVEL_ZERO_VERSION: "1.28.2"
- LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Download & Install oneAPI
- shell: bash
- run: |
- cd /tmp
- wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/56f7923a-adb8-43f3-8b02-2b60fcac8cab/intel-deep-learning-essentials-2025.3.3.16_offline.sh -O intel-deep-learning-essentials_offline.sh
- sudo bash intel-deep-learning-essentials_offline.sh -s -a --silent --eula accept
-
- - name: Install Level Zero SDK
- shell: bash
- run: |
- cd /tmp
- wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero.deb
- wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero-devel_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero-devel.deb
- sudo apt-get install -y ./level-zero.deb ./level-zero-devel.deb
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-ubuntu-24.04-sycl-${{ matrix.build }}
-
- - name: Build
- id: cmake_build
- run: |
- source /opt/intel/oneapi/setvars.sh
- cmake -B build \
- -G "Ninja" \
- -DCMAKE_BUILD_TYPE=Release \
- -DGGML_SYCL=ON \
- -DCMAKE_C_COMPILER=icx \
- -DCMAKE_CXX_COMPILER=icpx \
- -DCMAKE_INSTALL_RPATH='$ORIGIN' \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DLLAMA_OPENSSL=OFF \
- -DGGML_NATIVE=OFF \
- -DGGML_SYCL_F16=${{ matrix.fp16 }}
- time cmake --build build --config Release -j $(nproc)
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-ubuntu-24.04-sycl-${{ matrix.build }}
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- cp LICENSE ./build/bin/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz
- name: llama-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz
-
- ubuntu-22-rocm:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: ubuntu-22.04
-
- permissions:
- actions: write
-
- strategy:
- matrix:
- include:
- - ROCM_VERSION: "7.2.1"
- gpu_targets: "gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1151;gfx1150;gfx1200;gfx1201"
- build: 'x64'
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Free up disk space
- uses: ggml-org/free-disk-space@v1.3.1
- with:
- tool-cache: true
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }}
-
- - name: Dependencies
- id: depends
- run: |
- sudo apt install -y build-essential git cmake wget
-
- - name: Setup Legacy ROCm
- if: matrix.ROCM_VERSION == '7.2.1'
- id: legacy_env
- run: |
- 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
-
- sudo tee /etc/apt/sources.list.d/rocm.list << EOF
- deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ matrix.ROCM_VERSION }} jammy main
- EOF
-
- sudo tee /etc/apt/preferences.d/rocm-pin-600 << EOF
- Package: *
- Pin: release o=repo.radeon.com
- Pin-Priority: 600
- EOF
-
- sudo apt update
- sudo apt-get install -y libssl-dev rocm-hip-sdk
-
- - name: Setup TheRock
- if: matrix.ROCM_VERSION != '7.2.1'
- id: therock_env
- run: |
- wget https://repo.amd.com/rocm/tarball/therock-dist-linux-gfx1151-${{ matrix.ROCM_VERSION }}.tar.gz
- mkdir install
- tar -xf *.tar.gz -C install
- export ROCM_PATH=$(pwd)/install
- echo ROCM_PATH=$ROCM_PATH >> $GITHUB_ENV
- echo PATH=$PATH:$ROCM_PATH/bin >> $GITHUB_ENV
- echo LD_LIBRARY_PATH=$ROCM_PATH/lib:$ROCM_PATH/llvm/lib:$ROCM_PATH/lib/rocprofiler-systems >> $GITHUB_ENV
-
- - 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 \
- -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 \
- -DGGML_HIP_ROCWMMA_FATTN=ON \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
- ${{ env.CMAKE_ARGS }}
- cmake --build build --config Release -j $(nproc)
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }}
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Get ROCm short version
- run: echo "ROCM_VERSION_SHORT=$(echo '${{ matrix.ROCM_VERSION }}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV
-
- - name: Pack artifacts
- id: pack_artifacts
- 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
- uses: actions/upload-artifact@v6
- with:
- 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
-
- windows-hip:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
-
- runs-on: windows-2022
-
- permissions:
- actions: write
-
- env:
- HIPSDK_INSTALLER_VERSION: "26.Q1"
-
- strategy:
- matrix:
- include:
- - name: "radeon"
- gpu_targets: "gfx1150;gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Grab rocWMMA package
- id: grab_rocwmma
- run: |
- curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2.1/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70201-81~24.04_amd64.deb"
- 7z x rocwmma.deb
- 7z x data.tar
-
- - name: Cache ROCm Installation
- id: cache-rocm
- uses: actions/cache@v5
- with:
- path: C:\Program Files\AMD\ROCm
- key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
-
- - name: Install ROCm
- if: steps.cache-rocm.outputs.cache-hit != 'true'
- id: depends
- run: |
- $ErrorActionPreference = "Stop"
- write-host "Downloading AMD HIP SDK Installer"
- 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"
- write-host "Installing AMD HIP SDK"
- $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
- $completed = $proc.WaitForExit(600000)
- if (-not $completed) {
- Write-Error "ROCm installation timed out after 10 minutes. Killing the process"
- $proc.Kill()
- exit 1
- }
- if ($proc.ExitCode -ne 0) {
- Write-Error "ROCm installation failed with exit code $($proc.ExitCode)"
- exit 1
- }
- write-host "Completed AMD HIP SDK installation"
-
- - name: Verify ROCm
- id: verify
- run: |
- # Find and test ROCm installation
- $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
- if (-not $clangPath) {
- Write-Error "ROCm installation not found"
- exit 1
- }
- & $clangPath.FullName --version
-
- - name: Build
- id: cmake_build
- run: |
- $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
- $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
- 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-7.2.1/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
- -DCMAKE_BUILD_TYPE=Release `
- -DGGML_BACKEND_DL=ON `
- -DGGML_NATIVE=OFF `
- -DGGML_CPU=OFF `
- -DGPU_TARGETS="${{ matrix.gpu_targets }}" `
- -DGGML_HIP_ROCWMMA_FATTN=ON `
- -DGGML_HIP=ON `
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} `
- -DLLAMA_BUILD_BORINGSSL=ON
- cmake --build build --target ggml-hip -j ${env:NUMBER_OF_PROCESSORS}
- md "build\bin\rocblas\library\"
- md "build\bin\hipblaslt\library"
- cp "${env:HIP_PATH}\bin\libhipblas.dll" "build\bin\"
- cp "${env:HIP_PATH}\bin\libhipblaslt.dll" "build\bin\"
- cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
- cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
- cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
-
- - name: ccache-clear
- uses: ./.github/actions/ccache-clear
- with:
- key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- 7z a -snl llama-bin-win-hip-${{ matrix.name }}-x64.zip .\build\bin\*
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-bin-win-hip-${{ matrix.name }}-x64.zip
- name: llama-bin-win-hip-${{ matrix.name }}-x64.zip
-
- ios-xcode:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
- runs-on: macos-26
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Xcode
- run: |
- sudo xcode-select -s /Applications/Xcode_26.4.app
-
- - name: Build
- id: cmake_build
- run: |
- sysctl -a
- cmake -B build -G Xcode \
- -DGGML_METAL_USE_BF16=ON \
- -DGGML_METAL_EMBED_LIBRARY=ON \
- -DLLAMA_OPENSSL=OFF \
- -DLLAMA_BUILD_APP=OFF \
- -DLLAMA_BUILD_EXAMPLES=OFF \
- -DLLAMA_BUILD_TOOLS=OFF \
- -DLLAMA_BUILD_TESTS=OFF \
- -DLLAMA_BUILD_SERVER=OFF \
- -DCMAKE_SYSTEM_NAME=iOS \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=16.0 \
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml \
- -DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }}
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
-
- - name: xcodebuild for swift package
- id: xcodebuild
- run: |
- ./build-xcframework.sh
-
- - name: Build Xcode project
- run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Pack artifacts
- id: pack_artifacts
- run: |
- # Zip file is required for Swift Package Manager, which does not support tar.gz for binary targets.
- # For more details, see https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages
- zip -r -y llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v6
- with:
- path: llama-${{ steps.tag.outputs.name }}-xcframework.zip
- name: llama-${{ steps.tag.outputs.name }}-xcframework.zip
-
-# TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23705)
-# in order to enable it again, we have to provision dedicated runners to run it
-# openEuler-cann:
-# strategy:
-# matrix:
-# include:
-# # 910b with aclgraph (both architectures)
-# - arch: x86
-# chip_type: '910b'
-# build: 'Release'
-# use_acl_graph: 'on'
-# - arch: aarch64
-# chip_type: '910b'
-# build: 'Release'
-# use_acl_graph: 'on'
-# # 310p without aclgraph (both architectures)
-# - arch: x86
-# chip_type: '310p'
-# build: 'Release'
-# use_acl_graph: 'off'
-# - arch: aarch64
-# chip_type: '310p'
-# build: 'Release'
-# use_acl_graph: 'off'
-# runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v6
-# with:
-# fetch-depth: 0
-#
-# - name: Free up disk space
-# uses: ggml-org/free-disk-space@v1.3.1
-# with:
-# tool-cache: true
-#
-# - name: Set container image
-# id: cann-image
-# run: |
-# image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.5.0-910b-openeuler24.03-py3.11' || '8.5.0-310p-openeuler24.03-py3.11' }}"
-# echo "image=${image}" >> "${GITHUB_OUTPUT}"
-#
-# - name: Pull container image
-# run: docker pull "${{ steps.cann-image.outputs.image }}"
-#
-# - name: Build
-# env:
-# BUILD_TYPE: ${{ matrix.build }}
-# SOC_TYPE: ascend${{ matrix.chip_type }}
-# USE_ACL_GRAPH: ${{ matrix.use_acl_graph }}
-# run: |
-# HOST_UID=$(id -u)
-# HOST_GID=$(id -g)
-#
-# docker run --rm \
-# -v "${PWD}:/workspace" \
-# -w /workspace \
-# -e SOC_TYPE=${SOC_TYPE} \
-# -e BUILD_TYPE=${BUILD_TYPE} \
-# -e USE_ACL_GRAPH=${USE_ACL_GRAPH} \
-# "${{ steps.cann-image.outputs.image }}" \
-# bash -lc '
-# set -e
-# yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake openssl-devel
-# yum clean all && rm -rf /var/cache/yum
-# git config --global --add safe.directory "/workspace"
-# export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
-# cmake -S . -B build \
-# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-# -DGGML_CANN=on \
-# -DSOC_TYPE=${SOC_TYPE} \
-# -DUSE_ACL_GRAPH=${USE_ACL_GRAPH}
-# cmake --build build -j $(nproc)
-#
-# chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build
-# '
-#
-# - name: Determine tag name
-# id: tag
-# uses: ./.github/actions/get-tag-name
-#
-# - name: Pack artifacts
-# run: |
-# cp LICENSE ./build/bin/
-# tar -czvf llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
-#
-# - name: Upload artifacts
-# uses: actions/upload-artifact@v6
-# with:
-# path: llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz
-# name: llama-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz
-
- ui-build:
- needs: [check-release, get-version]
- if: ${{ needs.check-release.outputs.should_release == 'true' }}
- uses: ./.github/workflows/ui-build.yml
- with:
- hf_ui_version: ${{ needs.get-version.outputs.ui_version }}
-
- release:
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
-
- # Fine-grant permission
- # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
- permissions:
- contents: write # for creating release
-
- runs-on: ubuntu-slim
-
- needs:
- - get-version
- - windows
- - windows-cpu
- - windows-cuda
- #- windows-sycl
- - windows-hip
- - windows-openvino
- - ubuntu-22-rocm
- - ubuntu-cpu
- - ubuntu-vulkan
- - ubuntu-24-openvino
- #- ubuntu-24-sycl
- - android-arm64
- - macos-cpu
- - ios-xcode
- #- openEuler-cann
- - ui-build
-
- outputs:
- tag_name: ${{ steps.tag.outputs.name }}
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- - name: Download artifacts
- id: download-artifact
- uses: actions/download-artifact@v7
- with:
- path: ./artifact
- merge-multiple: true
-
- - name: Move artifacts
- id: move_artifacts
- run: |
- mkdir -p release
-
- echo "Adding CPU backend files to existing zips..."
- for arch in x64 arm64; do
- cpu_zip="artifact/llama-bin-win-cpu-${arch}.zip"
- temp_dir=$(mktemp -d)
- echo "Extracting CPU backend for $arch..."
- unzip "$cpu_zip" -d "$temp_dir"
-
- echo "Adding CPU files to $arch zips..."
- for target_zip in artifact/llama-bin-win-*-${arch}.zip; do
- if [[ "$target_zip" == "$cpu_zip" ]]; then
- continue
- fi
- echo "Adding CPU backend to $(basename "$target_zip")"
- realpath_target_zip=$(realpath "$target_zip")
- (cd "$temp_dir" && zip -r "$realpath_target_zip" .)
- done
-
- rm -rf "$temp_dir"
- done
-
- echo "Renaming and moving zips to release..."
- for zip_file in artifact/llama-bin-win-*.zip; do
- base_name=$(basename "$zip_file" .zip)
- zip_name="llama-${{ steps.tag.outputs.name }}-${base_name#llama-}.zip"
- echo "Moving $zip_file to release/$zip_name"
- mv "$zip_file" "release/$zip_name"
- done
-
- echo "Moving other artifacts..."
- mv -v artifact/*.zip release
- mv -v artifact/*.tar.gz release
-
- - name: Download UI build
- id: download_ui
- uses: actions/download-artifact@v7
- with:
- name: ui-build
- path: ./ui-dist
-
- - name: Package UI
- id: package_ui
- run: |
- tar -czvf release/llama-${{ steps.tag.outputs.name }}-ui.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./ui-dist .
-
- - name: Create release
- id: create_release
- uses: ggml-org/action-create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: ${{ steps.tag.outputs.name }}
- body: |
-
-
- ${{ github.event.head_commit.message }}
-
-
-
- **Website:**
- -
-
- **macOS/iOS:**
- - [macOS Apple Silicon (arm64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.tar.gz)
- - macOS Apple Silicon (arm64, KleidiAI enabled) [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23780)
- - [macOS Intel (x64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-x64.tar.gz)
- - [iOS XCFramework](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-xcframework.zip)
-
- **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 arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-arm64.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 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.2)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.2-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 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)
-
- **Android:**
- - [Android arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz)
-
- **Windows:**
- - [Windows x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-x64.zip)
- - [Windows arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-arm64.zip)
- - [Windows arm64 (OpenCL Adreno)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-opencl-adreno-arm64.zip)
- - [Windows x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-12.4-x64.zip) - [CUDA 12.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-12.4-x64.zip)
- - [Windows x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.3-x64.zip) - [CUDA 13.3 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.3-x64.zip)
- - [Windows x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-vulkan-x64.zip)
- - [Windows x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ needs.windows-openvino.outputs.openvino_version }}-x64.zip)
- - [Windows x64 (SYCL)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip)
- - [Windows x64 (HIP)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-hip-radeon-x64.zip)
-
- **openEuler:**
- - [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23705)
- - openEuler x86 (310p)
- - openEuler x86 (910b, ACL Graph)
- - openEuler aarch64 (310p)
- - openEuler aarch64 (910b, ACL Graph)
-
- **UI:**
- - [UI](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-ui.tar.gz)
-
- - name: Upload release
- id: upload_release
- uses: actions/github-script@v8
- with:
- github-token: ${{secrets.GITHUB_TOKEN}}
- script: |
- const path = require('path');
- const fs = require('fs');
- const release_id = '${{ steps.create_release.outputs.id }}';
- for (let file of await fs.readdirSync('./release')) {
- if (path.extname(file) === '.zip' || file.endsWith('.tar.gz')) {
- console.log('uploadReleaseAsset', file);
- await github.rest.repos.uploadReleaseAsset({
- owner: context.repo.owner,
- repo: context.repo.repo,
- release_id: release_id,
- name: file,
- data: await fs.readFileSync(`./release/${file}`)
- });
- }
- }
-
- ui-publish:
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
-
- needs:
- - release
-
- uses: ./.github/workflows/ui-publish.yml
- with:
- version_tag: ${{ needs.release.outputs.tag_name }}
- secrets:
- hf_token: ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }}
diff --git a/.github/workflows/server-sanitize.yml b/.github/workflows/server-sanitize.yml
deleted file mode 100644
index c0817cb..0000000
--- a/.github/workflows/server-sanitize.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Server (sanitize)
-
-on:
- workflow_dispatch: # allows manual triggering
- inputs:
- sha:
- description: 'Commit SHA1 to build'
- required: false
- type: string
- slow_tests:
- description: 'Run slow tests'
- required: true
- type: boolean
- push:
- branches:
- - master
- paths: [
- '.github/workflows/server-sanitize.yml',
- '**/CMakeLists.txt',
- '**/Makefile',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- 'tools/server/**.*'
- ]
-
-env:
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
- LLAMA_ARG_LOG_VERBOSITY: 10
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- server:
- runs-on: [self-hosted, CPU, Linux, llama-server]
-
- strategy:
- matrix:
- sanitizer: [ADDRESS, UNDEFINED] # THREAD is very slow
- build_type: [RelWithDebInfo]
- fail-fast: false
-
- steps:
- #- name: Dependencies
- # id: depends
- # run: |
- # sudo apt-get update
- # sudo apt-get -y install \
- # build-essential \
- # xxd \
- # git \
- # cmake \
- # curl \
- # wget \
- # language-pack-en \
- # libssl-dev
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DLLAMA_BUILD_BORINGSSL=ON \
- -DGGML_SCHED_NO_REALLOC=ON \
- -DGGML_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
- -DGGML_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
- -DGGML_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }} \
- -DLLAMA_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
- -DLLAMA_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
- -DLLAMA_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }}
- cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server
-
- - name: Python setup
- id: setup_python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- pip-install: -r tools/server/tests/requirements.txt
-
- - name: Tests
- id: server_integration_tests
- if: ${{ (!matrix.disabled_on_pr || !github.event.pull_request) }}
- run: |
- cd tools/server/tests
- export ${{ matrix.extra_args }}
- pytest -v -x -m "not slow"
-
- - name: Slow tests
- id: server_integration_tests_slow
- if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }}
- run: |
- cd tools/server/tests
- export ${{ matrix.extra_args }}
- SLOW_TESTS=1 pytest -v -x
diff --git a/.github/workflows/server-self-hosted.yml b/.github/workflows/server-self-hosted.yml
deleted file mode 100644
index 249f389..0000000
--- a/.github/workflows/server-self-hosted.yml
+++ /dev/null
@@ -1,222 +0,0 @@
-name: Server (self-hosted)
-
-on:
- workflow_dispatch: # allows manual triggering
- inputs:
- sha:
- description: 'Commit SHA1 to build'
- required: false
- type: string
- slow_tests:
- description: 'Run slow tests'
- required: true
- type: boolean
- push:
- branches:
- - master
- paths: [
- '.github/workflows/server-self-hosted.yml',
- '**/CMakeLists.txt',
- '**/Makefile',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.swift',
- '**/*.m',
- 'tools/server/**.*'
- ]
-
-env:
- # note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302)
- HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
- LLAMA_ARG_LOG_VERBOSITY: 10
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- server-metal:
- runs-on: [self-hosted, llama-server, macOS, ARM64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build -DGGML_SCHED_NO_REALLOC=ON
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) --target llama-server
-
- - name: Python setup
- id: setup_python
- run: |
- cd tools/server/tests
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
-
- - name: Tests (GPUx1)
- id: server_integration_tests
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx1, backend-sampling)
- id: server_integration_tests_backend_sampling
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export LLAMA_ARG_BACKEND_SAMPLING=1
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx2)
- id: server_integration_tests_gpu2
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export GGML_METAL_DEVICES=2
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx2, backend-sampling)
- id: server_integration_tests_gpu2_backend_sampling
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export GGML_METAL_DEVICES=2 LLAMA_ARG_BACKEND_SAMPLING=1
- pytest -v -x -m "not slow"
-
- server-cuda:
- runs-on: [self-hosted, llama-server, Linux, NVIDIA]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build -DGGML_CUDA=ON -DGGML_SCHED_NO_REALLOC=ON
- cmake --build build --config Release -j $(nproc) --target llama-server
-
- - name: Python setup
- id: setup_python
- run: |
- cd tools/server/tests
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
-
- - name: Tests (GPUx1)
- id: server_integration_tests
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx1, backend-sampling)
- id: server_integration_tests_backend_sampling
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export LLAMA_ARG_BACKEND_SAMPLING=1
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx2)
- id: server_integration_tests_gpu2
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export GGML_CUDA_DEVICES=2
- pytest -v -x -m "not slow"
-
- - name: Tests (GPUx2, backend-sampling)
- id: server_integration_tests_gpu2_backend_sampling
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- export GGML_CUDA_DEVICES=2 LLAMA_ARG_BACKEND_SAMPLING=1
- pytest -v -x -m "not slow"
-
- server-kleidiai:
- runs-on: ah-ubuntu_22_04-c8g_8x
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Dependencies
- id: depends
- run: |
- set -euxo pipefail
- sudo apt-get update
- sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
- apt-get install -y \
- build-essential \
- libssl-dev \
- python3-venv \
- gpg \
- wget \
- time \
- git-lfs
-
- git lfs install
-
- # install the latest cmake
- sudo install -d /usr/share/keyrings
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
- | gpg --dearmor \
- | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
- | sudo tee /etc/apt/sources.list.d/kitware.list
- sudo apt-get update
- sudo apt-get install -y cmake
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build -DGGML_SCHED_NO_REALLOC=ON -DGGML_CPU_KLEIDIAI=ON
- cmake --build build --config Release -j $(nproc) --target llama-server
-
- - name: Python setup
- id: setup_python
- run: |
- cd tools/server/tests
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
-
- - name: Tests
- id: server_integration_tests
- if: ${{ !github.event.pull_request }}
- run: |
- cd tools/server/tests
- source venv/bin/activate
- pytest -v -x -m "not slow"
diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml
deleted file mode 100644
index 5a02cc1..0000000
--- a/.github/workflows/server.yml
+++ /dev/null
@@ -1,181 +0,0 @@
-name: Server
-
-on:
- workflow_dispatch: # allows manual triggering
- inputs:
- sha:
- description: 'Commit SHA1 to build'
- required: false
- type: string
- slow_tests:
- description: 'Run slow tests'
- required: true
- type: boolean
- push:
- branches:
- - master
- paths: [
- '.github/workflows/server.yml',
- '**/CMakeLists.txt',
- '**/Makefile',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.swift',
- '**/*.m',
- 'tools/server/**.*'
- ]
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/server.yml',
- '**/CMakeLists.txt',
- '**/Makefile',
- '**/*.h',
- '**/*.hpp',
- '**/*.c',
- '**/*.cpp',
- '**/*.cu',
- '**/*.swift',
- '**/*.m',
- 'tools/server/**.*'
- ]
-
-env:
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
- LLAMA_ARG_LOG_VERBOSITY: 10
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- ubuntu:
- runs-on: ubuntu-24.04-arm
-
- steps:
- - name: Dependencies
- id: depends
- run: |
- sudo apt-get update
- sudo apt-get -y install \
- build-essential \
- xxd \
- git \
- cmake \
- curl \
- wget \
- language-pack-en \
- libssl-dev
-
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: server-ubuntu-24.04-arm
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DGGML_SCHED_NO_REALLOC=ON
- cmake --build build --config Release -j $(nproc) --target llama-server
-
- - name: Python setup
- id: setup_python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- pip-install: -r tools/server/tests/requirements.txt
-
- - name: Tests
- id: server_integration_tests
- run: |
- cd tools/server/tests
- pytest -v -x -m "not slow"
-
- - name: Slow tests
- id: server_integration_tests_slow
- if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
- run: |
- cd tools/server/tests
- SLOW_TESTS=1 pytest -v -x
-
- - name: Tests (Backend sampling)
- id: server_integration_tests_backend_sampling
- run: |
- cd tools/server/tests
- export LLAMA_ARG_BACKEND_SAMPLING=1
- pytest -v -x -m "not slow"
-
- - name: Slow tests (Backend sampling)
- id: server_integration_tests_slow_backend_sampling
- if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
- run: |
- cd tools/server/tests
- export LLAMA_ARG_BACKEND_SAMPLING=1
- SLOW_TESTS=1 pytest -v -x
-
- windows:
- runs-on: windows-2025
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: ccache
- uses: ggml-org/ccache-action@v1.2.21
- with:
- key: server-windows-2025-x64
- evict-old-files: 1d
- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
-
- - name: Build
- id: cmake_build
- shell: cmd
- run: |
- cmake -B build -G "Ninja Multi-Config" ^
- -DCMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake ^
- -DCMAKE_BUILD_TYPE=Release ^
- -DLLAMA_BUILD_BORINGSSL=ON ^
- -DGGML_SCHED_NO_REALLOC=ON
- set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
- cmake --build build --config Release -j %NINJA_JOBS% --target llama-server
-
- - name: Python setup
- id: setup_python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- pip-install: -r tools/server/tests/requirements.txt
-
- - name: Tests
- id: server_integration_tests
- run: |
- cd tools/server/tests
- $env:PYTHONIOENCODING = ":replace"
- pytest -v -x -m "not slow"
-
- - name: Slow tests
- id: server_integration_tests_slow
- if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
- run: |
- cd tools/server/tests
- $env:SLOW_TESTS = "1"
- pytest -v -x
diff --git a/.github/workflows/ui-build-self-hosted.yml b/.github/workflows/ui-build-self-hosted.yml
deleted file mode 100644
index 7b7f8b6..0000000
--- a/.github/workflows/ui-build-self-hosted.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: UI Build (self-hosted)
-
-on:
- workflow_call:
-
-jobs:
- build:
- runs-on: [self-hosted, fast]
- env:
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install dependencies
- run: npm ci
- working-directory: tools/ui
-
- - name: Build application
- run: npm run build
- working-directory: tools/ui
-
- - name: Upload built UI
- uses: actions/upload-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
- retention-days: 1
diff --git a/.github/workflows/ui-build.yml b/.github/workflows/ui-build.yml
deleted file mode 100644
index 85642f3..0000000
--- a/.github/workflows/ui-build.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-name: UI Build
-
-on:
- workflow_call:
- inputs:
- hf_ui_version:
- description: 'Version string for version.json (e.g. 12345)'
- required: false
- type: string
-
-jobs:
- build:
- runs-on: ubuntu-slim
- env:
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install dependencies
- run: npm ci
- working-directory: tools/ui
-
- - name: Build application
- env:
- HF_UI_VERSION: ${{ inputs.hf_ui_version || '' }}
- LLAMA_BUILD_NUMBER: ${{ inputs.hf_ui_version || 'b0000' }}
- run: npm run build
- working-directory: tools/ui
-
- - name: Run PWA unit tests (versioned build output)
- run: npx vitest --project=unit --run tests/unit/pwa.spec.ts
- working-directory: tools/ui
-
- - name: Upload built UI
- uses: actions/upload-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
- retention-days: 1
diff --git a/.github/workflows/ui-publish.yml b/.github/workflows/ui-publish.yml
deleted file mode 100644
index 99a6d84..0000000
--- a/.github/workflows/ui-publish.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: UI Publish
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'Version tag to publish under (e.g., b1234)'
- required: true
- type: string
- secrets:
- hf_token:
- description: 'Hugging Face token with write access'
- required: true
-
-jobs:
- build:
- name: Build static output
- uses: ./.github/workflows/ui-build.yml
-
- publish:
- name: Publish UI Static Output
- needs: build
- runs-on: ubuntu-slim
-
- permissions:
- contents: read
-
- env:
- HF_BUCKET_NAME: ${{ vars.HF_BUCKET_UI_STATIC_OUTPUT }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 1
-
- - name: Download UI build artifact
- uses: actions/download-artifact@v7
- with:
- name: ui-build
- path: tools/ui/dist/
-
- - name: Create distribution archive
- run: |
- tar -czf dist.tar.gz -C tools/ui/dist .
- sha256sum dist.tar.gz > dist.tar.gz.sha256
- mv dist.tar.gz dist.tar.gz.sha256 tools/ui/dist/
-
- - name: Install Hugging Face Hub CLI
- run: pip install -U huggingface_hub
-
- - name: Authenticate with Hugging Face
- run: hf auth login --token ${{ secrets.hf_token }}
-
- - name: Sync built files to Hugging Face bucket (version tag)
- run: |
- # Upload the built files to the Hugging Face bucket under the release version
- hf buckets sync tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} --delete --quiet
-
- - name: Sync built files to Hugging Face bucket (latest)
- run: |
- # Also upload to the 'latest' directory for fallback downloads
- hf buckets sync tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/latest --delete --quiet
-
- - name: Verify upload
- run: |
- # List the files in the bucket to verify the upload
- hf buckets list hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} -R -h
-
- - name: Clean up root-level files
- run: |
- # Clean up any old root-level files from previous non-versioned deployments
- hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/index.html --yes 2>/dev/null || true
- hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.js --yes 2>/dev/null || true
- hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.css --yes 2>/dev/null || true
diff --git a/.github/workflows/ui-self-hosted.yml b/.github/workflows/ui-self-hosted.yml
deleted file mode 100644
index 79d7800..0000000
--- a/.github/workflows/ui-self-hosted.yml
+++ /dev/null
@@ -1,125 +0,0 @@
-name: UI (self-hosted)
-
-# these are the same as ui.yml, but with self-hosted runners
-# the jobs are lighter because they don't need to install Node.js or Playwright browsers
-# the runner has pre-installed Playwright browsers for @playwright/test (1.56.1) at /ms-playwright/
-
-on:
- workflow_dispatch:
- inputs:
- sha:
- description: 'Commit SHA1 to build'
- required: false
- type: string
- push:
- branches:
- - master
- paths: [
- '.github/workflows/ui-self-hosted.yml',
- '.github/workflows/ui-build-self-hosted.yml',
- 'tools/ui/**.*',
- 'tools/server/tests/**.*'
- ]
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/ui-self-hosted.yml',
- '.github/workflows/ui-build-self-hosted.yml',
- 'tools/ui/**.*',
- 'tools/server/tests/**.*'
- ]
-
-env:
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
- LLAMA_ARG_LOG_VERBOSITY: 10
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- ui-build:
- name: Build static output
- uses: ./.github/workflows/ui-build-self-hosted.yml
-
- ui-checks:
- name: Checks
- needs: ui-build
- runs-on: [self-hosted, PLAYWRIGHT]
- continue-on-error: true
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Install dependencies
- id: setup
- run: npm ci
- working-directory: tools/ui
-
- - name: Download built UI artifacts
- uses: actions/download-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
-
- - name: Run type checking
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run check
- working-directory: tools/ui
-
- - name: Run linting
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run lint
- working-directory: tools/ui
-
- - name: Run Client tests
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run test:client
- working-directory: tools/ui
-
- - name: Run Unit tests
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run test:unit
- working-directory: tools/ui
-
- e2e-tests:
- name: E2E Tests
- needs: ui-build
- runs-on: [self-hosted, PLAYWRIGHT]
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Install dependencies
- id: setup
- run: npm ci
- working-directory: tools/ui
-
- - name: Download built UI artifacts
- uses: actions/download-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
-
- - name: Build Storybook
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run build-storybook
- working-directory: tools/ui
-
- - name: Run UI tests
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run test:ui -- --testTimeout=60000
- working-directory: tools/ui
-
- - name: Run E2E tests
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run test:e2e
- working-directory: tools/ui
diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml
deleted file mode 100644
index fa99a0c..0000000
--- a/.github/workflows/ui.yml
+++ /dev/null
@@ -1,151 +0,0 @@
-name: UI
-
-on:
- workflow_dispatch:
- inputs:
- sha:
- description: 'Commit SHA1 to build'
- required: false
- type: string
- push:
- branches:
- - master
- paths: [
- '.github/workflows/ui.yml',
- '.github/workflows/ui-build.yml',
- 'tools/ui/**.*',
- 'tools/server/tests/**.*'
- ]
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/ui.yml',
- '.github/workflows/ui-build.yml',
- 'tools/ui/**.*',
- 'tools/server/tests/**.*'
- ]
-
-env:
- LLAMA_ARG_LOG_COLORS: 1
- LLAMA_ARG_LOG_PREFIX: 1
- LLAMA_ARG_LOG_TIMESTAMPS: 1
- LLAMA_ARG_LOG_VERBOSITY: 10
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- ui-build:
- name: Build static output
- uses: ./.github/workflows/ui-build.yml
-
- ui-checks:
- name: Checks
- needs: ui-build
- runs-on: ubuntu-24.04
- continue-on-error: true
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Setup Node.js
- id: node
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Download built UI artifacts
- uses: actions/download-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
-
- - name: Install dependencies
- id: setup
- if: ${{ steps.node.conclusion == 'success' }}
- run: npm ci
- working-directory: tools/ui
-
- - name: Run type checking
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run check
- working-directory: tools/ui
-
- - name: Run linting
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npm run lint
- working-directory: tools/ui
-
- - name: Install Playwright browsers
- id: playwright
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npx playwright install --with-deps
- working-directory: tools/ui
-
- - name: Run Client tests
- if: ${{ always() && steps.playwright.conclusion == 'success' }}
- run: npm run test:client
- working-directory: tools/ui
-
- - name: Run Unit tests (uses pre-built dist/ from ui-build)
- if: ${{ always() && steps.playwright.conclusion == 'success' }}
- run: npm run test:unit
- working-directory: tools/ui
-
- e2e-tests:
- name: E2E Tests
- needs: ui-build
- runs-on: ubuntu-24.04
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
-
- - name: Setup Node.js
- id: node
- uses: actions/setup-node@v6
- with:
- node-version: "24"
- cache: "npm"
- cache-dependency-path: "tools/ui/package-lock.json"
-
- - name: Install dependencies
- id: setup
- if: ${{ steps.node.conclusion == 'success' }}
- run: npm ci
- working-directory: tools/ui
-
- - name: Download built UI artifacts (reuses ui-build)
- uses: actions/download-artifact@v6
- with:
- name: ui-build
- path: tools/ui/dist/
-
- - name: Install Playwright browsers
- id: playwright
- if: ${{ always() && steps.setup.conclusion == 'success' }}
- run: npx playwright install --with-deps
- working-directory: tools/ui
-
- - name: Build Storybook
- if: ${{ always() && steps.playwright.conclusion == 'success' }}
- run: npm run build-storybook
- working-directory: tools/ui
-
- - name: Run UI tests
- if: ${{ always() && steps.playwright.conclusion == 'success' }}
- run: npm run test:ui -- --testTimeout=60000
- working-directory: tools/ui
-
- - name: Run E2E tests (uses pre-built dist/ from ui-build)
- if: ${{ always() && steps.playwright.conclusion == 'success' }}
- run: npm run test:e2e
- working-directory: tools/ui
diff --git a/.github/workflows/update-ops-docs.yml b/.github/workflows/update-ops-docs.yml
deleted file mode 100644
index 6e8bc1a..0000000
--- a/.github/workflows/update-ops-docs.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Update Operations Documentation
-
-on:
- push:
- paths:
- - '.github/workflows/update-ops-docs.yml'
- - 'docs/ops.md'
- - 'docs/ops/**'
- - 'scripts/create_ops_docs.py'
- pull_request:
- paths:
- - '.github/workflows/update-ops-docs.yml'
- - 'docs/ops.md'
- - 'docs/ops/**'
- - 'scripts/create_ops_docs.py'
-
-jobs:
- update-ops-docs:
- runs-on: [self-hosted, fast, ARM64]
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.x'
-
- - name: Generate operations documentation to temporary file
- run: |
- mkdir -p /tmp/ops_check
- ./scripts/create_ops_docs.py /tmp/ops_check/ops.md
-
- - name: Check if docs/ops.md matches generated version
- run: |
- if ! diff -q docs/ops.md /tmp/ops_check/ops.md; then
- echo "Operations documentation (docs/ops.md) is not up to date with the backend CSV files."
- echo "To fix: run ./scripts/create_ops_docs.py and commit the updated docs/ops.md along with your changes"
- echo "Differences found:"
- diff docs/ops.md /tmp/ops_check/ops.md || true
- exit 1
- fi
- echo "Operations documentation is up to date."
diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml
deleted file mode 100644
index 69e24f9..0000000
--- a/.github/workflows/winget.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Update Winget Package
-
-on:
- workflow_dispatch: # allows manual triggering
- schedule:
- - cron: '28 5 * * *' # Update every day at 5:28 UTC
-
-jobs:
- update:
- name: Update Winget Package
- runs-on: ubuntu-latest
- if: github.repository_owner == 'ggml-org'
-
- steps:
- - name: Install cargo binstall
- uses: cargo-bins/cargo-binstall@268643a6b5ea099f5718ee5cd3ff7dc89a5eb49b
-
- - name: Install komac
- run: |
- cargo binstall komac@2.16.0 -y
-
- - name: Find latest release
- id: find_latest_release
- uses: actions/github-script@v8
- with:
- script: |
- const { data: releases } = await github.rest.repos.listReleases({
- owner: context.repo.owner,
- repo: context.repo.repo,
- });
- const { tag_name: version, assets: assets } = releases.find(({assets}) => assets.find(asset => asset.name.includes('win-vulkan')));
- const { browser_download_url: asset_url } = assets.find(asset => asset.name.includes('win-vulkan'));
- console.log("Latest release:", version);
- core.setOutput('VERSION', version);
- core.setOutput('ASSETURL', asset_url);
-
- - name: Update manifest
- run: |
- echo "Updating manifest..."
- komac update --version ${{ steps.find_latest_release.outputs.VERSION }} \
- --urls "${{ steps.find_latest_release.outputs.ASSETURL }}" \
- --token ${{ secrets.WINGET_GITHUB_TOKEN }} \
- --submit \
- ggml.llamacpp