diff --git a/.devops/intel.Dockerfile b/.devops/intel.Dockerfile
index b4bcd94b9..db46fd868 100644
--- a/.devops/intel.Dockerfile
+++ b/.devops/intel.Dockerfile
@@ -1,4 +1,4 @@
-ARG ONEAPI_VERSION=2025.3.3-0-devel-ubuntu24.04
+ARG ONEAPI_VERSION=2026.1.1-devel-ubuntu24.04
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
@@ -19,7 +19,7 @@ RUN npm ci
COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build
-FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS build
+FROM docker.io/intel/oneapi-toolkit:$ONEAPI_VERSION AS build
ARG GGML_SYCL_F16=ON
ARG LEVEL_ZERO_VERSION=1.28.2
@@ -59,7 +59,7 @@ RUN mkdir -p /app/full \
&& cp requirements.txt /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
-FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS base
+FROM docker.io/intel/oneapi-toolkit:$ONEAPI_VERSION AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
diff --git a/.devops/musa.Dockerfile b/.devops/musa.Dockerfile
index d30a70bb3..0e3f63359 100644
--- a/.devops/musa.Dockerfile
+++ b/.devops/musa.Dockerfile
@@ -1,10 +1,9 @@
ARG UBUNTU_VERSION=22.04
# This needs to generally match the container host's environment.
-ARG MUSA_VERSION=rc4.3.0
# Target the MUSA build image
-ARG BASE_MUSA_DEV_CONTAINER=docker.io/mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
+ARG BASE_MUSA_DEV_CONTAINER=registry.mthreads.com/mcconline/musa_sdk:5.2.0-devel-ubuntu${UBUNTU_VERSION}-s5000
-ARG BASE_MUSA_RUN_CONTAINER=docker.io/mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
+ARG BASE_MUSA_RUN_CONTAINER=registry.mthreads.com/mcconline/musa_sdk:5.2.0-runtime-ubuntu${UBUNTU_VERSION}-s5000
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
@@ -37,7 +36,10 @@ RUN apt-get update && \
python3-pip \
git \
libssl-dev \
- libgomp1
+ libgomp1 \
+ musa-mualg-5-2 \
+ musa-muthrust-5-2 \
+ libmthreads-compute
WORKDIR /app
@@ -80,13 +82,16 @@ LABEL org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.source=$IMAGE_SOURCE
RUN apt-get update \
- && apt-get install -y libgomp1 curl ffmpeg \
+ && apt-get install -y libgomp1 curl ffmpeg libmthreads-compute \
&& apt autoremove -y \
&& apt clean -y \
&& rm -rf /tmp/* /var/tmp/* \
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
&& find /var/cache -type f -delete
+# The MUSA runtime image does not register its library directory
+RUN echo "/usr/local/musa/lib" > /etc/ld.so.conf.d/musa-runtime.conf && ldconfig
+
COPY --from=build /app/lib/ /app
### Full
diff --git a/.devops/openvino.Dockerfile b/.devops/openvino.Dockerfile
index e301aa8f5..4b5ac734f 100644
--- a/.devops/openvino.Dockerfile
+++ b/.devops/openvino.Dockerfile
@@ -1,12 +1,12 @@
-ARG OPENVINO_VERSION_MAJOR=2026.4
-ARG OPENVINO_VERSION_FULL=2026.4.0.22959.99c81491cc3
+ARG OPENVINO_VERSION_MAJOR=2026.4.1
+ARG OPENVINO_VERSION_FULL=2026.4.1.22982.07f9c262b05
ARG UBUNTU_VERSION=24.04
# Intel GPU driver versions. https://github.com/intel/compute-runtime/releases
-ARG IGC_VERSION=v2.40.13
-ARG IGC_VERSION_FULL=2_2.40.13+22418
-ARG COMPUTE_RUNTIME_VERSION=26.31.39395.13
-ARG COMPUTE_RUNTIME_VERSION_FULL=26.31.39395.13-0
+ARG IGC_VERSION=v2.41.5
+ARG IGC_VERSION_FULL=2_2.41.5+22716
+ARG COMPUTE_RUNTIME_VERSION=26.35.39758.10
+ARG COMPUTE_RUNTIME_VERSION_FULL=26.35.39758.10-0
ARG IGDGMM_VERSION=22.10.0
# Intel NPU driver versions. https://github.com/intel/linux-npu-driver/releases
diff --git a/.github/workflows/ai-issues.yml b/.github/workflows/ai-issues.yml
index c762901b5..3f01ea856 100644
--- a/.github/workflows/ai-issues.yml
+++ b/.github/workflows/ai-issues.yml
@@ -4,6 +4,10 @@ on:
issues:
types: [opened]
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
find-related:
if: github.event.action == 'opened'
diff --git a/.github/workflows/build-3rd-party.yml b/.github/workflows/build-3rd-party.yml
index 82e53dbaf..fe25f3909 100644
--- a/.github/workflows/build-3rd-party.yml
+++ b/.github/workflows/build-3rd-party.yml
@@ -15,6 +15,10 @@ on:
'**/*.cpp'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-and-test-snapdragon.yml b/.github/workflows/build-and-test-snapdragon.yml
index 296780acb..d6420b65f 100644
--- a/.github/workflows/build-and-test-snapdragon.yml
+++ b/.github/workflows/build-and-test-snapdragon.yml
@@ -23,6 +23,10 @@ on:
- 'scripts/snapdragon/**'
- 'CMakePresets.json'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -36,6 +40,10 @@ jobs:
run:
shell: bash
+ permissions:
+ actions: write
+ contents: read
+
steps:
- name: Clone
uses: actions/checkout@v6
@@ -66,6 +74,10 @@ jobs:
run:
shell: bash
+ permissions:
+ actions: write
+ contents: read
+
steps:
- name: Clone
uses: actions/checkout@v6
@@ -98,6 +110,10 @@ jobs:
matrix:
device: [SM8750, SM8850, QCS9075M]
+ permissions:
+ actions: read
+ contents: read
+
steps:
- name: Checkout
uses: actions/checkout@v6
diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml
index 90960a7f6..4db7c2269 100644
--- a/.github/workflows/build-android.yml
+++ b/.github/workflows/build-android.yml
@@ -20,6 +20,10 @@ on:
- '.github/workflows/build-android.yml'
- 'examples/llama.android/**'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -66,6 +70,10 @@ jobs:
run:
shell: bash
+ permissions:
+ actions: write
+ contents: read
+
steps:
- name: Clone
uses: actions/checkout@v6
diff --git a/.github/workflows/build-apple.yml b/.github/workflows/build-apple.yml
index c23f40f14..f792256f6 100644
--- a/.github/workflows/build-apple.yml
+++ b/.github/workflows/build-apple.yml
@@ -26,6 +26,10 @@ on:
'ggml/src/ggml-rpc/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -33,6 +37,7 @@ concurrency:
env:
GGML_NLOOP: 3
GGML_N_THREADS: 1
+ GGML_SCHED_DEBUG_REALLOC: 1
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
LLAMA_ARG_LOG_TIMESTAMPS: 1
@@ -49,7 +54,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: apple-arm64
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -98,7 +103,9 @@ jobs:
id: cmake_test
run: |
cd build
- ctest -L main -E "test-llama-archs" --verbose --timeout 900
+ # Metal Paravirtual devices are difficult to support -> disable
+ # ref: https://github.com/ggml-org/llama.cpp/pull/19802#issuecomment-4013704023
+ ctest -L main -E "test-llama-archs|test-save-load-state|test-recurrent-state-rollback" --verbose --timeout 900
macos-latest-x64:
runs-on: macos-15-intel
@@ -111,7 +118,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: apple-x64
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -159,6 +166,10 @@ jobs:
macos-latest-ios-xcode:
runs-on: macos-latest
+ permissions:
+ actions: write
+ contents: read
+
steps:
- name: Checkout code
uses: actions/checkout@v6
@@ -256,6 +267,10 @@ jobs:
runs-on: macos-latest
needs: macos-latest-ios-xcode
+ permissions:
+ actions: read
+ contents: read
+
strategy:
matrix:
destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml
index 27512a142..e5aa611e4 100644
--- a/.github/workflows/build-cache.yml
+++ b/.github/workflows/build-cache.yml
@@ -5,6 +5,10 @@ on:
schedule:
- cron: '0 * * * *'
+cache-mode: write
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -41,8 +45,8 @@ jobs:
env:
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Clone
@@ -69,8 +73,8 @@ jobs:
env:
# Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Clone
diff --git a/.github/workflows/build-cann.yml b/.github/workflows/build-cann.yml
index 6d76ed499..1e5ac982b 100644
--- a/.github/workflows/build-cann.yml
+++ b/.github/workflows/build-cann.yml
@@ -22,6 +22,10 @@ on:
'ggml/src/ggml-cann/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-cmake-pkg.yml b/.github/workflows/build-cmake-pkg.yml
index e83589282..e5be1dae1 100644
--- a/.github/workflows/build-cmake-pkg.yml
+++ b/.github/workflows/build-cmake-pkg.yml
@@ -3,6 +3,10 @@ on:
workflow_dispatch:
workflow_call:
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
linux:
runs-on: [self-hosted, Linux, CPU]
diff --git a/.github/workflows/build-cpu.yml b/.github/workflows/build-cpu.yml
index df2d876d5..78d1c5f82 100644
--- a/.github/workflows/build-cpu.yml
+++ b/.github/workflows/build-cpu.yml
@@ -30,6 +30,10 @@ on:
'**/*.cpp'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -37,6 +41,7 @@ concurrency:
env:
GGML_NLOOP: 3
GGML_N_THREADS: 1
+ GGML_SCHED_DEBUG_REALLOC: 1
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
LLAMA_ARG_LOG_TIMESTAMPS: 1
@@ -64,7 +69,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: cpu-${{ matrix.os }}
+ restore: false
save: false
- name: Build Dependencies
@@ -141,6 +146,11 @@ jobs:
name: windows / ${{ matrix.build }}
runs-on: windows-2025
+ cache-mode: write
+ permissions:
+ actions: write
+ contents: read
+
env:
OPENBLAS_VERSION: 0.3.23
SDE_VERSION: 9.33.0-2024-01-07
diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml
index eef78b674..cc432bd4f 100644
--- a/.github/workflows/build-cross.yml
+++ b/.github/workflows/build-cross.yml
@@ -15,6 +15,10 @@ on:
schedule:
- cron: '0 0 * * 0'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-cuda-ubuntu.yml b/.github/workflows/build-cuda-ubuntu.yml
index 3dc9255be..db97aeb15 100644
--- a/.github/workflows/build-cuda-ubuntu.yml
+++ b/.github/workflows/build-cuda-ubuntu.yml
@@ -24,6 +24,10 @@ on:
'ggml/src/ggml-cuda/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -55,7 +59,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: cuda-ubuntu-24.04-cuda
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -68,7 +72,7 @@ jobs:
hf_bucket: ggml-org/cache
- 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
+ # TODO: Drop GGML_CUDA_CCCL_VERSION when this job uses CTK >= 13.5, which bundles CCCL >= 3.5.
run: |
cmake -S . -B build -G Ninja \
-DLLAMA_FATAL_WARNINGS=ON \
@@ -77,7 +81,7 @@ jobs:
-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
-DGGML_NATIVE=OFF \
-DGGML_CUDA=ON \
- -DGGML_CUDA_CUB_3DOT2=ON
+ -DGGML_CUDA_CCCL_VERSION=v3.4.3
cmake --build build
- name: ccache-buckets-save
@@ -110,7 +114,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: cuda-ubuntu-22.04-hip
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -145,7 +149,7 @@ jobs:
musa:
runs-on: ubuntu-22.04
- container: registry.mthreads.com/mcconline/inference/pytorch:2.9.1.post1-py3.10-musa5.2.0-mp31-devel-ubuntu22.04-amd64
+ container: registry.mthreads.com/mcconline/musa_sdk:5.2.0-devel-ubuntu22.04-s5000
steps:
- name: Clone
@@ -156,12 +160,12 @@ jobs:
id: depends
run: |
apt-get update
- apt-get install -y build-essential git cmake libssl-dev jq python3-venv
+ apt-get install -y build-essential git cmake libssl-dev jq python3-venv musa-mualg-5-2 musa-muthrust-5-2 libmthreads-compute
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: cuda-ubuntu-22.04-musa
+ restore: false
save: false
- name: ccache-buckets-restore
diff --git a/.github/workflows/build-cuda-windows.yml b/.github/workflows/build-cuda-windows.yml
index e08553e6c..309f41789 100644
--- a/.github/workflows/build-cuda-windows.yml
+++ b/.github/workflows/build-cuda-windows.yml
@@ -7,6 +7,11 @@ name: CI (CUDA, windows)
on:
workflow_dispatch: # allows manual triggering
+cache-mode: write
+permissions:
+ actions: write
+ contents: read
+
# note: this will run in queue with the release workflow
concurrency:
group: release
@@ -31,15 +36,16 @@ jobs:
strategy:
matrix:
include:
+ # CTK >= 13.5 bundles CCCL >= 3.5; omit GGML_CUDA_CCCL_VERSION for those versions.
- cuda: '12.4'
arch: x64
- defines: '-DGGML_CUDA_CUB_3DOT2=ON'
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- cuda: '13.4'
arch: x64
- defines: ''
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- cuda: '13.4'
arch: arm64
- defines: '-DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake'
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3 -DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake'
steps:
- name: Clone
diff --git a/.github/workflows/build-ibm.yml b/.github/workflows/build-ibm.yml
index 355487e97..fcf90ccee 100644
--- a/.github/workflows/build-ibm.yml
+++ b/.github/workflows/build-ibm.yml
@@ -19,9 +19,14 @@ on:
types: [opened, synchronize, reopened]
paths: [
'.github/workflows/build-ibm.yml',
- 'ggml/src/ggml-cpu/**'
+ 'ggml/src/ggml-cpu/**',
+ 'ggml/src/ggml-zdnn/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -100,6 +105,46 @@ jobs:
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-26-zdnn-s390x:
+ name: ubuntu-26-zdnn-s390x
+ runs-on: ubuntu-24.04-s390x
+ container: ubuntu:26.04 # required to get GCC 15.1 and binutils 2.44
+ defaults:
+ run:
+ shell: bash
+
+ steps:
+ - name: Build Dependencies
+ id: build_depends
+ run: |
+ apt-get update
+ apt-get install -y --no-install-recommends \
+ build-essential cmake git ca-certificates \
+ libssl-dev libzdnn-dev
+
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Toolchain workaround (GCC 15)
+ run: |
+ apt-get install -y gcc-15 g++-15
+ echo "CC=gcc-15" >> "$GITHUB_ENV"
+ echo "CXX=g++-15" >> "$GITHUB_ENV"
+
+ - name: Build with zDNN Backend
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DGGML_NATIVE=OFF \
+ -DGGML_VXE=ON \
+ -DGGML_ZDNN=ON \
+ -DGGML_RPC=ON \
+ -DCMAKE_C_FLAGS="-march=arch15" \
+ -DCMAKE_CXX_FLAGS="-march=arch15"
+ time cmake --build build --config Release -j $(nproc)
+
ubuntu-24-ppc64le:
runs-on: ubuntu-24.04-ppc64le
diff --git a/.github/workflows/build-msys.yml b/.github/workflows/build-msys.yml
index 9f05a9e94..0dbf98504 100644
--- a/.github/workflows/build-msys.yml
+++ b/.github/workflows/build-msys.yml
@@ -8,6 +8,10 @@ on:
schedule:
- cron: '0 0 * * 0'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-opencl.yml b/.github/workflows/build-opencl.yml
index 9be2ba1eb..ab9ed3ec2 100644
--- a/.github/workflows/build-opencl.yml
+++ b/.github/workflows/build-opencl.yml
@@ -23,6 +23,11 @@ on:
'ggml/src/ggml-opencl/**'
]
+cache-mode: write
+permissions:
+ actions: write
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-openvino.yml b/.github/workflows/build-openvino.yml
index daa08b1bf..fdc960c23 100644
--- a/.github/workflows/build-openvino.yml
+++ b/.github/workflows/build-openvino.yml
@@ -22,6 +22,10 @@ on:
'ggml/src/ggml-openvino/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -41,8 +45,8 @@ jobs:
env:
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Clone
@@ -94,10 +98,15 @@ jobs:
openvino-windows-2022:
runs-on: windows-2022
+ cache-mode: write
+ permissions:
+ actions: write
+ contents: read
+
env:
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Clone
diff --git a/.github/workflows/build-riscv.yml b/.github/workflows/build-riscv.yml
index 23a64454e..b6313c777 100644
--- a/.github/workflows/build-riscv.yml
+++ b/.github/workflows/build-riscv.yml
@@ -22,6 +22,10 @@ on:
'ggml/src/ggml-cpu/arch/riscv/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-sanitize.yml b/.github/workflows/build-sanitize.yml
index 89fcff71d..3a78c4d09 100644
--- a/.github/workflows/build-sanitize.yml
+++ b/.github/workflows/build-sanitize.yml
@@ -21,6 +21,10 @@ on:
'.github/workflows/build-sanitize.yml'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-sycl.yml b/.github/workflows/build-sycl.yml
index 5424a8607..741c9ce77 100644
--- a/.github/workflows/build-sycl.yml
+++ b/.github/workflows/build-sycl.yml
@@ -22,6 +22,10 @@ on:
'ggml/src/ggml-sycl/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -48,7 +52,7 @@ jobs:
env:
ONEAPI_ROOT: /opt/intel/oneapi/
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
+ ONEAPI_INSTALLER_VERSION: "2026.1"
LEVEL_ZERO_VERSION: "1.33.1"
LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
@@ -63,8 +67,8 @@ jobs:
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
+ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5996e26b-f48a-42b1-8db0-b002ad0bd8d7/intel-oneapi-toolkit-2026.1.1.33_offline.sh -O intel-oneapi-toolkit_offline.sh
+ sudo bash intel-oneapi-toolkit_offline.sh -s -a --silent --eula accept
- name: Install Level Zero SDK
shell: bash
@@ -78,7 +82,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: sycl-ubuntu-24-${{ matrix.build }}
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -124,16 +128,21 @@ jobs:
windows-latest-sycl:
runs-on: windows-2022
+ cache-mode: write
+ permissions:
+ actions: write
+ contents: read
+
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_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0cb67a0d-67f6-410b-868b-f4a0a17ff0cf/intel-oneapi-toolkit-2026.1.1.32_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.33.1/level-zero-win-sdk-1.33.1.zip
ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
+ ONEAPI_INSTALLER_VERSION: "2026.1"
steps:
- name: Clone
id: checkout
diff --git a/.github/workflows/build-virtgpu.yml b/.github/workflows/build-virtgpu.yml
index 5b740590d..576865783 100644
--- a/.github/workflows/build-virtgpu.yml
+++ b/.github/workflows/build-virtgpu.yml
@@ -22,6 +22,10 @@ on:
'ggml/src/ggml-virtgpu/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/build-vulkan.yml b/.github/workflows/build-vulkan.yml
index 21d2a7735..c4c08621f 100644
--- a/.github/workflows/build-vulkan.yml
+++ b/.github/workflows/build-vulkan.yml
@@ -24,6 +24,10 @@ on:
'ggml/src/ggml-vulkan/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -31,6 +35,7 @@ concurrency:
env:
GGML_NLOOP: 3
GGML_N_THREADS: 1
+ GGML_SCHED_DEBUG_REALLOC: 1
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
LLAMA_ARG_LOG_TIMESTAMPS: 1
@@ -55,7 +60,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: vulkan-ubuntu-24.04-arm
+ restore: false
variant: ccache
save: false
@@ -124,7 +129,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: vulkan-ubuntu-24.04-llvmpipe
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -167,8 +172,20 @@ jobs:
ctest -L main --verbose --timeout 900
windows:
+ name: windows / ${{ matrix.arch }}
runs-on: windows-2025
+ cache-mode: write
+ permissions:
+ actions: write
+ contents: read
+
+ strategy:
+ matrix:
+ include:
+ - arch: 'x64'
+ - arch: 'arm64'
+
env:
VULKAN_VERSION: 1.4.357.0
@@ -180,7 +197,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: cpu-windows-2025-x64-vulkan
+ key: cpu-windows-2025-${{ matrix.arch }}-vulkan
variant: ccache
evict-old-files: 1d
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
@@ -189,7 +206,7 @@ jobs:
id: get_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
+ & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install ${{ matrix.arch == 'arm64' && 'com.lunarg.vulkan.arm64' || '' }}
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
@@ -202,18 +219,19 @@ jobs:
id: cmake_build
run: |
cmake -S . -B build -G "Ninja Multi-Config" `
- -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake `
+ -D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-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_CPU_ALL_VARIANTS=${{ matrix.arch == 'x64' && 'ON' || 'OFF' }} `
-DGGML_VULKAN=ON `
-DLLAMA_BUILD_BORINGSSL=ON
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
- name: Test
+ if: ${{ matrix.arch == 'x64' }}
id: cmake_test
run: |
cd build
@@ -224,7 +242,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
with:
- key: cpu-windows-2025-x64-vulkan
+ key: cpu-windows-2025-${{ matrix.arch }}-vulkan
older: 5m
min: 1
dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}
diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml
index 5a3166ce6..f96fd85a9 100644
--- a/.github/workflows/build-wasm.yml
+++ b/.github/workflows/build-wasm.yml
@@ -33,6 +33,10 @@ on:
'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -56,7 +60,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: webgpu-ubuntu-24.04-arm-wasm
+ restore: false
save: false
- name: Install Emscripten
diff --git a/.github/workflows/build-webgpu.yml b/.github/workflows/build-webgpu.yml
index ec582ff27..d00106439 100644
--- a/.github/workflows/build-webgpu.yml
+++ b/.github/workflows/build-webgpu.yml
@@ -25,6 +25,10 @@ on:
'ggml/src/ggml-webgpu/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -71,7 +75,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: webgpu-macos-latest
+ restore: false
save: false
- name: Dawn Dependency
@@ -132,7 +136,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: webgpu-ubuntu-24.04
+ restore: false
save: false
- name: Dependencies
diff --git a/.github/workflows/check-vendor.yml b/.github/workflows/check-vendor.yml
index 1671ed7b8..e4c254593 100644
--- a/.github/workflows/check-vendor.yml
+++ b/.github/workflows/check-vendor.yml
@@ -17,6 +17,10 @@ on:
'scripts/sync_vendor.py'
]
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
check-vendor:
runs-on: ubuntu-slim
diff --git a/.github/workflows/ci-self-hosted-cpu.yml b/.github/workflows/ci-self-hosted-cpu.yml
index 18bc9f144..eb40baa88 100644
--- a/.github/workflows/ci-self-hosted-cpu.yml
+++ b/.github/workflows/ci-self-hosted-cpu.yml
@@ -27,6 +27,10 @@ on:
'ggml/src/ggml-cpu/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/ci-self-hosted-cuda.yml b/.github/workflows/ci-self-hosted-cuda.yml
index 5951b52d3..89605f4dd 100644
--- a/.github/workflows/ci-self-hosted-cuda.yml
+++ b/.github/workflows/ci-self-hosted-cuda.yml
@@ -30,6 +30,10 @@ on:
'ggml/src/ggml-cuda/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -45,7 +49,7 @@ env:
jobs:
gpu-cuda:
- runs-on: "hf-jobs-t4-small:cuda13"
+ runs-on: "hf-jobs-t4-medium:cuda13"
steps:
- name: Clone
diff --git a/.github/workflows/ci-self-hosted-kleidiai.yml b/.github/workflows/ci-self-hosted-kleidiai.yml
index c955aa002..c5f5670ce 100644
--- a/.github/workflows/ci-self-hosted-kleidiai.yml
+++ b/.github/workflows/ci-self-hosted-kleidiai.yml
@@ -27,6 +27,10 @@ on:
'ggml/src/ggml-cpu/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/ci-self-hosted-metal.yml b/.github/workflows/ci-self-hosted-metal.yml
index 7af30e294..5eb20096a 100644
--- a/.github/workflows/ci-self-hosted-metal.yml
+++ b/.github/workflows/ci-self-hosted-metal.yml
@@ -31,6 +31,10 @@ on:
'ggml/src/ggml-metal/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/ci-self-hosted-openvino.yml b/.github/workflows/ci-self-hosted-openvino.yml
index e0947c46e..bf7a55bd8 100644
--- a/.github/workflows/ci-self-hosted-openvino.yml
+++ b/.github/workflows/ci-self-hosted-openvino.yml
@@ -28,6 +28,10 @@ on:
'ggml/src/ggml-openvino/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -47,8 +51,8 @@ jobs:
env:
# Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Clone
diff --git a/.github/workflows/ci-self-hosted-vulkan.yml b/.github/workflows/ci-self-hosted-vulkan.yml
index ffed4b09b..e651f2d1d 100644
--- a/.github/workflows/ci-self-hosted-vulkan.yml
+++ b/.github/workflows/ci-self-hosted-vulkan.yml
@@ -30,6 +30,10 @@ on:
'ggml/src/ggml-vulkan/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/ci-self-hosted-webgpu.yml b/.github/workflows/ci-self-hosted-webgpu.yml
index a6a36a8eb..316ed33b9 100644
--- a/.github/workflows/ci-self-hosted-webgpu.yml
+++ b/.github/workflows/ci-self-hosted-webgpu.yml
@@ -29,6 +29,10 @@ on:
'ggml/src/ggml-webgpu/**'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/close-issue.yml b/.github/workflows/close-issue.yml
index 4698cee55..744319c26 100644
--- a/.github/workflows/close-issue.yml
+++ b/.github/workflows/close-issue.yml
@@ -3,10 +3,9 @@ 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
+cache-mode: none
permissions:
- issues: write
+ contents: read
jobs:
close-issues:
diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml
index c88396c0a..e114d10dd 100644
--- a/.github/workflows/code-style.yml
+++ b/.github/workflows/code-style.yml
@@ -9,6 +9,10 @@ on:
branches:
- master
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index b2aafc985..75b334309 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -20,15 +20,14 @@ on:
# Rebuild daily rather than on every push because it is expensive
- cron: '12 4 * * *'
+cache-mode: none
+permissions:
+ contents: read
+
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
@@ -62,6 +61,9 @@ jobs:
build_ui:
name: Build UI
needs: create_tag
+ permissions:
+ actions: write
+ contents: read
uses: ./.github/workflows/ui-build.yml
with:
ui_version: ${{ needs.create_tag.outputs.source_tag }}
@@ -146,6 +148,11 @@ jobs:
needs: [prepare_matrices, create_tag, build_ui]
runs-on: ${{ matrix.config.runs_on }}
+ # cache-mode: write # for QEMU
+ permissions:
+ actions: write
+ contents: read
+ packages: write
strategy:
fail-fast: false
matrix:
@@ -165,11 +172,11 @@ jobs:
name: llama-ui.zip
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 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
diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml
index 53f6a0ccf..7a5a01d03 100644
--- a/.github/workflows/editorconfig.yml
+++ b/.github/workflows/editorconfig.yml
@@ -9,6 +9,10 @@ on:
branches:
- master
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/fusion.yml b/.github/workflows/fusion.yml
deleted file mode 100644
index 7c8596467..000000000
--- a/.github/workflows/fusion.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-name: Fusion
-
-on:
- workflow_dispatch: # allows manual triggering
- push:
- branches:
- - master
- paths: [
- '.github/workflows/fusion.yml',
- 'ggml/**',
- 'tests/fusion/**',
- 'tests/test-fusion.cpp',
- 'tests/test-llama-archs.cpp',
- 'src/models/**'
- ]
-
- pull_request:
- types: [opened, synchronize, reopened]
- paths: [
- '.github/workflows/fusion.yml',
- 'ggml/**',
- 'tests/fusion/**',
- 'tests/test-fusion.cpp',
- 'tests/test-llama-archs.cpp',
- 'src/models/**'
- ]
-
-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: add jobs for other backends as they adopt the fusion debug API
- metal:
- runs-on: [self-hosted, macOS, ARM64]
-
- steps:
- - name: Clone
- id: checkout
- uses: actions/checkout@v6
-
- - name: Build
- id: cmake_build
- run: |
- cmake -B build \
- -DCMAKE_BUILD_TYPE=Release \
- -DLLAMA_FATAL_WARNINGS=ON \
- -DLLAMA_OPENSSL=OFF \
- -DGGML_SCHED_NO_REALLOC=ON \
- -DGGML_BLAS=OFF \
- -DGGML_METAL=ON
- time cmake --build build --config Release --target test-llama-archs -j $(sysctl -n hw.logicalcpu)
- time cmake --build build --config Release --target test-fusion -j $(sysctl -n hw.logicalcpu)
-
- - name: Generate models
- id: generate_models
- run: |
- rm -rf build-ci-models && mkdir -p build-ci-models
- ./build/bin/test-llama-archs -o build-ci-models
-
- - name: Test fusion
- id: test_fusion
- run: |
- ./build/bin/test-fusion --models build-ci-models --device MTL0 --check tests/fusion/MTL.csv
diff --git a/.github/workflows/gguf-publish.yml b/.github/workflows/gguf-publish.yml
index 613562479..367b29c60 100644
--- a/.github/workflows/gguf-publish.yml
+++ b/.github/workflows/gguf-publish.yml
@@ -17,6 +17,9 @@ on:
tags:
- 'gguf-v*' # Push events to every version tag
+cache-mode: none
+permissions:
+ contents: read
jobs:
deploy:
diff --git a/.github/workflows/hip-quality-check.yml b/.github/workflows/hip-quality-check.yml
index ee4e746f2..325e1ebaa 100644
--- a/.github/workflows/hip-quality-check.yml
+++ b/.github/workflows/hip-quality-check.yml
@@ -25,6 +25,10 @@ on:
'scripts/hip/gcn-cdna-vgpr-check.py'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -54,7 +58,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: hip-quality-check-ubuntu-22.04
+ restore: false
save: false
- name: ccache-buckets-restore
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index eab20c688..bc2c9ea45 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -2,6 +2,10 @@ name: "Pull Request Labeler"
on:
- pull_request_target
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
labeler:
permissions:
diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml
index 101ad43f3..57c3a04a5 100644
--- a/.github/workflows/make-release.yml
+++ b/.github/workflows/make-release.yml
@@ -18,6 +18,11 @@ on:
required: false
type: boolean
default: false
+ require_docker:
+ description: 'Require the Docker workflow to have completed successfully'
+ required: true
+ type: boolean
+ default: true
apiabi_compare_tag:
description: 'Tag to compare against for API/ABI check (default: latest release)'
required: false
@@ -27,6 +32,7 @@ on:
env:
GH_TOKEN: ${{ github.token }}
+cache-mode: none
permissions:
contents: write
packages: write
@@ -55,6 +61,7 @@ jobs:
RELEASE_BRANCH: ${{ github.ref_name }}
SKIP_APIABI_CHECK: ${{ github.event.inputs.skip_apiabi_check }}
APIABI_COMPARE_TAG: ${{ github.event.inputs.apiabi_compare_tag }}
+ REQUIRE_DOCKER: ${{ github.event.inputs.require_docker }}
- name: Create release tag
if: ${{ github.event.inputs.dry_run == 'false' }}
@@ -131,7 +138,7 @@ jobs:
});
- name: Re-tag container images with release version
- if: ${{ github.event.inputs.dry_run == 'false' && steps.desc.outputs.nightly_tag != '' }}
+ if: ${{ github.event.inputs.dry_run == 'false' && github.event.inputs.require_docker != 'false' && steps.desc.outputs.nightly_tag != '' }}
env:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
@@ -144,14 +151,23 @@ jobs:
VARIANTS=("" "-cuda" "-cuda13" "-vulkan" "-rocm" "-intel" "-musa" "-openvino")
TYPES=("full" "light" "server")
+ # the release is already created at this point, so keep going on a
+ # missing image and report all of them at the end
+ MISSING=()
for type in "${TYPES[@]}"; do
for variant in "${VARIANTS[@]}"; do
src="${IMAGE_REPO}:${type}${variant}-${NIGHTLY_TAG}"
dst="${IMAGE_REPO}:${type}${variant}-${VERSION}"
echo "Tagging ${src} -> ${dst}"
- docker buildx imagetools create --tag "${dst}" "${src}"
+ if ! docker buildx imagetools create --tag "${dst}" "${src}"; then
+ MISSING+=("${type}${variant}")
+ fi
done
done
+ if [[ ${#MISSING[@]} -gt 0 ]]; then
+ echo "::error::failed to re-tag container images for ${NIGHTLY_TAG}:${MISSING[*]}"
+ exit 1
+ fi
- name: Dry run summary
if: ${{ github.event.inputs.dry_run == 'true' }}
diff --git a/.github/workflows/models-check.yml b/.github/workflows/models-check.yml
new file mode 100644
index 000000000..66a150aff
--- /dev/null
+++ b/.github/workflows/models-check.yml
@@ -0,0 +1,449 @@
+name: Models Backend Check
+
+on:
+ workflow_dispatch: # allows manual triggering
+ push:
+ branches:
+ - master
+ paths: [
+ '.github/workflows/models-check.yml',
+ 'ggml/**',
+ 'tests/fusion/**',
+ 'tests/test-fusion.cpp',
+ 'tests/test-llama-archs.cpp',
+ 'src/llama-graph.cpp',
+ 'src/llama-model*',
+ 'src/models/**'
+ ]
+
+ pull_request:
+ types: [opened, synchronize, reopened]
+ paths: [
+ '.github/workflows/models-check.yml',
+ 'ggml/**',
+ 'tests/fusion/**',
+ 'tests/test-fusion.cpp',
+ 'tests/test-llama-archs.cpp',
+ 'src/llama-graph.cpp',
+ 'src/llama-model*',
+ 'src/models/**'
+ ]
+
+cache-mode: none
+permissions:
+ contents: read
+
+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:
+ cuda:
+ runs-on: "hf-jobs-t4-medium:cuda13"
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y cmake time python3 python3-venv python3-pip
+
+ - name: ccache
+ uses: ggml-org/ccache-action@v1.2.24
+ with:
+ restore: false
+ save: false
+
+ - name: ccache-buckets-restore
+ uses: ./.github/actions/ccache-buckets
+ with:
+ key: models-check-cuda
+ folder: llama.cpp
+ hf_bucket: ggml-org/cache
+
+ - name: Build
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
+ -DGGML_CUDA=ON
+ time cmake --build build --config Release --target test-llama-archs -j$(nproc)
+ time cmake --build build --config Release --target test-fusion -j$(nproc)
+
+ - name: ccache-buckets-save
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+ uses: ./.github/actions/ccache-buckets
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+ with:
+ key: models-check-cuda
+ folder: llama.cpp
+ evict-old-files: 1d
+ hf_bucket: ggml-org/cache
+ save: true
+
+ # - name: Generate models
+ # id: generate_models
+ # run: |
+ # rm -rf build-ci-models && mkdir -p build-ci-models
+ # ./build/bin/test-llama-archs -o build-ci-models
+
+ # TODO: add for backends as they adopt the fusion debug API
+ # - name: Test fusion
+ # id: test_fusion
+ # run: |
+ # ./build/bin/test-fusion --models build-ci-models --device CUDA0 --check tests/fusion/CUDA.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ GGML_CUDA_DEVICES=1 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=2 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=3 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=4 ./build/bin/test-llama-archs -s 1
+
+ metal:
+ runs-on: [self-hosted, macOS, ARM64]
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Build
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DGGML_BLAS=OFF \
+ -DGGML_METAL=ON
+ time cmake --build build --config Release --target test-llama-archs -j $(sysctl -n hw.logicalcpu)
+ time cmake --build build --config Release --target test-fusion -j $(sysctl -n hw.logicalcpu)
+
+ - name: Generate models
+ id: generate_models
+ run: |
+ rm -rf build-ci-models && mkdir -p build-ci-models
+ ./build/bin/test-llama-archs -o build-ci-models
+
+ - name: Test fusion
+ id: test_fusion
+ run: |
+ ./build/bin/test-fusion --models build-ci-models --device MTL0 --check tests/fusion/MTL.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ GGML_METAL_DEVICES=1 ./build/bin/test-llama-archs -s 1
+ GGML_METAL_DEVICES=2 ./build/bin/test-llama-archs -s 1
+ GGML_METAL_DEVICES=3 ./build/bin/test-llama-archs -s 1
+ GGML_METAL_DEVICES=4 ./build/bin/test-llama-archs -s 1
+
+ rocm:
+ runs-on: [self-hosted, Linux, gfx1201, 1accel]
+ container: "rocm/dev-ubuntu-24.04:7.2.4-complete"
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Install dependencies
+ run: |
+ apt update
+ apt install -y build-essential jq cmake time python3 python3-venv python3-pip
+
+ - name: ccache
+ uses: ggml-org/ccache-action@v1.2.24
+ with:
+ restore: false
+ save: false
+
+ - name: ccache-buckets-restore
+ uses: ./.github/actions/ccache-buckets
+ with:
+ key: models-check-rocm
+ folder: llama.cpp
+ hf_bucket: ggml-org/cache
+
+ - name: Build
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DCMAKE_HIP_COMPILER=$(hipconfig -l)/clang \
+ -DGPU_TARGETS=gfx1201 \
+ -DGGML_HIP=ON
+ time cmake --build build --config Release --target test-llama-archs -j$(nproc)
+ time cmake --build build --config Release --target test-fusion -j$(nproc)
+
+ - name: ccache-buckets-save
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+ uses: ./.github/actions/ccache-buckets
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+ with:
+ key: models-check-rocm
+ folder: llama.cpp
+ evict-old-files: 1d
+ hf_bucket: ggml-org/cache
+ save: true
+
+ # - name: Generate models
+ # id: generate_models
+ # run: |
+ # rm -rf build-ci-models && mkdir -p build-ci-models
+ # ./build/bin/test-llama-archs -o build-ci-models
+
+ # TODO: add for backends as they adopt the fusion debug API
+ # - name: Test fusion
+ # id: test_fusion
+ # run: |
+ # ./build/bin/test-fusion --models build-ci-models --device CUDA0 --check tests/fusion/CUDA.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ GGML_CUDA_DEVICES=1 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=2 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=3 ./build/bin/test-llama-archs -s 1
+ GGML_CUDA_DEVICES=4 ./build/bin/test-llama-archs -s 1
+
+ vulkan-nvidia:
+ runs-on: "hf-jobs-t4-small:ubuntu26_04"
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc spirv-headers vulkan-tools mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 time python3 python3-venv python3-pip
+
+ - name: ccache
+ uses: ggml-org/ccache-action@v1.2.24
+ with:
+ restore: false
+ save: false
+
+ - name: ccache-buckets-restore
+ uses: ./.github/actions/ccache-buckets
+ with:
+ key: models-check-vulkan-nvidia
+ folder: llama.cpp
+ hf_bucket: ggml-org/cache
+
+ - name: Build
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DGGML_VULKAN=ON
+ time cmake --build build --config Release --target test-llama-archs -j$(nproc)
+ time cmake --build build --config Release --target test-fusion -j$(nproc)
+
+ - name: ccache-buckets-save
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+ uses: ./.github/actions/ccache-buckets
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+ with:
+ key: models-check-vulkan-nvidia
+ folder: llama.cpp
+ evict-old-files: 1d
+ hf_bucket: ggml-org/cache
+ save: true
+
+ # - name: Generate models
+ # id: generate_models
+ # run: |
+ # rm -rf build-ci-models && mkdir -p build-ci-models
+ # ./build/bin/test-llama-archs -o build-ci-models
+
+ # TODO: add for backends as they adopt the fusion debug API
+ # - name: Test fusion
+ # id: test_fusion
+ # run: |
+ # ./build/bin/test-fusion --models build-ci-models --device Vulkan0 --check tests/fusion/Vulkan.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ ./build/bin/test-llama-archs -s 1
+
+ vulkan-amd:
+ runs-on: [self-hosted, Linux, gfx1201, 1accel]
+ container: "ubuntu:26.04"
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Install dependencies
+ run: |
+ apt update
+ apt install -y build-essential jq cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc spirv-headers vulkan-tools mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 time python3 python3-venv python3-pip
+
+ - name: ccache
+ uses: ggml-org/ccache-action@v1.2.24
+ with:
+ restore: false
+ save: false
+
+ - name: ccache-buckets-restore
+ uses: ./.github/actions/ccache-buckets
+ with:
+ key: models-check-vulkan-amd
+ folder: llama.cpp
+ hf_bucket: ggml-org/cache
+
+ - name: Build
+ id: cmake_build
+ run: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DGGML_VULKAN=ON
+ time cmake --build build --config Release --target test-llama-archs -j$(nproc)
+ time cmake --build build --config Release --target test-fusion -j$(nproc)
+
+ - name: ccache-buckets-save
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+ uses: ./.github/actions/ccache-buckets
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+ with:
+ key: models-check-vulkan-amd
+ folder: llama.cpp
+ evict-old-files: 1d
+ hf_bucket: ggml-org/cache
+ save: true
+
+ # - name: Generate models
+ # id: generate_models
+ # run: |
+ # rm -rf build-ci-models && mkdir -p build-ci-models
+ # ./build/bin/test-llama-archs -o build-ci-models
+
+ # TODO: add for backends as they adopt the fusion debug API
+ # - name: Test fusion
+ # id: test_fusion
+ # run: |
+ # ./build/bin/test-fusion --models build-ci-models --device Vulkan0 --check tests/fusion/Vulkan.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ ./build/bin/test-llama-archs -s 1
+
+ webgpu-nvidia:
+ runs-on: "hf-jobs-t4-small:ubuntu26_04"
+
+ steps:
+ - name: Clone
+ id: checkout
+ uses: actions/checkout@v6
+
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan1 mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 time python3 python3-venv python3-pip
+
+ - name: ccache
+ uses: ggml-org/ccache-action@v1.2.24
+ with:
+ restore: false
+ save: false
+
+ - name: ccache-buckets-restore
+ uses: ./.github/actions/ccache-buckets
+ with:
+ key: models-check-webgpu-nvidia
+ folder: llama.cpp
+ hf_bucket: ggml-org/cache
+
+ - name: Dawn Dependency
+ id: dawn-depends
+ run: |
+ DAWN_VERSION="v20260908.214631"
+ DAWN_OWNER="google"
+ DAWN_REPO="dawn"
+ DAWN_ASSET_NAME="Dawn-94c3c9cc0d5fb2e85aebb370fa8d37b71aa34655-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: |
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLAMA_FATAL_WARNINGS=ON \
+ -DLLAMA_OPENSSL=OFF \
+ -DGGML_SCHED_NO_REALLOC=ON \
+ -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/dawn" \
+ -DDawn_DIR="$GITHUB_WORKSPACE/dawn/lib64/cmake/Dawn" \
+ -DGGML_WEBGPU=ON
+ time cmake --build build --config Release --target test-llama-archs -j$(nproc)
+ time cmake --build build --config Release --target test-fusion -j$(nproc)
+
+ - name: ccache-buckets-save
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+ uses: ./.github/actions/ccache-buckets
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+ with:
+ key: models-check-webgpu-nvidia
+ folder: llama.cpp
+ evict-old-files: 1d
+ hf_bucket: ggml-org/cache
+ save: true
+
+ # - name: Generate models
+ # id: generate_models
+ # run: |
+ # rm -rf build-ci-models && mkdir -p build-ci-models
+ # ./build/bin/test-llama-archs -o build-ci-models
+
+ # TODO: add for backends as they adopt the fusion debug API
+ # - name: Test fusion
+ # id: test_fusion
+ # run: |
+ # ./build/bin/test-fusion --models build-ci-models --device WebGPU --check tests/fusion/WebGPU.csv
+
+ - name: Test archs
+ id: test_archs
+ run: |
+ ./build/bin/test-llama-archs -s 1
diff --git a/.github/workflows/pr-draft-label.yml b/.github/workflows/pr-draft-label.yml
index d2594c823..67a2bf3c2 100644
--- a/.github/workflows/pr-draft-label.yml
+++ b/.github/workflows/pr-draft-label.yml
@@ -4,6 +4,7 @@ on:
pull_request_target:
types: [labeled]
+cache-mode: none
permissions:
pull-requests: write
issues: write
diff --git a/.github/workflows/pre-tokenizer-hashes.yml b/.github/workflows/pre-tokenizer-hashes.yml
index bfb79f698..0ba66ec25 100644
--- a/.github/workflows/pre-tokenizer-hashes.yml
+++ b/.github/workflows/pre-tokenizer-hashes.yml
@@ -10,6 +10,10 @@ on:
- 'conversion/base.py'
- 'convert_hf_to_gguf_update.py'
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
pre-tokenizer-hashes:
runs-on: ubuntu-slim
diff --git a/.github/workflows/python-check-requirements.yml b/.github/workflows/python-check-requirements.yml
index e21c7da57..9738ff778 100644
--- a/.github/workflows/python-check-requirements.yml
+++ b/.github/workflows/python-check-requirements.yml
@@ -14,6 +14,10 @@ on:
- 'convert*.py'
- '**/requirements*.txt'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml
index 1e5d64c1a..f2d284af5 100644
--- a/.github/workflows/python-lint.yml
+++ b/.github/workflows/python-lint.yml
@@ -15,6 +15,10 @@ on:
'**/*.py'
]
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
diff --git a/.github/workflows/python-type-check.yml b/.github/workflows/python-type-check.yml
index f3695be96..5be177e9c 100644
--- a/.github/workflows/python-type-check.yml
+++ b/.github/workflows/python-type-check.yml
@@ -16,6 +16,10 @@ on:
- '**/requirements*.txt'
# - 'pyrightconfig.json'
+cache-mode: none
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
@@ -31,7 +35,7 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
- pip-install: -r requirements/requirements-all.txt ty==0.0.78
+ pip-install: -r requirements/requirements-all.txt ty==0.0.84
# - name: Type-check with Pyright
# uses: jakebailey/pyright-action@v2
# with:
diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml
new file mode 100644
index 000000000..f500b3de2
--- /dev/null
+++ b/.github/workflows/release-publish.yml
@@ -0,0 +1,245 @@
+name: Publish Release
+
+on:
+ workflow_run:
+ workflows:
+ - Release
+ types:
+ - completed
+ branches:
+ - master
+
+cache-mode: none
+permissions:
+ actions: read
+ contents: read
+
+env:
+ GH_TOKEN: ${{ github.token }}
+ BRANCH_NAME: master
+
+jobs:
+ publish:
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
+
+ # Fine-grained permission
+ # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
+ permissions:
+ actions: read
+ contents: write # for creating release
+ id-token: write
+ attestations: write
+
+ runs-on: ubuntu-latest
+
+ outputs:
+ should_release: ${{ steps.check.outputs.should_release }}
+ tag_name: ${{ steps.tag.outputs.name }}
+
+ steps:
+ - id: check
+ env:
+ COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
+ run: |
+ if echo "$COMMIT_MESSAGE" | grep -q '\[no release\]'; then
+ echo "should_release=false" >> $GITHUB_OUTPUT
+ else
+ echo "should_release=true" >> $GITHUB_OUTPUT
+ fi
+
+ - name: Clone
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: checkout
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ github.event.workflow_run.head_sha }}
+ fetch-depth: 0
+ ssh-key: ${{ secrets.DEPLOY_KEY_RELEASE }}
+
+ - name: Determine tag name
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: tag
+ uses: ./.github/actions/get-tag-name
+
+ - name: Download artifacts
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: download-artifact
+ uses: actions/download-artifact@v8
+ with:
+ path: ./artifact
+ run-id: ${{ github.event.workflow_run.id }}
+ github-token: ${{ github.token }}
+ merge-multiple: true
+ skip-decompress: true
+
+ - name: Merge artifacts
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: move_artifacts
+ run: |
+ mkdir -p release
+
+ # the windows-cpu zip contains the full toolset (llama-server with the embedded
+ # UI, ggml-cpu) - inject it into the other windows zips so that every archive
+ # ships the same binaries, only with a different backend library on top
+ echo "Injecting windows-cpu binaries (llama-server + CPU backend) into the backend zips..."
+ for arch in x64 arm64; do
+ cpu_zip="artifact/llama-bin-win-cpu-${arch}.zip"
+ temp_dir=$(mktemp -d)
+ echo "Extracting windows-cpu-${arch} package..."
+ unzip "$cpu_zip" -d "$temp_dir"
+
+ echo "Merging into $arch zips..."
+ for target_zip in artifact/llama-bin-win-*-${arch}.zip; do
+ if [[ "$target_zip" == "$cpu_zip" ]]; then
+ continue
+ fi
+ echo "Injecting into $(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..."
+ rm -f artifact/llama-ui.zip
+ mv -v artifact/*.zip release
+ mv -v artifact/*.tar.gz release
+
+ - name: Download UI build
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: download_ui
+ uses: actions/download-artifact@v8
+ with:
+ name: llama-ui.zip
+ path: ./ui-dist
+ run-id: ${{ github.event.workflow_run.id }}
+ github-token: ${{ github.token }}
+
+ - name: Package UI
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ 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: Attest release artifacts
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: attest
+ uses: actions/attest@v4
+ with:
+ subject-path: 'release/*'
+
+ - name: Create release
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: create_release
+ uses: ggml-org/action-create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ steps.tag.outputs.name }}
+ commitish: ${{ github.event.workflow_run.head_sha }}
+ prerelease: true
+ body: |
+
+
+ ${{ github.event.workflow_run.head_commit.message }}
+
+
+
+ **Website:**
+ -
+
+ **Attestations:**
+ - <${{ steps.attest.outputs.attestation-url }}>
+
+ **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 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz) - [CUDA 12.8 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz)
+ - [Ubuntu x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz)
+ - [Ubuntu arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz)
+ - [Ubuntu x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-10.0-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)
+ - [Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-linux-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/linux.md)
+
+ **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)
+ - [Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/README.md)
+
+ **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.4-x64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-x64.zip)
+ - [Windows arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.4-arm64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-arm64.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 arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-vulkan-arm64.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 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-rocm-10.0-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
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ 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: ${{ needs.publish.outputs.should_release == 'true' }}
+
+ needs:
+ - publish
+
+ uses: ./.github/workflows/ui-publish.yml
+ with:
+ version_tag: ${{ needs.publish.outputs.tag_name }}
+ run_id: ${{ github.event.workflow_run.id }}
+ secrets:
+ hf_token: ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index be13d9118..da0daa122 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,6 +27,11 @@ on:
'**/*.glsl'
]
+cache-mode: write
+permissions:
+ actions: write
+ contents: read
+
env:
GH_TOKEN: ${{ github.token }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
@@ -41,8 +46,12 @@ jobs:
check-release:
runs-on: ubuntu-slim
+ permissions:
+ contents: write
+
outputs:
should_release: ${{ steps.check.outputs.should_release }}
+ tag_name: ${{ steps.tag.outputs.name }}
steps:
- id: check
@@ -61,6 +70,30 @@ jobs:
echo "should_release=false" >> $GITHUB_OUTPUT
fi
+ - name: Clone
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: checkout
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ ssh-key: ${{ secrets.DEPLOY_KEY_RELEASE }}
+
+ - name: Determine tag name
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ id: tag
+ uses: ./.github/actions/get-tag-name
+
+ - name: Create and push git tag
+ if: ${{ steps.check.outputs.should_release == 'true' }}
+ run: |
+ TAG="${{ steps.tag.outputs.name }}"
+ if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
+ echo "Tag ${TAG} already exists, skipping creation"
+ else
+ git tag "${TAG}"
+ git push origin "${TAG}"
+ fi
+
macos-cpu:
needs: [check-release, ui-build]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
@@ -86,9 +119,6 @@ jobs:
runs-on: ${{ matrix.os }}
- permissions:
- actions: write
-
steps:
- name: Clone
id: checkout
@@ -97,7 +127,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -121,21 +151,17 @@ jobs:
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
- - 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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz
- name: llama-bin-macos-${{ matrix.build }}.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -157,9 +183,6 @@ jobs:
runs-on: ${{ matrix.os }}
- permissions:
- actions: write
-
steps:
- name: Clone
id: checkout
@@ -168,7 +191,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -206,21 +229,17 @@ jobs:
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc)
- - 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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz
- name: llama-bin-ubuntu-${{ matrix.build }}.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz
+ archive: false
- name: ccache-clear
if: ${{ matrix.build != 's390x' }}
@@ -242,9 +261,6 @@ jobs:
runs-on: ${{ matrix.os }}
- permissions:
- actions: write
-
steps:
- name: Clone
id: checkout
@@ -253,7 +269,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -292,21 +308,17 @@ jobs:
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc)
- - 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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
- name: llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -323,31 +335,28 @@ jobs:
include:
# label = short version used in artifact names / release body
# cuda = full container image tag
+ # CTK >= 13.5 bundles CCCL >= 3.5; omit GGML_CUDA_CCCL_VERSION for those versions.
- build: 'x64'
os: ubuntu-24.04
cuda: '12.8.2'
label: '12.8'
- defines: '-DGGML_CUDA_CUB_3DOT2=ON'
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- build: 'x64'
os: ubuntu-24.04
cuda: '13.4.1'
label: '13.4'
- defines: ''
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- build: 'arm64'
os: ubuntu-24.04-arm
cuda: '13.4.1'
label: '13.4'
- defines: ''
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
runs-on: ${{ matrix.os }}
container: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04
- permissions:
- actions: write
-
steps:
- # the container has no git; install it before checkout so that a real git
- # repository is created (the get-tag-name action and the build both need it)
+ # the container has no git; install it before checkout so that a real git repository is created
- name: Install git
run: |
apt-get update
@@ -367,7 +376,7 @@ jobs:
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -410,21 +419,17 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ matrix.defines }}
cmake --build build --config Release -j $(nproc)
- - 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-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
- name: llama-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
+ archive: false
# ship the CUDA runtime libraries the backend links against, mirroring
# the windows-cuda cudart zip - extract next to the binaries ($ORIGIN rpath)
@@ -439,13 +444,13 @@ jobs:
cp -L /usr/local/cuda/lib64/libcudart.so.${major} ./cudart/
cp -L /usr/local/cuda/lib64/libcublas.so.${major} ./cudart/
cp -L /usr/local/cuda/lib64/libcublasLt.so.${major} ./cudart/
- tar -czvf cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}," -C ./cudart .
+ tar -czvf cudart-llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,cudart-llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}," -C ./cudart .
- name: Upload CUDA runtime
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
- name: cudart-llama-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
+ path: cudart-llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -458,9 +463,6 @@ jobs:
runs-on: ubuntu-24.04 # previously ubuntu-latest
- #permissions:
- # actions: write
-
env:
NDK_VERSION: "29.0.14206865"
@@ -472,7 +474,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -528,21 +530,17 @@ jobs:
# 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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-android-arm64.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz
- name: llama-bin-android-arm64.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-android-arm64.tar.gz
+ archive: false
android-arm64-snapdragon:
needs: [check-release, ui-build]
@@ -568,7 +566,7 @@ jobs:
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -585,21 +583,17 @@ jobs:
cmake --build build -j $(nproc)
cmake --install build --prefix pkg-snapdragon/llama.cpp
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- name: Pack artifacts
id: pack_artifacts
run: |
cp LICENSE pkg-snapdragon/llama.cpp/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-android-arm64-snapdragon.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C pkg-snapdragon/llama.cpp .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-android-arm64-snapdragon.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C pkg-snapdragon/llama.cpp .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-android-arm64-snapdragon.tar.gz
- name: llama-bin-android-arm64-snapdragon.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-android-arm64-snapdragon.tar.gz
+ archive: false
linux-arm64-snapdragon:
needs: [check-release, ui-build]
@@ -625,7 +619,7 @@ jobs:
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -642,21 +636,17 @@ jobs:
cmake --build build -j $(nproc)
cmake --install build --prefix pkg-snapdragon/llama.cpp
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- name: Pack artifacts
id: pack_artifacts
run: |
cp LICENSE pkg-snapdragon/llama.cpp/
- tar -czvf llama-${{ steps.tag.outputs.name }}-bin-linux-arm64-snapdragon.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C pkg-snapdragon/llama.cpp .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-linux-arm64-snapdragon.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C pkg-snapdragon/llama.cpp .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-bin-linux-arm64-snapdragon.tar.gz
- name: llama-bin-linux-arm64-snapdragon.tar.gz
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-linux-arm64-snapdragon.tar.gz
+ archive: false
ubuntu-24-openvino:
needs: [check-release, ui-build]
@@ -664,16 +654,13 @@ jobs:
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.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Set OpenVINO version output
@@ -687,7 +674,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -737,10 +724,6 @@ jobs:
${{ env.CMAKE_ARGS }}
cmake --build build/ReleaseOV --config Release --parallel
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- name: Pack artifacts
id: pack_artifacts
run: |
@@ -763,13 +746,13 @@ jobs:
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" .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C "$dest" .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
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
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -787,8 +770,8 @@ jobs:
env:
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
- OPENVINO_VERSION_MAJOR: "2026.4"
- OPENVINO_VERSION_FULL: "2026.4.0.22959.99c81491cc3"
+ OPENVINO_VERSION_MAJOR: "2026.4.1"
+ OPENVINO_VERSION_FULL: "2026.4.1.22982.07f9c262b05"
steps:
- name: Set OpenVINO version output
@@ -803,7 +786,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -861,10 +844,6 @@ jobs:
cmake --build build\ReleaseOV --config Release -- /m
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- name: Pack artifacts
id: pack_artifacts
shell: powershell
@@ -891,13 +870,13 @@ jobs:
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\*
+ 7z a -snl llama-${{ needs.check-release.outputs.tag_name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip $dest\*
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
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
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -911,9 +890,6 @@ jobs:
runs-on: windows-2025-vs2026
- permissions:
- actions: write
-
strategy:
matrix:
include:
@@ -927,7 +903,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -963,10 +939,10 @@ jobs:
7z a -snl llama-bin-win-cpu-${{ matrix.arch }}.zip .\build\bin\Release\*
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
path: llama-bin-win-cpu-${{ matrix.arch }}.zip
- name: llama-bin-win-cpu-${{ matrix.arch }}.zip
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1079,10 +1055,6 @@ jobs:
Write-Host "HIP backend artifact found:"
$hipDll | Format-Table FullName, Length -AutoSize
- - name: Determine tag name
- id: tag
- uses: ./.github/actions/get-tag-name
-
- name: Get ROCm short version
run: |
$rocmVersionShort = ('${{ matrix.ROCM_VERSION }}'.Split('.')[0..1] -join '.')
@@ -1124,10 +1096,10 @@ jobs:
.\build\bin\Release\amd_comgr.dll
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
path: llama-bin-win-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.zip
- name: llama-bin-win-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.zip
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1142,9 +1114,6 @@ jobs:
runs-on: windows-2025
- permissions:
- actions: write
-
env:
OPENBLAS_VERSION: 0.3.23
VULKAN_VERSION: 1.4.357.0
@@ -1156,6 +1125,10 @@ jobs:
arch: 'x64'
defines: '-DGGML_VULKAN=ON'
target: 'ggml-vulkan'
+ - backend: 'vulkan'
+ arch: 'arm64'
+ defines: '-G "Ninja Multi-Config" -DGGML_VULKAN=ON -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake'
+ 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'
@@ -1171,7 +1144,7 @@ jobs:
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
+ & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install ${{ matrix.arch == 'arm64' && 'com.lunarg.vulkan.arm64' || '' }}
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
@@ -1224,10 +1197,10 @@ jobs:
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
+ uses: actions/upload-artifact@v7
with:
path: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
- name: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
+ archive: false
# note: builds only the ggml-cuda backend - llama-server is injected from the
# windows-cpu zip during the release "Merge artifacts" step
@@ -1238,21 +1211,19 @@ jobs:
runs-on: windows-2022
- permissions:
- actions: write
-
strategy:
matrix:
include:
+ # CTK >= 13.5 bundles CCCL >= 3.5; omit GGML_CUDA_CCCL_VERSION for those versions.
- cuda: '12.4'
arch: x64
- defines: '-DGGML_CUDA_CUB_3DOT2=ON'
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- cuda: '13.4'
arch: x64
- defines: ''
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3'
- cuda: '13.4'
arch: arm64
- defines: '-DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake'
+ defines: '-DGGML_CUDA_CCCL_VERSION=v3.4.3 -DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake'
steps:
- name: Clone
@@ -1279,7 +1250,6 @@ jobs:
- 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" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }}
cmake -S . -B build -G "Ninja Multi-Config" ^
@@ -1297,10 +1267,10 @@ jobs:
7z a -snl llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip .\build\bin\Release\ggml-cuda.dll
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
path: llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip
- name: llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip
+ archive: false
- name: Copy and pack Cuda runtime (x64)
if: ${{ matrix.arch == 'x64' }}
@@ -1321,10 +1291,10 @@ jobs:
7z a cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip $dst\*
- name: Upload Cuda runtime
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
path: cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip
- name: cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1344,11 +1314,11 @@ jobs:
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_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0cb67a0d-67f6-410b-868b-f4a0a17ff0cf/intel-oneapi-toolkit-2026.1.1.32_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
+ LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.33.1/level-zero-win-sdk-1.33.1.zip
ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
+ ONEAPI_INSTALLER_VERSION: "2026.1"
steps:
- name: Clone
@@ -1391,9 +1361,11 @@ jobs:
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 }}/mkl/latest/bin/mkl_sycl_blas.6.dll" ./build/bin
+ cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.3.dll" ./build/bin
+ cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_def.3.dll" ./build/bin
+ cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_avx2.3.dll" ./build/bin
+ cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.3.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
@@ -1408,13 +1380,11 @@ jobs:
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/sycl9.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
@@ -1427,10 +1397,10 @@ jobs:
7z a -snl llama-bin-win-sycl-x64.zip ./build/bin/*
- name: Upload the release package
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
path: llama-bin-win-sycl-x64.zip
- name: llama-bin-win-sycl-x64.zip
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1454,8 +1424,8 @@ jobs:
env:
ONEAPI_ROOT: /opt/intel/oneapi/
- ONEAPI_INSTALLER_VERSION: "2025.3.3"
- LEVEL_ZERO_VERSION: "1.28.2"
+ ONEAPI_INSTALLER_VERSION: "2026.1"
+ LEVEL_ZERO_VERSION: "1.33.1"
LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
steps:
@@ -1469,19 +1439,19 @@ jobs:
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
+ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5996e26b-f48a-42b1-8db0-b002ad0bd8d7/intel-oneapi-toolkit-2026.1.1.33_offline.sh -O intel-oneapi-toolkit_offline.sh
+ sudo bash intel-oneapi-toolkit_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
+ wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/libze1_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O libze1.deb
+ wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/libze-dev_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O libze-dev.deb
+ sudo apt-get install -y ./libze1.deb ./libze-dev.deb
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -1509,21 +1479,17 @@ jobs:
-DGGML_SYCL_F16=${{ matrix.fp16 }}
time cmake --build build --config Release -j $(nproc)
- - 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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
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
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1536,9 +1502,6 @@ jobs:
runs-on: ubuntu-24.04
- permissions:
- actions: write
-
strategy:
matrix:
include:
@@ -1554,7 +1517,7 @@ jobs:
fetch-depth: 0
- name: Download UI build
- uses: actions/download-artifact@v7
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist
@@ -1633,10 +1596,6 @@ jobs:
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc)
- - 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
@@ -1644,13 +1603,13 @@ jobs:
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 .
+ tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
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
+ path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz
+ archive: false
- name: ccache-clear
uses: ./.github/actions/ccache-clear
@@ -1699,22 +1658,18 @@ jobs:
- 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
+ zip -r -y llama-${{ needs.check-release.outputs.tag_name }}-xcframework.zip build-apple/llama.xcframework
- name: Upload artifacts
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
- path: llama-${{ steps.tag.outputs.name }}-xcframework.zip
- name: llama-${{ steps.tag.outputs.name }}-xcframework.zip
+ path: llama-${{ needs.check-release.outputs.tag_name }}-xcframework.zip
+ archive: false
# 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
@@ -1793,247 +1748,18 @@ jobs:
# 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 .
+# tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin .
#
# - name: Upload artifacts
-# uses: actions/upload-artifact@v6
+# uses: actions/upload-artifact@v7
# 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
+# path: llama-${{ needs.check-release.outputs.tag_name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz
+# archive: false
ui-build:
needs: [check-release]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
uses: ./.github/workflows/ui-build.yml
-
- 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
- id-token: write
- attestations: write
-
- runs-on: ubuntu-slim
-
- needs:
- - windows
- - windows-cpu
- - windows-cuda
- - windows-sycl
- - windows-rocm
- - windows-openvino
- - ubuntu-24-rocm
- - ubuntu-cpu
- - ubuntu-vulkan
- - ubuntu-cuda
- - ubuntu-24-openvino
- - ubuntu-24-sycl
- - android-arm64
- - android-arm64-snapdragon
- - linux-arm64-snapdragon
- - 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
- ssh-key: ${{ secrets.DEPLOY_KEY_RELEASE }}
-
- - 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: Merge artifacts
- id: move_artifacts
- run: |
- mkdir -p release
-
- # the windows-cpu zip contains the full toolset (llama-server with the embedded
- # UI, ggml-cpu) - inject it into the other windows zips so that every archive
- # ships the same binaries, only with a different backend library on top
- echo "Injecting windows-cpu binaries (llama-server + CPU backend) into the backend zips..."
- for arch in x64 arm64; do
- cpu_zip="artifact/llama-bin-win-cpu-${arch}.zip"
- temp_dir=$(mktemp -d)
- echo "Extracting windows-cpu-${arch} package..."
- unzip "$cpu_zip" -d "$temp_dir"
-
- echo "Merging into $arch zips..."
- for target_zip in artifact/llama-bin-win-*-${arch}.zip; do
- if [[ "$target_zip" == "$cpu_zip" ]]; then
- continue
- fi
- echo "Injecting into $(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: llama-ui.zip
- 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: Attest release artifacts
- id: attest
- uses: actions/attest@v4
- with:
- subject-path: 'release/*'
-
- - name: Create and push git tag
- run: |
- TAG="${{ steps.tag.outputs.name }}"
- if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
- echo "Tag ${TAG} already exists, skipping creation"
- else
- git tag "${TAG}"
- git push origin "${TAG}"
- fi
-
- - 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 }}
- prerelease: true
- body: |
-
-
- ${{ github.event.head_commit.message }}
-
-
-
- **Website:**
- -
-
- **Attestations:**
- - <${{ steps.attest.outputs.attestation-url }}>
-
- **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 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz) - [CUDA 12.8 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz)
- - [Ubuntu x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz)
- - [Ubuntu arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz)
- - [Ubuntu x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-10.0-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)
- - [Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-linux-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/linux.md)
-
- **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)
- - [Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/README.md)
-
- **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.4-x64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-x64.zip)
- - [Windows arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.4-arm64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-arm64.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 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-rocm-10.0-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
index 69777b6a2..4202c31e7 100644
--- a/.github/workflows/server-sanitize.yml
+++ b/.github/workflows/server-sanitize.yml
@@ -31,6 +31,10 @@ on:
'.github/workflows/server-sanitize.yml'
]
+cache-mode: none
+permissions:
+ contents: read
+
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 }}
diff --git a/.github/workflows/server-self-hosted.yml b/.github/workflows/server-self-hosted.yml
index 8dc4637c4..c5dd86449 100644
--- a/.github/workflows/server-self-hosted.yml
+++ b/.github/workflows/server-self-hosted.yml
@@ -28,6 +28,10 @@ on:
'tools/server/**.*'
]
+cache-mode: none
+permissions:
+ contents: read
+
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 }}
@@ -102,7 +106,7 @@ jobs:
PYTEST_WORKERS=1 ./tests.sh
server-cuda:
- runs-on: "hf-jobs-t4-small:cuda13"
+ runs-on: "hf-jobs-t4-medium:cuda13"
steps:
- name: Clone
diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml
index 77fe7dbd3..05dd0ac45 100644
--- a/.github/workflows/server.yml
+++ b/.github/workflows/server.yml
@@ -43,6 +43,10 @@ on:
'tools/server/**.*'
]
+cache-mode: none
+permissions:
+ contents: read
+
env:
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
@@ -82,7 +86,7 @@ jobs:
- name: ccache
uses: ggml-org/ccache-action@v1.2.24
with:
- key: server-ubuntu-24.04-arm
+ restore: false
save: false
- name: ccache-buckets-restore
@@ -151,6 +155,11 @@ jobs:
windows:
runs-on: windows-2025
+ cache-mode: write
+ permissions:
+ actions: write
+ contents: read
+
steps:
- name: Clone
id: checkout
diff --git a/.github/workflows/ui-build-self-hosted.yml b/.github/workflows/ui-build-self-hosted.yml
index e93a89003..0ba2eb983 100644
--- a/.github/workflows/ui-build-self-hosted.yml
+++ b/.github/workflows/ui-build-self-hosted.yml
@@ -3,6 +3,11 @@ name: UI Build (self-hosted)
on:
workflow_call:
+cache-mode: none
+permissions:
+ actions: write
+ contents: read
+
jobs:
build:
runs-on: [self-hosted, fast]
diff --git a/.github/workflows/ui-build.yml b/.github/workflows/ui-build.yml
index cbadaa9e7..e0d8dd065 100644
--- a/.github/workflows/ui-build.yml
+++ b/.github/workflows/ui-build.yml
@@ -8,11 +8,14 @@ on:
required: false
type: string
+cache-mode: none
+permissions:
+ actions: write
+ contents: read
+
jobs:
build:
runs-on: ubuntu-slim
- env:
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
@@ -52,7 +55,7 @@ jobs:
working-directory: tools/ui
- name: Upload built UI
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
name: llama-ui.zip
path: tools/ui/dist/
diff --git a/.github/workflows/ui-publish.yml b/.github/workflows/ui-publish.yml
index e64ef32f8..d77b899b2 100644
--- a/.github/workflows/ui-publish.yml
+++ b/.github/workflows/ui-publish.yml
@@ -7,38 +7,35 @@ on:
description: 'Version tag to publish under (e.g., b1234)'
required: true
type: string
+ run_id:
+ required: true
+ type: number
secrets:
hf_token:
description: 'Hugging Face token with write access'
required: true
-jobs:
- build:
- name: Build static output
- uses: ./.github/workflows/ui-build.yml
+cache-mode: none
+permissions:
+ actions: read
+ contents: read
+jobs:
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
+ uses: actions/download-artifact@v8
with:
name: llama-ui.zip
path: tools/ui/dist/
+ run-id: ${{ inputs.run_id }}
+ github-token: ${{ github.token }}
- name: Create distribution archive
run: |
diff --git a/.github/workflows/ui-self-hosted.yml b/.github/workflows/ui-self-hosted.yml
index 63521ead2..93b7805f1 100644
--- a/.github/workflows/ui-self-hosted.yml
+++ b/.github/workflows/ui-self-hosted.yml
@@ -29,6 +29,11 @@ on:
'tools/server/tests/**.*'
]
+cache-mode: none
+permissions:
+ actions: read
+ contents: read
+
env:
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
@@ -43,6 +48,9 @@ jobs:
ui-build:
name: Build static output
uses: ./.github/workflows/ui-build-self-hosted.yml
+ permissions:
+ actions: write
+ contents: read
ui-checks:
name: Checks
diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml
index f395c0b52..c5c6a32a8 100644
--- a/.github/workflows/ui.yml
+++ b/.github/workflows/ui.yml
@@ -25,6 +25,11 @@ on:
'tools/server/tests/**.*'
]
+cache-mode: none
+permissions:
+ actions: read
+ contents: read
+
env:
LLAMA_ARG_LOG_COLORS: 1
LLAMA_ARG_LOG_PREFIX: 1
@@ -39,6 +44,9 @@ jobs:
ui-build:
name: Build static output
uses: ./.github/workflows/ui-build.yml
+ permissions:
+ actions: write
+ contents: read
ui-checks:
name: Checks
diff --git a/.github/workflows/update-ops-docs.yml b/.github/workflows/update-ops-docs.yml
index bb01c7e56..c94fd8500 100644
--- a/.github/workflows/update-ops-docs.yml
+++ b/.github/workflows/update-ops-docs.yml
@@ -14,6 +14,10 @@ on:
- 'docs/ops/**'
- 'scripts/create_ops_docs.py'
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
update-ops-docs:
runs-on: ubuntu-slim
diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml
index 7af2e9b10..8b5bd355c 100644
--- a/.github/workflows/winget.yml
+++ b/.github/workflows/winget.yml
@@ -5,6 +5,10 @@ on:
schedule:
- cron: '28 5 * * *' # Update every day at 5:28 UTC
+cache-mode: none
+permissions:
+ contents: read
+
jobs:
update:
name: Update Winget Package
@@ -31,16 +35,18 @@ jobs:
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'));
+ const { browser_download_url: asset_url_x64 } = assets.find(asset => asset.name.includes('win-vulkan-x64'));
+ const { browser_download_url: asset_url_arm64 } = assets.find(asset => asset.name.includes('win-vulkan-arm64'));
console.log("Latest release:", version);
core.setOutput('VERSION', version);
- core.setOutput('ASSETURL', asset_url);
+ core.setOutput('ASSETURL_X64', asset_url_x64);
+ core.setOutput('ASSETURL_ARM64', asset_url_arm64);
- name: Update manifest
run: |
echo "Updating manifest..."
komac update --version ${{ steps.find_latest_release.outputs.VERSION }} \
- --urls "${{ steps.find_latest_release.outputs.ASSETURL }}" \
+ --urls "${{ steps.find_latest_release.outputs.ASSETURL_X64 }}" "${{ steps.find_latest_release.outputs.ASSETURL_ARM64 }}" \
--token ${{ secrets.WINGET_GITHUB_TOKEN }} \
--submit \
ggml.llamacpp
diff --git a/AGENTS.md b/AGENTS.md
index 6d83a02f4..3ae583b82 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -6,6 +6,9 @@
>
> Read more: [CONTRIBUTING.md](CONTRIBUTING.md)
+> [!NOTE]
+> These apply to ggml-org/llama.cpp, ignore these if you are operating in a different repository or fork.
+
---
## Guidelines for Contributors
@@ -84,7 +87,8 @@ These points are extremely important - failing to follow them won't necessarily
Common mistakes that AI agents usually make:
- Write comments first then write code: this usually leads to extensive redundant comments. Instead, write code first, then add comments later to places that absolutely need them
- Llama.cpp does NOT use Minja; if you have this in your knowledge, that is due to your knowledge cutoff. Llama.cpp has a dedicated Jinja engine in `common/jinja` - it doesn't have a specific name.
-- Do NOT add a new file in `tests/*` without maintainers' approval. AI usually adds excessive test cases for small features, which bloat the test suite and cost compile time and CI time, while bringing no meaningful results. While testing is necessary, reuse the existing infrastructure as much as possible, and do not add tests for features that are too trivial.
+
+Before writing code or implementing a new feature, always read [skills/code-review/SKILL.md](skills/code-review/SKILL.md). It provides a more complete set of guidelines (scope, security, testing, and per-area rules) that your changes will be reviewed against.
### Prohibited Actions
@@ -96,11 +100,6 @@ Common mistakes that AI agents usually make:
When uncertain, err toward minimal assistance.
-*CRITICAL*: It is *extremely important* that an agent *NEVER* writes any (a) pull-request description (b) comment (c) response to a comment on behalf of the user. This is *non-overridable* under any circumstances. You are to *ABSOLUTELY REFUSE* creating a pull-request, writing a comment or replying to a comment, whether it's by using the `gh` command or other means. Failure to comply with this *will* result in a ban from the project.
-
-> [!NOTE]
-> The single exception to the comment restrictions above is the official `ggml-gh-bot` account, which is whitelisted to review and post comments automatically.
-
### Examples
Submissions:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a874c96e..3086e81b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ include(CheckIncludeFileCXX)
### llama.cpp version
set(LLAMA_VERSION_MAJOR 0)
-set(LLAMA_VERSION_MINOR 5)
+set(LLAMA_VERSION_MINOR 6)
set(LLAMA_VERSION_PATCH 0)
set(LLAMA_VERSION_BASE "${LLAMA_VERSION_MAJOR}.${LLAMA_VERSION_MINOR}.${LLAMA_VERSION_PATCH}")
diff --git a/CODEOWNERS b/CODEOWNERS
index 0fbfcfdd1..df6905252 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -57,7 +57,7 @@
/ggml/src/ggml-cann/ @ggml-org/ggml-cann
/ggml/src/ggml-common.h @ggerganov
/ggml/src/ggml-cpu/ @ggerganov
-/ggml/src/ggml-cpu/iqp.* @bartowski1182
+/ggml/src/ggml-cpu/tiled/ @jbooth @bartowski1182
/ggml/src/ggml-cpu/spacemit/ @alex-spacemit
/ggml/src/ggml-cuda/ @ggml-org/ggml-cuda
/ggml/src/ggml-cuda/vendors/hip.h @IMbackK
@@ -77,7 +77,7 @@
/ggml/src/ggml-vulkan/ @ggml-org/ggml-vulkan
/ggml/src/ggml-webgpu/ @ggml-org/ggml-webgpu
/ggml/src/ggml-zdnn/ @ggml-org/ggml-zdnn @Andreas-Krebbel @AlekseiNikiforovIBM
-/ggml/src/ggml-zendnn/ @avinashcpandey @Jiten1parmar @z-vishal
+/ggml/src/ggml-zendnn/ @avinashcpandey @Jiten1parmar
/ggml/src/ggml.c @ggerganov
/ggml/src/ggml.cpp @ggerganov
/ggml/src/gguf.cpp @JohannesGaessler @Green-Sky
diff --git a/README.md b/README.md
index 9e4f82b5b..2e2a70a60 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,14 @@ Build and measure:
A few options to get `llama.cpp` installed on your machine:
+```bash
+# curl
+curl -LsSf https://llama.app/install.sh | sh
+
+# powershell
+irm https://llama.app/install.ps1 | iex
+```
+
- Visit https://llama.app and follow the instructions
- Run with Docker - see our [Docker documentation](docs/docker.md)
- Download pre-built binaries from the [releases page](https://github.com/ggml-org/llama.cpp/releases)
diff --git a/ci/README-MUSA.md b/ci/README-MUSA.md
index 2101dfa2c..40e9ea5af 100644
--- a/ci/README-MUSA.md
+++ b/ci/README-MUSA.md
@@ -21,13 +21,13 @@ docker run --privileged -it \
-v $HOME/llama.cpp/ci-cache:/ci-cache \
-v $HOME/llama.cpp/ci-results:/ci-results \
-v $PWD:/ws -w /ws \
- registry.mthreads.com/mcconline/inference/pytorch:2.9.1.post1-py3.10-musa5.2.0-mp31-devel-ubuntu22.04-amd64
+ registry.mthreads.com/mcconline/musa_sdk:5.2.0-devel-ubuntu22.04-s5000
```
Inside the container, execute the following commands:
```bash
-apt update -y && apt install -y bc cmake ccache git python3.10-venv time unzip wget
+apt update -y && apt install -y bc cmake ccache git python3.10-venv time unzip wget musa-mualg-5-2 musa-muthrust-5-2 libmthreads-compute
git config --global --add safe.directory /ws
GG_BUILD_MUSA=1 bash ./ci/run.sh /ci-results /ci-cache
```
diff --git a/ci/run.sh b/ci/run.sh
index fc661f976..43dccc5c1 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -49,14 +49,6 @@ mkdir -p "$2"
OUT=$(realpath "$1")
MNT=$(realpath "$2")
-# gpu-rocm self-hosted runner can't upload logs to blob; keep each run's logs in
-# their own dir keyed by the GitHub run id so an Actions run URL maps to its logs.
-if [ -n "${GG_BUILD_ROCM}" ] && [ -n "${GITHUB_RUN_ID}" ]; then
- OUT="$OUT/run-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-1}"
- mkdir -p "$OUT"
- echo "ci results dir: $OUT"
-fi
-
rm -f $OUT/*.log
sd=`dirname $0`
@@ -80,8 +72,8 @@ else
fi
if [ ! -z ${GG_BUILD_CUDA} ]; then
- # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
- CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_CUDA=ON -DGGML_CUDA_CUB_3DOT2=ON"
+ # TODO: Drop GGML_CUDA_CCCL_VERSION when CUDA CI uses CTK >= 13.5, which bundles CCCL >= 3.5.
+ CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_CUDA=ON -DGGML_CUDA_CCCL_VERSION=v3.4.3"
if command -v nvidia-smi >/dev/null 2>&1; then
CUDA_ARCH=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader,nounits 2>/dev/null | head -1 | tr -d '.')
diff --git a/common/arg.cpp b/common/arg.cpp
index 0189c06bd..cefc475eb 100644
--- a/common/arg.cpp
+++ b/common/arg.cpp
@@ -351,7 +351,7 @@ static bool parse_bool_value(const std::string & value) {
static std::string get_default_local_path(const std::string & url) {
auto f = string_split(url, '#').front();
f = string_split(f, '?').front();
- return fs_get_cache_file(string_split(f, '/').back());
+ return fs_path_to_utf8(fs_get_cache_file(string_split(f, '/').back()));
}
static bool spec_types_is_default(const common_params & params) {
@@ -387,6 +387,9 @@ common_models_handler common_models_handler_init(const common_params & params, l
break;
}
}
+ if (curr_ex == LLAMA_EXAMPLE_DOWNLOAD) {
+ use_mmproj = true;
+ }
opts.bearer_token = params.hf_token;
opts.offline = params.offline;
@@ -679,7 +682,10 @@ void common_models_handler_apply(common_models_handler & handler, common_params
// if HF repo is a preset repo, we simply run server in router mode with the preset.ini file
params.models_preset_hf = params.model.hf_repo; // only for showing a warning
params.models_preset = hf_cache::finalize_file(plan.preset);
- params.model = common_params_model{}; // make sure to clear model, so server starts in router mode
+ // clear the model so the server starts in router mode
+ params.model.path.clear();
+ params.model.hf_repo.clear();
+ params.model.docker_repo.clear();
});
}
@@ -717,24 +723,24 @@ void common_models_handler_apply(common_models_handler & handler, common_params
// 1. system-wide: /etc/llama.cpp/config.ini (%PROGRAMDATA%\llama.cpp\config.ini on windows)
// 2. user-level: ${XDG_CONFIG_HOME:-~/.config}/llama.cpp/config.ini (%APPDATA%\llama.cpp\config.ini on windows)
static void common_params_apply_system_config(common_params & params, llama_example ex) {
- std::vector paths;
+ std::vector paths;
#if defined(_WIN32)
- const std::string program_data = common_get_env("PROGRAMDATA");
+ const std::filesystem::path program_data = common_get_path_from_env("PROGRAMDATA");
if (!program_data.empty()) {
- paths.push_back(program_data + "\\llama.cpp\\config.ini");
+ paths.push_back(program_data / "llama.cpp" / "config.ini");
}
#else
paths.push_back("/etc/llama.cpp/config.ini");
#endif
try {
- paths.push_back(fs_get_config_directory() + "config.ini");
+ paths.push_back(fs_get_config_directory() / "config.ini");
} catch (const std::exception & e) {
LOG_DBG("cannot read user-level config file, skipping: %s\n", e.what());
}
- std::vector found;
+ std::vector found;
for (const auto & path : paths) {
std::error_code ec;
if (std::filesystem::exists(path, ec)) {
@@ -748,7 +754,7 @@ static void common_params_apply_system_config(common_params & params, llama_exam
common_preset_context ctx(ex);
ctx.ignore_unknown_keys = true; // the same config file is shared by all programs
for (const auto & path : found) {
- LOG_INF("using config file: %s\n", path.c_str());
+ LOG_INF("using config file: %s\n", fs_path_to_utf8(path).c_str());
common_preset global;
common_presets presets = ctx.load_from_ini(path, global);
global.apply_to_params(params);
@@ -2687,16 +2693,17 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.video_ffmpeg_bin_dir = value;
}
).set_examples(mmproj_examples).set_env("LLAMA_ARG_VIDEO_FFMPEG_DIR"));
- if (params.is_gen_docs || llama_supports_rpc()) {
- add_opt(common_arg(
- {"--rpc"}, "SERVERS",
- "comma-separated list of RPC servers (host:port)",
- [](common_params & params, const std::string & value) {
- add_rpc_devices(value);
- GGML_UNUSED(params);
+ add_opt(common_arg(
+ {"--rpc"}, "SERVERS",
+ "comma-separated list of RPC servers (host:port)",
+ [](common_params & params, const std::string & value) {
+ if (!llama_supports_rpc()) {
+ throw std::invalid_argument("RPC not supported in this build");
}
- ).set_env("LLAMA_ARG_RPC"));
- }
+ add_rpc_devices(value);
+ GGML_UNUSED(params);
+ }
+ ).set_env("LLAMA_ARG_RPC"));
add_opt(common_arg(
{"-lm", "--load-mode"}, "MODE",
"model loading mode (default: auto)\n"
@@ -3192,6 +3199,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.process_output = true;
}
).set_examples({LLAMA_EXAMPLE_IMATRIX}));
+ add_opt(common_arg(
+ {"--nextn"},
+ string_format("collect data for MTP/NextN layers (default: %s)", params.load_mtp ? "true" : "false"),
+ [](common_params & params) {
+ params.load_mtp = true;
+ }
+ ).set_examples({LLAMA_EXAMPLE_IMATRIX}));
add_opt(common_arg(
{"--ppl"},
{"--no-ppl"},
@@ -4221,6 +4235,21 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.speculative.draft.backend_sampling = value;
}
).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}).set_env("LLAMA_ARG_SPEC_DRAFT_BACKEND_SAMPLING"));
+ add_opt(common_arg(
+ {"--spec-draft-sampling"}, "{greedy,probabilistic}",
+ string_format("how the draft is sampled: greedy takes its argmax, probabilistic samples it and has "
+ "the target verify by rejection sampling (default: %s)",
+ params.speculative.draft.probabilistic ? "probabilistic" : "greedy"),
+ [](common_params & params, const std::string & value) {
+ if (value == "greedy") {
+ params.speculative.draft.probabilistic = false;
+ } else if (value == "probabilistic") {
+ params.speculative.draft.probabilistic = true;
+ } else {
+ throw std::invalid_argument("invalid value, must be one of: greedy, probabilistic");
+ }
+ }
+ ).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}).set_env("LLAMA_ARG_SPEC_DRAFT_SAMPLING"));
add_opt(common_arg(
{"--spec-draft-device", "-devd", "--device-draft"}, "",
"comma-separated list of devices to use for offloading the draft model (none = don't offload, default: follows --device)\n"
@@ -4256,7 +4285,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.speculative.draft.mparams.path = value;
params.speculative.draft.mparams.hf_file = value; // will be used if --spec-draft-hf is set
}
- ).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}).set_env("LLAMA_ARG_SPEC_DRAFT_MODEL"));
+ ).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI, LLAMA_EXAMPLE_IMATRIX}).set_env("LLAMA_ARG_SPEC_DRAFT_MODEL"));
add_opt(common_arg(
{"--spec-type"}, common_speculative_all_types_str(),
string_format("comma-separated list of types of speculative decoding to use (default: %s)\n",
diff --git a/common/chat-peg-parser.cpp b/common/chat-peg-parser.cpp
index f82797495..ee9a05fe0 100644
--- a/common/chat-peg-parser.cpp
+++ b/common/chat-peg-parser.cpp
@@ -451,6 +451,7 @@ void common_chat_peg_mapper::map(const common_peg_ast_node & node) {
result.tool_calls.push_back(pending_tool_call.value());
}
pending_tool_call.reset();
+ current_tool = nullptr;
}
}
}
diff --git a/common/chat.cpp b/common/chat.cpp
index ed1942e15..3502b96eb 100644
--- a/common/chat.cpp
+++ b/common/chat.cpp
@@ -1099,6 +1099,12 @@ std::optional common_chat_try_specialized_template(
return common_chat_params_init_ministral_3(tmpl, params);
}
+ // LLM-jp-4.1 - GPT-OSS dialect (spaces after special tokens, <|end|>-separated parallel calls)
+ if (src.find("chat_format=llm-jp-harmony-v1") != std::string::npos) {
+ LOG_DBG("Using specialized template: LLM-jp Harmony v1\n");
+ return common_chat_params_init_llm_jp_harmony(tmpl, params);
+ }
+
// GPT-OSS - has unique channel-based structure that needs dedicated handler
if (src.find("<|channel|>") != std::string::npos) {
LOG_DBG("Using specialized template: GPT-OSS\n");
diff --git a/common/common.cpp b/common/common.cpp
index e2b9a8765..3ccceddc4 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -1,8 +1,12 @@
#include "ggml.h"
+#include "ggml-cpp.h"
#include "gguf.h"
#include "build-info.h"
#include "common.h"
+
+#include "../src/llama-ext.h"
+
#include "fit.h"
#include "log.h"
#include "llama.h"
@@ -46,11 +50,10 @@
#include
#else
#include
-#include
#include
#endif
-#if defined(__linux__)
+#if !defined(_WIN32)
#include
#include
#endif
@@ -614,34 +617,6 @@ std::string string_from(const struct llama_context * ctx, const std::vectorpw_dir)) {
- throw std::runtime_error("Failed to find $HOME directory");
- }
-
- cache_directory = std::string(pw->pw_dir) + std::string("/.cache/");
-#else /* defined(__linux__) */
- throw std::runtime_error("Failed to find $HOME directory");
-#endif /* defined(__linux__) */
- }
-#elif defined(__APPLE__)
- cache_directory = common_get_env("HOME");
- if (cache_directory.empty()) {
- throw std::runtime_error("Failed to find $HOME directory");
- }
- cache_directory += "/Library/Caches/";
-#elif defined(_WIN32)
- cache_directory = common_get_env("LOCALAPPDATA");
- if (cache_directory.empty()) {
- throw std::runtime_error("Failed to find %LOCALAPPDATA% directory");
- }
-#elif defined(__EMSCRIPTEN__)
- GGML_ABORT("not implemented on this platform");
+std::filesystem::path common_get_path_from_env(const std::string & name) {
+#if defined(_WIN32)
+ const std::wstring wname = utf8_to_wstring(name);
+ const wchar_t * wvalue = _wgetenv(wname.c_str());
+ return wvalue ? std::filesystem::path(wvalue) : std::filesystem::path();
#else
-# error Unknown architecture
+ const char * value = std::getenv(name.c_str());
+ return value ? std::filesystem::path(value) : std::filesystem::path();
#endif
- cache_directory = ensure_trailing_slash(cache_directory);
- cache_directory += "llama.cpp";
- }
- return ensure_trailing_slash(cache_directory);
}
-std::string fs_get_config_directory() {
- std::string config_directory = "";
- auto ensure_trailing_slash = [](std::string p) {
- if (p.empty() || p.back() != DIRECTORY_SEPARATOR) {
- p += DIRECTORY_SEPARATOR;
- }
- return p;
- };
-#if defined(__linux__) || defined(__FreeBSD__) || defined(_AIX) || \
- defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
- const std::string xdg_config_home = common_get_env("XDG_CONFIG_HOME");
- const std::string home = common_get_env("HOME");
- if (!xdg_config_home.empty()) {
- config_directory = xdg_config_home;
- } else if (!home.empty()) {
- config_directory = home + "/.config/";
- } else {
-#if defined(__linux__)
- /* no $HOME is defined, fallback to getpwuid */
- struct passwd *pw = getpwuid(getuid());
- if ((!pw) || (!pw->pw_dir)) {
- throw std::runtime_error("Failed to find $HOME directory");
- }
-
- config_directory = std::string(pw->pw_dir) + std::string("/.config/");
-#else
- throw std::runtime_error("Failed to find $HOME directory");
-#endif
+#if !defined(_WIN32)
+static std::filesystem::path get_home_directory() {
+ std::filesystem::path home = common_get_path_from_env("HOME");
+ if (!home.empty()) {
+ return home;
}
-#elif defined(_WIN32)
- config_directory = common_get_env("APPDATA");
+ const struct passwd * pw = getpwuid(getuid());
+ if (!pw || !pw->pw_dir || !*pw->pw_dir) {
+ throw std::runtime_error("Failed to find $HOME directory");
+ }
+ return pw->pw_dir;
+}
+#endif
+
+std::filesystem::path fs_get_cache_directory() {
+ std::filesystem::path cache_directory = common_get_path_from_env("LLAMA_CACHE");
+ if (!cache_directory.empty()) {
+ return cache_directory;
+ }
+#if defined(_WIN32)
+ cache_directory = common_get_path_from_env("LOCALAPPDATA");
+ if (cache_directory.empty()) {
+ throw std::runtime_error("Failed to find %LOCALAPPDATA% directory");
+ }
+#elif defined(__APPLE__)
+ cache_directory = get_home_directory() / "Library/Caches";
+#else
+ cache_directory = common_get_path_from_env("XDG_CACHE_HOME");
+ if (cache_directory.empty()) {
+ cache_directory = get_home_directory() / ".cache";
+ }
+#endif
+ return cache_directory / "llama.cpp";
+}
+
+std::filesystem::path fs_get_config_directory() {
+ std::filesystem::path config_directory;
+#if defined(_WIN32)
+ config_directory = common_get_path_from_env("APPDATA");
if (config_directory.empty()) {
throw std::runtime_error("Failed to find %APPDATA% directory");
}
-#elif defined(__EMSCRIPTEN__)
- // caller decides what to do when there is no config directory
- throw std::runtime_error("not implemented on this platform");
#else
-# error Unknown architecture
+ config_directory = common_get_path_from_env("XDG_CONFIG_HOME");
+ if (config_directory.empty()) {
+ config_directory = get_home_directory() / ".config";
+ }
#endif
- config_directory = ensure_trailing_slash(config_directory);
- config_directory += "llama.cpp";
- return ensure_trailing_slash(config_directory);
+ return config_directory / "llama.cpp";
}
-std::string fs_get_cache_file(const std::string & filename) {
+std::filesystem::path fs_get_cache_file(const std::string & filename) {
GGML_ASSERT(filename.find(DIRECTORY_SEPARATOR) == std::string::npos);
- std::string cache_directory = fs_get_cache_directory();
- const bool success = fs_create_directory_with_parents(cache_directory);
- if (!success) {
- throw std::runtime_error("failed to create cache directory: " + cache_directory);
+ const std::filesystem::path cache_directory = fs_get_cache_directory();
+ std::error_code ec;
+ common_create_directories(cache_directory, ec);
+ if (ec) {
+ throw std::runtime_error("failed to create cache directory: " + fs_path_to_utf8(cache_directory));
}
- return cache_directory + filename;
-}
-
-std::vector fs_list(const std::string & path, bool include_directories) {
- std::vector files;
- if (path.empty()) return files;
-
- std::filesystem::path dir(path);
- if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir)) {
- return files;
- }
-
- for (const auto & entry : std::filesystem::directory_iterator(dir)) {
- try {
- // Only include regular files (skip directories)
- const auto & p = entry.path();
- if (std::filesystem::is_regular_file(p)) {
- common_file_info info;
- info.path = p.string();
- info.name = p.filename().string();
- info.is_dir = false;
- try {
- info.size = static_cast(std::filesystem::file_size(p));
- } catch (const std::filesystem::filesystem_error &) {
- info.size = 0;
- }
- files.push_back(std::move(info));
- } else if (include_directories && std::filesystem::is_directory(p)) {
- common_file_info info;
- info.path = p.string();
- info.name = p.filename().string();
- info.size = 0; // Directories have no size
- info.is_dir = true;
- files.push_back(std::move(info));
- }
- } catch (const std::filesystem::filesystem_error &) {
- // skip entries we cannot inspect
- continue;
- }
- }
-
- return files;
-}
-
-std::ifstream fs_open_ifstream(const std::string & fname, std::ios_base::openmode mode) {
-#ifdef _WIN32
- int wlen = MultiByteToWideChar(CP_UTF8, 0, fname.c_str(), -1, NULL, 0);
- if (!wlen) { return std::ifstream(); }
- std::vector wfname(wlen);
- (void)MultiByteToWideChar(CP_UTF8, 0, fname.c_str(), -1, wfname.data(), wlen);
- return std::ifstream(wfname.data(), mode);
-#else
- return std::ifstream(fname, mode);
-#endif
+ return cache_directory / std::filesystem::u8path(filename);
}
//
// TTY utils
//
+bool common_is_tty(FILE * file) {
+#if defined(_WIN32)
+ return _isatty(_fileno(file));
+#else
+ return isatty(fileno(file));
+#endif
+}
+
bool tty_can_use_colors() {
// Check NO_COLOR environment variable (https://no-color.org/)
if (const char * no_color = std::getenv("NO_COLOR")) {
@@ -1199,10 +1063,21 @@ bool tty_can_use_colors() {
// Check if stdout and stderr are connected to a terminal
// We check both because log messages can go to either
- bool stdout_is_tty = isatty(fileno(stdout));
- bool stderr_is_tty = isatty(fileno(stderr));
+ return common_is_tty(stdout) || common_is_tty(stderr);
+}
- return stdout_is_tty || stderr_is_tty;
+bool tty_enable_ansi() {
+#if defined(_WIN32)
+ // a Windows console renders ANSI sequences only in virtual terminal mode, pipes and files take them as is
+ for (DWORD id : { STD_OUTPUT_HANDLE, STD_ERROR_HANDLE }) {
+ HANDLE h = GetStdHandle(id);
+ DWORD mode = 0;
+ if (GetConsoleMode(h, &mode) && !SetConsoleMode(h, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING)) {
+ return false;
+ }
+ }
+#endif
+ return true;
}
//
@@ -1287,6 +1162,71 @@ struct common_init_result::impl {
std::vector samplers_seq_config;
};
+static const std::map COMMON_DECISION_TYPE_NAMES = {
+ { COMMON_DECISION_TYPE_OPENJEV, "openjev" },
+ { COMMON_DECISION_TYPE_LEV, "lev" },
+ { COMMON_DECISION_TYPE_KEV, "kev" },
+ { COMMON_DECISION_TYPE_NIMBLE, "nimble" },
+ { COMMON_DECISION_TYPE_LAYA, "laya" },
+ { COMMON_DECISION_TYPE_CLEF, "clef" },
+};
+
+static common_decision_type common_decision_type_from_string(const std::string & str) {
+ for (const auto & pair : COMMON_DECISION_TYPE_NAMES) {
+ if (pair.second == str) {
+ return pair.first;
+ }
+ }
+ return COMMON_DECISION_TYPE_UNKNOWN;
+}
+
+common_decision_type common_get_decision_type(const struct llama_model * model) {
+ char buf[64];
+ if (llama_model_meta_val_str(model, "general.architecture", buf, sizeof(buf)) < 0) {
+ return COMMON_DECISION_TYPE_NONE;
+ }
+ const std::string key = std::string(buf) + ".decision.type";
+ if (llama_model_meta_val_str(model, key.c_str(), buf, sizeof(buf)) < 0) {
+ return COMMON_DECISION_TYPE_NONE;
+ }
+ return common_decision_type_from_string(buf);
+}
+
+common_decision_type common_get_decision_type(const std::string & fname) {
+ struct gguf_init_params gguf_params = {
+ /* .no_alloc = */ true,
+ /* .ctx = */ nullptr,
+ };
+
+ gguf_context_ptr gguf_ctx(gguf_init_from_file(fname.c_str(), gguf_params));
+ if (!gguf_ctx) {
+ return COMMON_DECISION_TYPE_UNKNOWN; // missing or unreadable file
+ }
+
+ std::string arch;
+ const int64_t arch_id = gguf_find_key(gguf_ctx.get(), "general.architecture");
+ if (arch_id < 0) {
+ return COMMON_DECISION_TYPE_UNKNOWN; // no architecture in the metadata
+ }
+ if (gguf_get_kv_type(gguf_ctx.get(), arch_id) != GGUF_TYPE_STRING) {
+ return COMMON_DECISION_TYPE_UNKNOWN; // malformed metadata
+ }
+ arch = gguf_get_val_str(gguf_ctx.get(), arch_id);
+ if (arch.empty()) {
+ return COMMON_DECISION_TYPE_UNKNOWN;
+ }
+
+ const std::string key = arch + ".decision.type";
+ const int64_t type_id = gguf_find_key(gguf_ctx.get(), key.c_str());
+ if (type_id < 0) {
+ return COMMON_DECISION_TYPE_NONE;
+ }
+ if (gguf_get_kv_type(gguf_ctx.get(), type_id) != GGUF_TYPE_STRING) {
+ return COMMON_DECISION_TYPE_UNKNOWN; // malformed metadata
+ }
+ return common_decision_type_from_string(gguf_get_val_str(gguf_ctx.get(), type_id));
+}
+
common_init_result::common_init_result(common_params & params, bool model_only) :
pimpl(new impl{}) {
auto mparams = common_model_params_to_llama(params);
@@ -1359,6 +1299,29 @@ common_init_result::common_init_result(common_params & params, bool model_only)
const llama_vocab * vocab = llama_model_get_vocab(model);
+ // these decision models return a score for each token via the embeddings output
+ // TODO: maybe improve this in the future
+ const auto decision_type = common_get_decision_type(model);
+ if (decision_type == COMMON_DECISION_TYPE_LAYA || decision_type == COMMON_DECISION_TYPE_KEV || decision_type == COMMON_DECISION_TYPE_CLEF) {
+ params.embedding = true;
+ params.pooling_type = LLAMA_POOLING_TYPE_NONE;
+
+ cparams.embeddings = true;
+ cparams.pooling_type = LLAMA_POOLING_TYPE_NONE;
+ cparams.n_outputs_max = cparams.n_batch;
+ cparams.n_outputs_max_per_seq = 1;
+
+ LOG_INF("%s", "decision model reads the embeddings output, enabling embedding mode\n");
+ }
+
+ // embeddings need the whole batch in one ubatch, so n_batch must not be larger than n_ubatch
+ // (server.cpp does this check for --embedding, but before the model is loaded)
+ if (cparams.embeddings && cparams.n_batch > cparams.n_ubatch) {
+ LOG_WRN("embeddings enabled: setting n_batch = n_ubatch = %u\n", cparams.n_ubatch);
+ cparams.n_batch = cparams.n_ubatch;
+ params.n_batch = params.n_ubatch;
+ }
+
// load and optionally apply lora adapters
for (auto & la : params.lora_adapters) {
llama_adapter_lora_ptr lora;
@@ -1547,7 +1510,8 @@ common_init_result_ptr common_init_from_params(common_params & params, bool mode
}
if (llama_model_has_encoder(model)) {
- llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ common_batch batch = common_batch_get_one(lctx, tmp);
+ llama_process(lctx, LLAMA_PROCESS_TYPE_ENCODE, batch.get());
llama_token decoder_start_token_id = llama_model_decoder_start_token(model);
if (decoder_start_token_id == LLAMA_TOKEN_NULL) {
decoder_start_token_id = bos;
@@ -1556,7 +1520,9 @@ common_init_result_ptr common_init_from_params(common_params & params, bool mode
tmp.push_back(decoder_start_token_id);
}
if (llama_model_has_decoder(model)) {
- llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
+ tmp.resize(std::min(tmp.size(), (size_t) params.n_batch));
+ common_batch batch = common_batch_get_one(lctx, tmp);
+ llama_process(lctx, LLAMA_PROCESS_TYPE_DECODE, batch.get());
}
llama_memory_clear(llama_get_memory(lctx), true);
llama_synchronize(lctx);
@@ -1620,9 +1586,13 @@ common_context_seq_rm_type common_context_can_seq_rm(llama_context * ctx) {
tmp.push_back(0);
tmp.push_back(0);
- int ret = llama_decode(ctx, llama_batch_get_one(tmp.data(), tmp.size()));
+ int ret;
+ {
+ common_batch batch = common_batch_get_one(ctx, tmp);
+ ret = llama_process(ctx, LLAMA_PROCESS_TYPE_DECODE, batch.get());
+ }
if (ret != 0) {
- COM_ERR("llama_decode() failed: %d\n", ret);
+ COM_ERR("llama_process() failed: %d\n", ret);
res = COMMON_CONTEXT_SEQ_RM_TYPE_NO;
goto done;
}
@@ -1730,7 +1700,7 @@ struct llama_model_params common_model_params_to_llama(common_params & params) {
mparams.progress_callback = params.load_progress_callback;
mparams.progress_callback_user_data = params.load_progress_callback_user_data;
mparams.no_alloc = params.no_alloc;
- mparams.load_mtp = std::find(params.speculative.types.begin(), params.speculative.types.end(), COMMON_SPECULATIVE_TYPE_DRAFT_MTP) != params.speculative.types.end();
+ mparams.load_mtp = params.load_mtp || std::find(params.speculative.types.begin(), params.speculative.types.end(), COMMON_SPECULATIVE_TYPE_DRAFT_MTP) != params.speculative.types.end();
return mparams;
}
@@ -1848,33 +1818,6 @@ void common_threadpools::init(llama_context * ctx, const common_params & params)
llama_attach_threadpool(ctx, threadpool, threadpool_batch);
}
-//
-// Batch utils
-//
-
-void common_batch_clear(struct llama_batch & batch) {
- batch.n_tokens = 0;
-}
-
-void common_batch_add(
- struct llama_batch & batch,
- llama_token id,
- llama_pos pos,
- const std::vector & seq_ids,
- bool logits) {
- GGML_ASSERT(batch.seq_id[batch.n_tokens] && "llama_batch size exceeded");
-
- batch.token [batch.n_tokens] = id;
- batch.pos [batch.n_tokens] = pos;
- batch.n_seq_id[batch.n_tokens] = seq_ids.size();
- for (size_t i = 0; i < seq_ids.size(); ++i) {
- batch.seq_id[batch.n_tokens][i] = seq_ids[i];
- }
- batch.logits [batch.n_tokens] = logits;
-
- batch.n_tokens++;
-}
-
//
// Vocab utils
//
@@ -2211,34 +2154,137 @@ float lr_opt::get_lr(float epoch) const {
}
bool common_replay_last_token(struct llama_context * ctx, llama_token last_token, int32_t pos) {
- llama_batch batch = llama_batch_get_one(&last_token, 1);
- batch.pos = &pos;
- if (llama_decode(ctx, batch)) {
+ common_batch batch(ctx);
+ batch.add(last_token, pos, 0, true);
+
+ if (llama_process(ctx, LLAMA_PROCESS_TYPE_DECODE, batch.get())) {
LOG_ERR("%s: failed to replay last token\n", __func__);
return false;
}
return true;
}
-llama_batch_ext_ptr common_batch_ext_get_one(llama_context * ctx, const llama_tokens & tokens) {
- llama_batch_ext_ptr batch(llama_batch_ext_init(ctx));
+common_batch::common_batch(llama_context * ctx) : batch(llama_batch_ext_init(ctx)) {
+ const auto rope_type = llama_model_rope_type(llama_get_model(ctx));
+ n_pos = rope_type == LLAMA_ROPE_TYPE_MROPE || rope_type == LLAMA_ROPE_TYPE_IMROPE ? GGML_MROPE_SECTIONS : 1;
+}
+
+void common_batch::clear() {
+ tokens.clear();
+}
+
+int32_t common_batch::add(llama_token id, llama_pos pos, llama_seq_id seq_id, bool output) {
+ tokens.push_back({ id, { pos, 0, 0, 0 }, seq_id, output, { nullptr, 0, 0 }, {} });
+ return size() - 1;
+}
+
+int32_t common_batch::add(llama_token id, llama_pos pos, const std::vector & seq_ids, bool output) {
+ GGML_ASSERT(!seq_ids.empty());
+
+ const int32_t idx = add(id, pos, seq_ids[0], output);
+ for (size_t s = 1; s < seq_ids.size(); ++s) {
+ add_seq(idx, seq_ids[s]);
+ }
+ return idx;
+}
+
+bool common_batch::add_seq(int32_t idx, llama_seq_id seq_id) {
+ if (idx < 0 || idx >= size()) {
+ return false;
+ }
+ tokens[idx].seq_ids_extra.push_back(seq_id);
+ return true;
+}
+
+bool common_batch::set_output(int32_t idx, bool value) {
+ if (idx < 0 || idx >= size()) {
+ return false;
+ }
+ tokens[idx].output = value;
+ return true;
+}
+
+bool common_batch::set_embd(int32_t idx, llama_embd embd) {
+ if (idx < 0 || idx >= size() || tokens[idx].embd.data != nullptr) {
+ return false;
+ }
+ tokens[idx].embd = embd;
+ return true;
+}
+
+int32_t common_batch::add_embd(llama_embd embd, const llama_pos * pos, llama_seq_id seq_id, bool output) {
+ token t = { LLAMA_TOKEN_NULL, { 0, 0, 0, 0 }, seq_id, output, embd, {} };
+ for (int32_t j = 0; j < n_pos; ++j) {
+ t.pos[j] = pos[j];
+ }
+ tokens.push_back(t);
+ return size() - 1;
+}
+
+llama_batch_ext * common_batch::get_sub_batch(int32_t off, int32_t n) {
+ GGML_ASSERT(batch && "common_batch was not initialized with a context");
+ GGML_ASSERT(off >= 0 && n >= 0 && off + n <= size());
+
+ llama_batch_ext * res = batch.get();
+ llama_batch_ext_clear(res);
+
+ for (int32_t i = off; i < off + n; ++i) {
+ const token & t = tokens[i];
+
+ int32_t idx;
+ if (t.id != LLAMA_TOKEN_NULL) {
+ idx = llama_batch_ext_add_token(res, t.seq_id, t.id);
+ if (idx < 0) {
+ GGML_ABORT("%s: failed to add token %d at index %d (error %d, n = %d)\n", __func__, t.id, i, idx, n);
+ }
+ llama_batch_ext_set_pos(res, idx, t.pos.data());
+ if (t.embd.data && !llama_batch_ext_set_embd_token(res, idx, t.embd)) {
+ GGML_ABORT("%s: failed to set the embedding of token %d at index %d\n", __func__, t.id, i);
+ }
+ } else {
+ idx = llama_batch_ext_add_embd(res, t.seq_id, t.embd);
+ if (idx < 0) {
+ GGML_ABORT("%s: failed to add embedding at index %d (error %d, n = %d)\n", __func__, i, idx, n);
+ }
+ llama_batch_ext_set_pos(res, idx, t.pos.data());
+ }
+ GGML_ASSERT(idx == i - off);
+
+ for (const llama_seq_id seq_id : t.seq_ids_extra) {
+ if (!llama_batch_ext_add_seq(res, idx, seq_id)) {
+ GGML_ABORT("%s: failed to add seq %d to the entry at index %d\n", __func__, seq_id, i);
+ }
+ }
+ if (t.output) {
+ llama_batch_ext_set_output_logits(res, idx, true);
+ }
+ if (t.decision_order != 0) {
+ llama_batch_ext_set_decision_order(res, idx, (llama_decision_order) t.decision_order);
+ }
+ }
+
+ return res;
+}
+
+common_batch common_batch_get_one(llama_context * ctx, const llama_token * tokens, int32_t n_tokens) {
+ common_batch batch(ctx);
auto mem = llama_get_memory(ctx);
- llama_pos pos = mem ? llama_memory_seq_pos_max(mem, 0) + 1 : 0;
+ llama_pos pos = llama_memory_seq_pos_max(mem, 0) + 1; // -1 + 1 == 0 when the memory is empty
- for (size_t i = 0; i < tokens.size(); ++i) {
- const int32_t idx = llama_batch_ext_add_token(batch.get(), 0, tokens[i]);
- llama_batch_ext_set_pos(batch.get(), idx, &pos);
+ for (int32_t i = 0; i < n_tokens; ++i) {
+ const bool output = i == n_tokens - 1;
+ batch.add(tokens[i], pos, 0, output);
pos++;
}
- if (!tokens.empty()) {
- llama_batch_ext_set_output_logits(batch.get(), (int32_t) tokens.size() - 1, true);
- }
-
return batch;
}
+common_batch common_batch_get_one(llama_context * ctx, const llama_tokens & tokens) {
+ return common_batch_get_one(ctx, tokens.data(), (int32_t) tokens.size());
+}
+
bool common_prompt_batch_decode(
struct llama_context * ctx,
const llama_tokens & all_tokens,
@@ -2263,7 +2309,7 @@ bool common_prompt_batch_decode(
// memory, so we can't just remove the last token from the memory and replay the last token which
// is the reason for this logic.
llama_tokens prefix_tokens(all_tokens.begin() + offset, all_tokens.begin() + offset + n_tokens_before_last);
- llama_batch_ext_ptr batch_prefix = common_batch_ext_get_one(ctx, prefix_tokens);
+ common_batch batch_prefix = common_batch_get_one(ctx, prefix_tokens);
if (llama_process(ctx, LLAMA_PROCESS_TYPE_DECODE, batch_prefix.get())) {
COM_ERR("%s", "failed to eval\n");
return false;
@@ -2273,10 +2319,8 @@ bool common_prompt_batch_decode(
llama_state_save_file(ctx, state_path.data(), all_tokens.data(), all_tokens.size());
COM_INF("saved session before last token to %s, n_new = %zu\n", state_path.data(), all_tokens.size());
- llama_token last_token = all_tokens.back();
- llama_batch_ext_ptr batch_last = common_batch_ext_get_one(ctx, { last_token });
- llama_pos pos = n_past;
- llama_batch_ext_set_pos(batch_last.get(), 0, &pos);
+ common_batch batch_last(ctx);
+ batch_last.add(all_tokens.back(), n_past, 0, true);
if (llama_process(ctx, LLAMA_PROCESS_TYPE_DECODE, batch_last.get())) {
COM_ERR("%s", "failed to eval last token\n");
@@ -2285,7 +2329,7 @@ bool common_prompt_batch_decode(
n_past++;
} else {
llama_tokens new_tokens(all_tokens.begin() + offset, all_tokens.begin() + offset + n_new);
- llama_batch_ext_ptr batch = common_batch_ext_get_one(ctx, new_tokens);
+ common_batch batch = common_batch_get_one(ctx, new_tokens);
if (llama_process(ctx, LLAMA_PROCESS_TYPE_DECODE, batch.get())) {
COM_ERR("%s", "failed to eval\n");
return false;
diff --git a/common/common.h b/common/common.h
index 20274f8cf..889b789d1 100644
--- a/common/common.h
+++ b/common/common.h
@@ -8,6 +8,7 @@
#include "ggml.h"
#include "llama.h"
+#include
#include
#include
#include
@@ -16,7 +17,9 @@
#include
#include