Skip to content

Commit 67559e5

Browse files
authored
Upstream sync to b8871 (64 commits)
Upstream sync to b8871 (64 commits)
2 parents 9e3fb40 + 7f320bb commit 67559e5

261 files changed

Lines changed: 11940 additions & 8216 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devops/nix/package.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
spirv-headers,
2020
openssl,
2121
shaderc,
22+
spirv-headers,
2223
useBlas ?
2324
builtins.all (x: !x) [
2425
useCuda
@@ -147,6 +148,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
147148
ninja
148149
pkg-config
149150
git
151+
spirv-headers
150152
]
151153
++ optionals useCuda [
152154
cudaPackages.cuda_nvcc

.github/workflows/build-android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
distribution: zulu
5252

5353
- name: Setup Android SDK
54-
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
54+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
5555
with:
5656
log-accepted-android-sdk-licenses: false
5757

.github/workflows/build-cross.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ jobs:
246246
apt-get install -y --no-install-recommends \
247247
build-essential \
248248
glslc \
249+
spirv-headers \
249250
gcc-14-loongarch64-linux-gnu \
250251
g++-14-loongarch64-linux-gnu \
251252
libvulkan-dev:loong64

.github/workflows/build-riscv.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,10 @@ jobs:
4747
steps:
4848
- name: Install dependencies
4949
run: |
50-
sudo apt-get update
51-
52-
# Install necessary packages
53-
sudo apt-get install -y libatomic1 libtsan2 gcc-14 g++-14 cmake build-essential wget git-lfs
54-
5550
# Set gcc-14 and g++-14 as the default compilers
5651
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
5752
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
5853
59-
if ! which rustc; then
60-
# Install Rust stable version
61-
sudo apt-get install -y rustup
62-
rustup install stable
63-
rustup default stable
64-
fi
65-
6654
git lfs install
6755
6856
- name: GCC version check
@@ -74,12 +62,12 @@ jobs:
7462
id: checkout
7563
uses: actions/checkout@v6
7664

77-
# FIXME: Enable when ggml-org/ccache-action works on riscv64
78-
# - name: ccache
79-
# uses: ggml-org/ccache-action@v1.2.21
80-
# with:
81-
# key: ubuntu-riscv64-native-sanitizer-${{ matrix.sanytizer }}-${{ matrix.build_type }}
82-
# save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
65+
- name: ccache
66+
uses: ggml-org/ccache-action@afde29e5b5422e5da23cb1f639e8baecadeadfc3 # https://github.com/ggml-org/ccache-action/pull/1
67+
with:
68+
key: ubuntu-riscv64-native-sanitizer-${{ matrix.sanitizer }}-${{ matrix.build_type }}
69+
evict-old-files: 1d
70+
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
8371

8472
- name: Build
8573
id: cmake_build

.github/workflows/build-self-hosted.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,36 @@ jobs:
9797
vulkaninfo --summary
9898
GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
9999
100+
# TODO: investigate slight precision issues in some operations for test-backend-ops on the WebGPU backend.
101+
#ggml-ci-nvidia-webgpu:
102+
# runs-on: [self-hosted, Linux, NVIDIA]
103+
104+
# steps:
105+
# - name: Clone
106+
# id: checkout
107+
# uses: actions/checkout@v6
108+
109+
# - name: Dawn Dependency
110+
# id: dawn-depends
111+
# run: |
112+
# DAWN_VERSION="v20260317.182325"
113+
# DAWN_OWNER="google"
114+
# DAWN_REPO="dawn"
115+
# DAWN_ASSET_NAME="Dawn-18eb229ef5f707c1464cc581252e7603c73a3ef0-ubuntu-latest-Release"
116+
# echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
117+
# curl -L -o artifact.tar.gz \
118+
# "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
119+
# mkdir dawn
120+
# tar -xvf artifact.tar.gz -C dawn --strip-components=1
121+
122+
# - name: Test
123+
# id: ggml-ci
124+
# run: |
125+
# GG_BUILD_WEBGPU=1 \
126+
# GG_BUILD_WEBGPU_DAWN_PREFIX="$GITHUB_WORKSPACE/dawn" \
127+
# GG_BUILD_WEBGPU_DAWN_DIR="$GITHUB_WORKSPACE/dawn/lib64/cmake/Dawn" \
128+
# bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
129+
100130
# TODO: provision AMX-compatible machine
101131
#ggml-ci-cpu-amx:
102132
# runs-on: [self-hosted, Linux, CPU, AMX]

.github/workflows/build.yml

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,56 @@ jobs:
267267
wget https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K-be.gguf
268268
./bin/llama-completion -m stories260K-be.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
269269
270+
android-arm64:
271+
runs-on: ubuntu-latest
272+
273+
env:
274+
NDK_VERSION: "29.0.14206865"
275+
276+
steps:
277+
- name: Clone
278+
id: checkout
279+
uses: actions/checkout@v6
280+
281+
- name: ccache
282+
uses: ggml-org/ccache-action@v1.2.21
283+
with:
284+
key: android-arm64
285+
evict-old-files: 1d
286+
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
287+
288+
- name: Set up JDK
289+
uses: actions/setup-java@v5
290+
with:
291+
java-version: 17
292+
distribution: temurin
293+
294+
- name: Setup Android SDK
295+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
296+
with:
297+
log-accepted-android-sdk-licenses: false
298+
299+
- name: Install NDK
300+
run: |
301+
sdkmanager "ndk;${{ env.NDK_VERSION }}"
302+
echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV
303+
304+
- name: Build
305+
id: cmake_build
306+
run: |
307+
cmake -B build \
308+
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
309+
-DANDROID_ABI=arm64-v8a \
310+
-DANDROID_PLATFORM=android-28 \
311+
-DLLAMA_FATAL_WARNINGS=ON \
312+
-DGGML_BACKEND_DL=ON \
313+
-DGGML_NATIVE=OFF \
314+
-DGGML_CPU_ALL_VARIANTS=ON \
315+
-DGGML_OPENMP=OFF \
316+
-DLLAMA_BUILD_BORINGSSL=ON \
317+
-DGGML_RPC=ON
318+
time cmake --build build --config Release -j $(nproc)
319+
270320
ubuntu-latest-rpc:
271321
runs-on: ubuntu-latest
272322

@@ -1001,22 +1051,14 @@ jobs:
10011051
steps:
10021052
- name: Install dependencies
10031053
run: |
1004-
sudo apt-get update
1005-
10061054
# Install necessary packages
1007-
sudo apt-get install -y libatomic1 libtsan2 gcc-14 g++-14 cmake build-essential libssl-dev wget git-lfs
1055+
sudo apt-get update
1056+
sudo apt-get install -y libssl-dev
10081057
10091058
# Set gcc-14 and g++-14 as the default compilers
10101059
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
10111060
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
10121061
1013-
if ! which rustc; then
1014-
# Install Rust stable version
1015-
sudo apt-get install -y rustup
1016-
rustup install stable
1017-
rustup default stable
1018-
fi
1019-
10201062
git lfs install
10211063
10221064
- name: Check environment
@@ -1032,13 +1074,12 @@ jobs:
10321074
id: checkout
10331075
uses: actions/checkout@v6
10341076

1035-
# FIXME: Enable when ggml-org/ccache-action works on riscv64
1036-
# - name: ccache
1037-
# uses: ggml-org/ccache-action@v1.2.21
1038-
# with:
1039-
# key: ubuntu-cpu-riscv64-native
1040-
# evict-old-files: 1d
1041-
# save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
1077+
- name: ccache
1078+
uses: ggml-org/ccache-action@afde29e5b5422e5da23cb1f639e8baecadeadfc3 # https://github.com/ggml-org/ccache-action/pull/1
1079+
with:
1080+
key: ubuntu-cpu-riscv64-native
1081+
evict-old-files: 1d
1082+
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
10421083

10431084
- name: Build
10441085
id: cmake_build

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,75 @@ jobs:
236236
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
237237
name: llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
238238

239+
android-arm64:
240+
runs-on: ubuntu-latest
241+
242+
env:
243+
NDK_VERSION: "29.0.14206865"
244+
245+
steps:
246+
- name: Clone
247+
id: checkout
248+
uses: actions/checkout@v6
249+
with:
250+
fetch-depth: 0
251+
252+
- name: ccache
253+
uses: ggml-org/ccache-action@v1.2.21
254+
with:
255+
key: android-arm64
256+
evict-old-files: 1d
257+
258+
- name: Set up JDK
259+
uses: actions/setup-java@v5
260+
with:
261+
java-version: 17
262+
distribution: temurin
263+
264+
- name: Setup Android SDK
265+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
266+
with:
267+
log-accepted-android-sdk-licenses: false
268+
269+
- name: Install NDK
270+
run: |
271+
sdkmanager "ndk;${{ env.NDK_VERSION }}"
272+
echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV
273+
274+
- name: Build
275+
id: cmake_build
276+
run: |
277+
cmake -B build \
278+
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
279+
-DANDROID_ABI=arm64-v8a \
280+
-DANDROID_PLATFORM=android-28 \
281+
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
282+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
283+
-DGGML_BACKEND_DL=ON \
284+
-DGGML_NATIVE=OFF \
285+
-DGGML_CPU_ALL_VARIANTS=ON \
286+
-DLLAMA_FATAL_WARNINGS=ON \
287+
-DGGML_OPENMP=OFF \
288+
-DLLAMA_BUILD_BORINGSSL=ON \
289+
${{ env.CMAKE_ARGS }}
290+
cmake --build build --config Release -j $(nproc)
291+
292+
- name: Determine tag name
293+
id: tag
294+
uses: ./.github/actions/get-tag-name
295+
296+
- name: Pack artifacts
297+
id: pack_artifacts
298+
run: |
299+
cp LICENSE ./build/bin/
300+
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
301+
302+
- name: Upload artifacts
303+
uses: actions/upload-artifact@v6
304+
with:
305+
path: llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz
306+
name: llama-bin-android-arm64.tar.gz
307+
239308
ubuntu-24-openvino:
240309
runs-on: ubuntu-24.04
241310

@@ -618,6 +687,11 @@ jobs:
618687
with:
619688
fetch-depth: 0
620689

690+
- name: Free up disk space
691+
uses: ggml-org/free-disk-space@v1.3.1
692+
with:
693+
tool-cache: true
694+
621695
- name: ccache
622696
uses: ggml-org/ccache-action@v1.2.21
623697
with:
@@ -971,6 +1045,7 @@ jobs:
9711045
- ubuntu-cpu
9721046
- ubuntu-vulkan
9731047
- ubuntu-24-openvino
1048+
- android-arm64
9741049
- macOS-cpu
9751050
- ios-xcode-build
9761051
- openEuler-cann
@@ -1059,6 +1134,9 @@ jobs:
10591134
- [Ubuntu x64 (ROCm 7.2)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.2-x64.tar.gz)
10601135
- [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)
10611136
1137+
**Android:**
1138+
- [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)
1139+
10621140
**Windows:**
10631141
- [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)
10641142
- [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)

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ foreach(FILE_PATH ${EXTRA_LICENSES})
225225
endforeach()
226226

227227
if (LLAMA_BUILD_COMMON)
228-
license_generate(common)
228+
license_generate(llama-common)
229229
endif()
230230

231231
#
@@ -249,6 +249,10 @@ set_target_properties(llama
249249

250250
install(TARGETS llama LIBRARY PUBLIC_HEADER)
251251

252+
if (LLAMA_BUILD_COMMON)
253+
install(TARGETS llama-common LIBRARY)
254+
endif()
255+
252256
configure_package_config_file(
253257
${CMAKE_CURRENT_SOURCE_DIR}/cmake/llama-config.cmake.in
254258
${CMAKE_CURRENT_BINARY_DIR}/llama-config.cmake

CODEOWNERS

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# collaborators can optionally add themselves here to indicate their availability for reviewing related PRs
2-
# multiplie collaborators per item can be specified
2+
# multiple collaborators per item can be specified
3+
#
4+
# ggml-org/ci : CISC, danbev, ggerganov, netrunnereve, ngxson, taronaeo
5+
# ggml-org/ggml-cann : hipudding
6+
# ggml-org/ggml-cuda : JohannesGaessler, am17an, IMbackK, ORippler
7+
# ggml-org/ggml-hexagon : lhez, max-krasnyansky
8+
# ggml-org/ggml-metal : ggerganov
9+
# ggml-org/ggml-opencl : lhez, max-krasnyansky
10+
# ggml-org/ggml-rpc : rgerganov
11+
# ggml-org/ggml-sycl : arthw
12+
# ggml-org/ggml-vulkan : 0cc4m, jeffbolznv
13+
# ggml-org/ggml-webgpu : reeselevine
14+
# ggml-org/ggml-zdnn : taronaeo
15+
# ggml-org/llama-common : ggerganov, aldehir, angt, danbev, ngxson, pwilkin
16+
# ggml-org/llama-mtmd : ngxson
17+
# ggml-org/llama-server : ggerganov, ngxson, allozaur, angt, ServeurpersoCom
18+
# ggml-org/llama-webui : allozaur
319

420
/.devops/*.Dockerfile @ngxson
521
/.github/actions/ @ggml-org/ci
622
/.github/workflows/ @ggml-org/ci
723
/ci/ @ggerganov
824
/cmake/ @ggerganov
925
/common/ @ggml-org/llama-common
26+
/common/fit.* @JohannesGaessler
1027
/common/jinja/ @CISC
1128
/common/ngram-map.* @srogmann
1229
/convert_*.py @CISC

0 commit comments

Comments
 (0)