char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Georgi Gerganovci : trigger self-hosted CI on changes to ci/run.sh (#28859)89fe24240

char/aliceai-t5-moe
12.6 KiB447 linesraw
1name: CI (self-hosted)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-self-hosted.yml',
10      'ci/run.sh',
11      '**/CMakeLists.txt',
12      '**/.cmake',
13      '**/*.h',
14      '**/*.hpp',
15      '**/*.c',
16      '**/*.cpp',
17      '**/*.cu',
18      '**/*.cuh',
19      '**/*.swift',
20      '**/*.m',
21      '**/*.metal',
22      '**/*.comp',
23      '**/*.glsl',
24      '**/*.wgsl'
25    ]
26
27  pull_request:
28    types: [opened, synchronize, reopened]
29    paths: [
30      '.github/workflows/build-self-hosted.yml',
31      'ci/run.sh',
32      '**/CMakeLists.txt',
33      '**/.cmake',
34      '**/*.h',
35      '**/*.hpp',
36      '**/*.c',
37      '**/*.cpp',
38      '**/*.cu',
39      '**/*.cuh',
40      '**/*.swift',
41      '**/*.m',
42      '**/*.metal',
43      '**/*.comp',
44      '**/*.glsl',
45      '**/*.wgsl'
46    ]
47
48concurrency:
49  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
50  cancel-in-progress: true
51
52env:
53  # note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302)
54  HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
55  GGML_NLOOP: 3
56  GGML_N_THREADS: 1
57  LLAMA_ARG_LOG_COLORS: 1
58  LLAMA_ARG_LOG_PREFIX: 1
59  LLAMA_ARG_LOG_TIMESTAMPS: 1
60
61jobs:
62  gpu-cuda:
63    runs-on: "hf-jobs-t4-small:cuda13"
64
65    steps:
66      - name: Clone
67        id: checkout
68        uses: actions/checkout@v6
69
70      - name: Install dependencies
71        run: |
72          sudo apt update
73          sudo apt install -y cmake libssl-dev time unzip wget python3 python3-venv python3-pip
74
75      - name: ccache
76        uses: ggml-org/ccache-action@v1.2.24
77        with:
78          restore: false
79          save: false
80
81      - name: ccache-buckets-restore
82        uses: ./.github/actions/ccache-buckets
83        with:
84          key: self-hosted-gpu-cuda
85          folder: llama.cpp
86          hf_bucket: ggml-org/cache
87
88      - name: Test
89        id: ggml-ci
90        run: |
91          nvidia-smi
92          GG_BUILD_CUDA=1 CUDACXX=/usr/local/cuda/bin/nvcc bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
93
94      - name: ccache-buckets-save
95        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
96        uses: ./.github/actions/ccache-buckets
97        env:
98          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
99        with:
100          key: self-hosted-gpu-cuda
101          folder: llama.cpp
102          evict-old-files: 1d
103          hf_bucket: ggml-org/cache
104          save: true
105
106  gpu-rocm:
107    runs-on: [self-hosted, Linux, AMD]
108
109    steps:
110      - name: Clone
111        id: checkout
112        uses: actions/checkout@v6
113
114      - name: Test
115        id: ggml-ci
116        # HIP_LAUNCH_BLOCKING=1: workaround for an async-execution correctness
117        # issue on integrated RDNA3.5 (gfx1151) where batched inference returns
118        # incorrect output (perplexity ~88 vs ~9.4). Serializing kernel launches
119        # restores correctness. Remove once the underlying ROCm/HIP issue is fixed.
120        env:
121          HIP_LAUNCH_BLOCKING: "1"
122        run: |
123          rocminfo
124          GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS=gfx1151 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
125
126  gpu-vulkan-nvidia-cm:
127    runs-on: [self-hosted, Linux, NVIDIA]
128
129    steps:
130      - name: Clone
131        id: checkout
132        uses: actions/checkout@v6
133
134      - name: Test
135        id: ggml-ci
136        run: |
137          vulkaninfo --summary
138          GG_BUILD_VULKAN=1 GGML_VK_DISABLE_COOPMAT2=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
139
140  gpu-vulkan-nvidia-cm2:
141    runs-on: [self-hosted, Linux, NVIDIA, COOPMAT2]
142
143    steps:
144      - name: Clone
145        id: checkout
146        uses: actions/checkout@v6
147
148      - name: Test
149        id: ggml-ci
150        run: |
151          vulkaninfo --summary
152          GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
153
154  gpu-webgpu-nvidia:
155    runs-on: [self-hosted, Linux, NVIDIA, X64]
156
157    steps:
158      - name: Clone
159        id: checkout
160        uses: actions/checkout@v6
161
162      - name: Dawn Dependency
163        id: dawn-depends
164        run: |
165          DAWN_VERSION="v20260908.214631"
166          DAWN_OWNER="google"
167          DAWN_REPO="dawn"
168          DAWN_ASSET_NAME="Dawn-94c3c9cc0d5fb2e85aebb370fa8d37b71aa34655-ubuntu-latest-Release"
169          echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
170          curl -L -o artifact.tar.gz \
171            "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
172          mkdir dawn
173          tar -xvf artifact.tar.gz -C dawn --strip-components=1
174
175      - name: Test
176        id: ggml-ci
177        run: |
178          GG_BUILD_WEBGPU=1 \
179          GG_BUILD_WEBGPU_DAWN_PREFIX="$GITHUB_WORKSPACE/dawn" \
180          GG_BUILD_WEBGPU_DAWN_DIR="$GITHUB_WORKSPACE/dawn/lib64/cmake/Dawn" \
181            bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
182
183  # TODO: provision AMX-compatible machine
184  #cpu-amx:
185  #  runs-on: [self-hosted, Linux, CPU, AMX]
186
187  #  steps:
188  #    - name: Clone
189  #      id: checkout
190  #      uses: actions/checkout@v6
191
192  #    - name: Test
193  #      id: ggml-ci
194  #      run: |
195  #        bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
196
197  # TODO: provision AMD GPU machine
198  # amd-vulkan:
199  #   runs-on: [self-hosted, Linux, AMD]
200
201  #   steps:
202  #     - name: Clone
203  #       id: checkout
204  #       uses: actions/checkout@v6
205
206  #     - name: Test
207  #       id: ggml-ci
208  #       run: |
209  #         vulkaninfo --summary
210  #         GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
211
212  # TODO: provision AMD GPU machine
213  # amd-rocm:
214  #   runs-on: [self-hosted, Linux, AMD]
215
216  #   steps:
217  #     - name: Clone
218  #       id: checkout
219  #       uses: actions/checkout@v6
220
221  #     - name: Test
222  #       id: ggml-ci
223  #       run: |
224  #         amd-smi static
225  #         GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
226
227  gpu-metal:
228    runs-on: [self-hosted, macOS, ARM64]
229
230    steps:
231      - name: Clone
232        id: checkout
233        uses: actions/checkout@v6
234
235      - name: Test
236        id: ggml-ci
237        run: |
238          GG_BUILD_METAL=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
239
240  gpu-webgpu-apple:
241    runs-on: [self-hosted, macOS, ARM64]
242
243    steps:
244      - name: Clone
245        id: checkout
246        uses: actions/checkout@v6
247
248      - name: Dawn Dependency
249        id: dawn-depends
250        run: |
251          DAWN_VERSION="v20260908.214631"
252          DAWN_OWNER="google"
253          DAWN_REPO="dawn"
254          DAWN_ASSET_NAME="Dawn-94c3c9cc0d5fb2e85aebb370fa8d37b71aa34655-macos-latest-Release"
255          echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
256          curl -L -o artifact.tar.gz \
257            "https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz"
258          mkdir dawn
259          tar -xvf artifact.tar.gz -C dawn --strip-components=1
260
261      - name: Test
262        id: ggml-ci
263        run: |
264          GG_BUILD_WEBGPU=1 GG_BUILD_WEBGPU_DAWN_PREFIX="$GITHUB_WORKSPACE/dawn" \
265            bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
266
267  gpu-vulkan-apple:
268    runs-on: [self-hosted, macOS, ARM64]
269
270    steps:
271      - name: Clone
272        id: checkout
273        uses: actions/checkout@v6
274
275      - name: Test
276        id: ggml-ci
277        run: |
278          vulkaninfo --summary
279          GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
280
281  gpu-vulkan-intel-linux:
282    runs-on: [self-hosted, Linux, Intel]
283
284    steps:
285      - name: Clone
286        id: checkout
287        uses: actions/checkout@v6
288        with:
289          persist-credentials: false
290
291      - name: Test
292        id: ggml-ci
293        run: |
294          vulkaninfo --summary
295          GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
296
297  gpu-vulkan-intel-windows:
298    runs-on: [self-hosted, Windows, X64, Intel]
299
300    steps:
301      - name: Clone
302        id: checkout
303        uses: actions/checkout@v6
304
305      - name: Test
306        id: ggml-ci
307        shell: C:\msys64\usr\bin\bash.exe --noprofile --norc -eo pipefail "{0}"
308        env:
309          MSYSTEM: UCRT64
310          CHERE_INVOKING: 1
311          PATH: C:\msys64\ucrt64\bin;C:\msys64\usr\bin;C:\Windows\System32;${{ env.PATH }}
312        run: |
313          vulkaninfo --summary
314          # Skip python related tests with GG_BUILD_LOW_PERF=1 since Windows MSYS2 UCRT64 currently fails to create
315          # a valid python environment for testing
316          LLAMA_FATAL_WARNINGS=OFF GG_BUILD_NINJA=1 GG_BUILD_VULKAN=1 GG_BUILD_LOW_PERF=1 ./ci/run.sh ./results/llama.cpp ./mnt/llama.cpp
317
318  gpu-openvino-low-perf:
319    runs-on: [self-hosted, Linux, Intel, OpenVINO]
320
321    env:
322      # Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
323      OPENVINO_VERSION_MAJOR: "2026.3.1"
324      OPENVINO_VERSION_FULL: "2026.3.1.22476.56d9685302d"
325
326    steps:
327      - name: Clone
328        id: checkout
329        uses: actions/checkout@v6
330
331      - name: Setup OpenVINO Toolkit
332        uses: ./.github/actions/linux-setup-openvino
333        with:
334          path: ./openvino_toolkit
335          version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
336          version_full: ${{ env.OPENVINO_VERSION_FULL }}
337
338      - name: Install OpenVINO dependencies
339        run: |
340          cd ./openvino_toolkit
341          chmod +x ./install_dependencies/install_openvino_dependencies.sh
342          echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
343
344      - name: Test
345        id: ggml-ci
346        run: |
347          source ./openvino_toolkit/setupvars.sh
348          GG_BUILD_OPENVINO=1 GGML_OPENVINO_DEVICE=GPU GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
349
350  cpu-x64-high-perf:
351    runs-on: [self-hosted, Linux, X64]
352
353    steps:
354      - name: Clone
355        id: checkout
356        uses: actions/checkout@v6
357
358      - name: Test
359        id: ggml-ci
360        run: |
361          LLAMA_ARG_THREADS=$(nproc) GG_BUILD_HIGH_PERF=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
362
363  cpu-arm64-high-perf-graviton4:
364    runs-on: ah-ubuntu_22_04-c8g_8x
365
366    steps:
367      - name: Clone
368        id: checkout
369        uses: actions/checkout@v6
370
371      - name: Dependencies
372        id: depends
373        run: |
374          set -euxo pipefail
375          sudo apt-get update
376          sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
377          apt-get install -y \
378          build-essential \
379          python3-venv \
380          gpg \
381          wget \
382          time \
383          git-lfs
384
385          git lfs install
386
387          # install the latest cmake
388          sudo install -d /usr/share/keyrings
389          wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
390            | gpg --dearmor \
391            | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
392          echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
393            | sudo tee /etc/apt/sources.list.d/kitware.list
394          sudo apt-get update
395          sudo apt-get install -y cmake
396
397      - name: Test
398        id: ggml-ci
399        run: |
400          LLAMA_ARG_THREADS=$(nproc) \
401          GG_BUILD_HIGH_PERF=1 \
402          GG_BUILD_NO_BF16=1 \
403          GG_BUILD_EXTRA_TESTS_0=1 \
404          bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
405
406  cpu-arm64-graviton4-kleidiai:
407    runs-on: ah-ubuntu_22_04-c8g_8x
408
409    steps:
410      - name: Clone
411        id: checkout
412        uses: actions/checkout@v6
413
414      - name: Dependencies
415        id: depends
416        run: |
417          set -euxo pipefail
418          sudo apt-get update
419          sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
420          apt-get install -y \
421          build-essential \
422          python3-venv \
423          gpg \
424          wget \
425          time \
426          git-lfs
427
428          git lfs install
429
430          # install the latest cmake
431          sudo install -d /usr/share/keyrings
432          wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
433            | gpg --dearmor \
434            | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
435          echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
436            | sudo tee /etc/apt/sources.list.d/kitware.list
437          sudo apt-get update
438          sudo apt-get install -y cmake
439
440      - name: Test
441        id: ggml-ci
442        run: |
443          LLAMA_ARG_THREADS=$(nproc) \
444          GG_BUILD_KLEIDIAI=1 \
445          GG_BUILD_EXTRA_TESTS_0=1 \
446          GG_BUILD_HIGH_PERF=1 \
447          bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp