Skip to content

Commit 491c4d7

Browse files
authored
ci : refactor (ggml-org#23789)
* ci : separate CUDA windows workflow + fix names * ci : rename workflow * ci : prefix cache names with workflow name * ci : rename build.yml -> build-cpu.yml * ci : cache keys * ci : fix windows cuda/hip concurrency of release workflow * ci : fix apple cache names * ci : add TODOs * cont : keep just the last cache * ci : update release concurrency to queue * ci : move the release trigger to ubuntu-slim * ci : hip add TODO * cont : improve words Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
1 parent 939a7dd commit 491c4d7

18 files changed

Lines changed: 342 additions & 303 deletions

.github/workflows/build-android.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232
LLAMA_ARG_LOG_TIMESTAMPS: 1
3333

3434
jobs:
35-
android:
35+
default:
3636
runs-on: ubuntu-latest
3737

3838
steps:
@@ -58,7 +58,7 @@ jobs:
5858
cd examples/llama.android
5959
./gradlew build --no-daemon
6060
61-
android-ndk:
61+
ndk:
6262
runs-on: ubuntu-latest
6363
container:
6464
image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.3'
@@ -92,7 +92,7 @@ jobs:
9292
name: llama-cpp-android-arm64-cpu
9393
path: pkg-adb/llama.cpp
9494

95-
android-arm64:
95+
arm64:
9696
runs-on: ubuntu-latest
9797

9898
env:
@@ -103,12 +103,18 @@ jobs:
103103
id: checkout
104104
uses: actions/checkout@v6
105105

106-
- name: ccache
107-
uses: ggml-org/ccache-action@v1.2.21
108-
with:
109-
key: android-arm64
110-
evict-old-files: 1d
111-
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
106+
# note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789)
107+
# for some reason, the ccache does not improve the build time in this case
108+
# example:
109+
# cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831
110+
# cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394
111+
#
112+
#- name: ccache
113+
# uses: ggml-org/ccache-action@v1.2.21
114+
# with:
115+
# key: android-ubuntu-arm64
116+
# evict-old-files: 1d
117+
# save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
112118

113119
- name: Set up JDK
114120
uses: actions/setup-java@v5

.github/workflows/build-apple.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: ccache
4949
uses: ggml-org/ccache-action@v1.2.21
5050
with:
51-
key: macos-latest-arm64
51+
key: apple-arm64
5252
evict-old-files: 1d
5353
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
5454

@@ -84,7 +84,7 @@ jobs:
8484
- name: ccache
8585
uses: ggml-org/ccache-action@v1.2.21
8686
with:
87-
key: macos-latest-x64
87+
key: apple-x64
8888
evict-old-files: 1d
8989
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
9090

@@ -117,10 +117,11 @@ jobs:
117117
id: checkout
118118
uses: actions/checkout@v6
119119

120+
# TODO: this likely does not do anything - if yes, remove it
120121
- name: ccache
121122
uses: ggml-org/ccache-action@v1.2.21
122123
with:
123-
key: macos-latest-ios
124+
key: apple-ios
124125
evict-old-files: 1d
125126
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
126127

@@ -197,10 +198,11 @@ jobs:
197198
id: checkout
198199
uses: actions/checkout@v6
199200

201+
# TODO: this likely does not do anything - if yes, remove it
200202
- name: ccache
201203
uses: ggml-org/ccache-action@v1.2.21
202204
with:
203-
key: macos-latest-tvos
205+
key: apple-tvos
204206
evict-old-files: 1d
205207
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
206208

@@ -230,6 +232,14 @@ jobs:
230232
id: checkout
231233
uses: actions/checkout@v6
232234

235+
# TODO: this likely does not do anything - if yes, remove it
236+
- name: ccache
237+
uses: ggml-org/ccache-action@v1.2.21
238+
with:
239+
key: apple-visionos
240+
evict-old-files: 1d
241+
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
242+
233243
- name: Build
234244
id: cmake_build
235245
run: |
@@ -261,10 +271,11 @@ jobs:
261271
id: checkout
262272
uses: actions/checkout@v6
263273

274+
# TODO: this likely does not do anything - if yes, remove it
264275
- name: ccache
265276
uses: ggml-org/ccache-action@v1.2.21
266277
with:
267-
key: macos-latest-swift
278+
key: apple-swift
268279
evict-old-files: 1d
269280
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
270281

Lines changed: 7 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: CI
1+
name: CI (cpu)
22

33
on:
44
workflow_dispatch: # allows manual triggering
55
push:
66
branches:
77
- master
88
paths: [
9-
'.github/workflows/build.yml',
9+
'.github/workflows/build-cpu.yml',
1010
'.github/workflows/build-cmake-pkg.yml',
1111
'**/CMakeLists.txt',
1212
'**/.cmake',
@@ -27,7 +27,7 @@ on:
2727
pull_request:
2828
types: [opened, synchronize, reopened]
2929
paths: [
30-
'.github/workflows/build.yml',
30+
'.github/workflows/build-cpu.yml',
3131
'.github/workflows/build-cmake-pkg.yml',
3232
'**/CMakeLists.txt',
3333
'**/.cmake',
@@ -60,7 +60,7 @@ jobs:
6060
build-cmake-pkg:
6161
uses: ./.github/workflows/build-cmake-pkg.yml
6262

63-
ubuntu-cpu:
63+
ubuntu:
6464
strategy:
6565
matrix:
6666
include:
@@ -79,7 +79,7 @@ jobs:
7979
- name: ccache
8080
uses: ggml-org/ccache-action@v1.2.21
8181
with:
82-
key: ubuntu-cpu-${{ matrix.build }}
82+
key: cpu-${{ matrix.os }}
8383
evict-old-files: 1d
8484
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
8585

@@ -131,46 +131,7 @@ jobs:
131131
./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
132132
./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
133133
134-
ubuntu-24-vulkan:
135-
strategy:
136-
matrix:
137-
include:
138-
- build: 'x64'
139-
os: ubuntu-24.04
140-
- build: 'arm64'
141-
os: ubuntu-24.04-arm
142-
143-
runs-on: ${{ matrix.os }}
144-
145-
steps:
146-
- name: Clone
147-
id: checkout
148-
uses: actions/checkout@v6
149-
150-
- name: Dependencies
151-
id: depends
152-
run: |
153-
sudo apt-get update
154-
sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build
155-
echo "CC=gcc-14" >> "$GITHUB_ENV"
156-
echo "CXX=g++-14" >> "$GITHUB_ENV"
157-
158-
- name: Configure
159-
id: cmake_configure
160-
run: |
161-
cmake -B build \
162-
-G "Ninja" \
163-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
164-
-DGGML_BACKEND_DL=ON \
165-
-DGGML_CPU_ALL_VARIANTS=ON \
166-
-DGGML_VULKAN=ON
167-
168-
- name: Build
169-
id: cmake_build
170-
run: |
171-
time cmake --build build -j $(nproc)
172-
173-
windows-latest:
134+
windows:
174135
runs-on: windows-2025
175136

176137
env:
@@ -202,7 +163,7 @@ jobs:
202163
- name: ccache
203164
uses: ggml-org/ccache-action@v1.2.21
204165
with:
205-
key: windows-latest-${{ matrix.build }}
166+
key: cpu-windows-2025-${{ matrix.build }}
206167
variant: ccache
207168
evict-old-files: 1d
208169
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
@@ -268,88 +229,3 @@ jobs:
268229
# cd build
269230
# $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
270231
# & $sde -future -- ctest -L main -C Release --verbose --timeout 900
271-
272-
ubuntu-latest-cuda:
273-
runs-on: ubuntu-latest
274-
container: nvidia/cuda:12.6.2-devel-ubuntu24.04
275-
276-
steps:
277-
- name: Clone
278-
id: checkout
279-
uses: actions/checkout@v6
280-
281-
- name: Install dependencies
282-
env:
283-
DEBIAN_FRONTEND: noninteractive
284-
run: |
285-
apt update
286-
apt install -y cmake build-essential ninja-build libgomp1 git libssl-dev
287-
288-
- name: ccache
289-
uses: ggml-org/ccache-action@v1.2.21
290-
with:
291-
key: ubuntu-latest-cuda
292-
evict-old-files: 1d
293-
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
294-
295-
- name: Build with CMake
296-
# TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
297-
run: |
298-
cmake -S . -B build -G Ninja \
299-
-DLLAMA_FATAL_WARNINGS=ON \
300-
-DCMAKE_BUILD_TYPE=Release \
301-
-DCMAKE_CUDA_ARCHITECTURES=89-real \
302-
-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
303-
-DGGML_NATIVE=OFF \
304-
-DGGML_CUDA=ON \
305-
-DGGML_CUDA_CUB_3DOT2=ON
306-
cmake --build build
307-
308-
windows-2022-cuda:
309-
runs-on: windows-2022
310-
311-
strategy:
312-
matrix:
313-
cuda: ['12.4']
314-
315-
steps:
316-
- name: Clone
317-
id: checkout
318-
uses: actions/checkout@v6
319-
320-
- name: Install ccache
321-
uses: ggml-org/ccache-action@v1.2.21
322-
with:
323-
key: windows-cuda-${{ matrix.cuda }}
324-
variant: ccache
325-
evict-old-files: 1d
326-
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
327-
328-
- name: Install Cuda Toolkit
329-
uses: ./.github/actions/windows-setup-cuda
330-
with:
331-
cuda_version: ${{ matrix.cuda }}
332-
333-
- name: Install Ninja
334-
id: install_ninja
335-
run: |
336-
choco install ninja
337-
338-
- name: Build
339-
id: cmake_build
340-
shell: cmd
341-
# TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
342-
run: |
343-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
344-
cmake -S . -B build -G "Ninja Multi-Config" ^
345-
-DLLAMA_BUILD_SERVER=ON ^
346-
-DLLAMA_BUILD_BORINGSSL=ON ^
347-
-DGGML_NATIVE=OFF ^
348-
-DGGML_BACKEND_DL=ON ^
349-
-DGGML_CPU_ALL_VARIANTS=ON ^
350-
-DGGML_CUDA=ON ^
351-
-DGGML_RPC=ON ^
352-
-DGGML_CUDA_CUB_3DOT2=ON
353-
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
354-
cmake --build build --config Release -j %NINJA_JOBS% -t ggml
355-
cmake --build build --config Release

0 commit comments

Comments
 (0)