char-fork/llama.cpp

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

Sigbjørn Skjæretci : move more jobs to ccache-buckets (#28375)8b4b3558f

char/aliceai-t5-moe
5.2 KiB193 linesraw
1name: CI (CUDA, ubuntu)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-cuda-ubuntu.yml',
10      '**/CMakeLists.txt',
11      '**/.cmake',
12      '**/*.h',
13      '**/*.hpp',
14      '**/*.c',
15      '**/*.cpp',
16      '**/*.cu',
17      '**/*.cuh'
18    ]
19
20  pull_request:
21    types: [opened, synchronize, reopened]
22    paths: [
23      '.github/workflows/build-cuda-ubuntu.yml',
24      'ggml/src/ggml-cuda/**'
25    ]
26
27concurrency:
28  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
29  cancel-in-progress: true
30
31env:
32  GGML_NLOOP: 3
33  GGML_N_THREADS: 1
34  LLAMA_ARG_LOG_COLORS: 1
35  LLAMA_ARG_LOG_PREFIX: 1
36  LLAMA_ARG_LOG_TIMESTAMPS: 1
37
38jobs:
39  cuda:
40    runs-on: ubuntu-24.04
41    container: nvidia/cuda:12.6.2-devel-ubuntu24.04
42
43    steps:
44      - name: Clone
45        id: checkout
46        uses: actions/checkout@v6
47
48      - name: Install dependencies
49        env:
50          DEBIAN_FRONTEND: noninteractive
51        run: |
52          apt update
53          apt install -y cmake build-essential ninja-build libgomp1 git libssl-dev jq python3 python3-venv python3-pip
54
55      - name: ccache
56        uses: ggml-org/ccache-action@v1.2.24
57        with:
58          key: cuda-ubuntu-24.04-cuda
59          save: false
60
61      - name: ccache-buckets-restore
62        uses: ./.github/actions/ccache-buckets
63        env:
64          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
65        with:
66          key: cuda-ubuntu-24.04-cuda
67          folder: llama.cpp
68          hf_bucket: ggml-org/cache
69
70      - name: Build with CMake
71        # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project
72        run: |
73          cmake -S . -B build -G Ninja \
74            -DLLAMA_FATAL_WARNINGS=ON \
75            -DCMAKE_BUILD_TYPE=Release \
76            -DCMAKE_CUDA_ARCHITECTURES=89-real \
77            -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
78            -DGGML_NATIVE=OFF \
79            -DGGML_CUDA=ON \
80            -DGGML_CUDA_CUB_3DOT2=ON
81          cmake --build build
82
83      - name: ccache-buckets-save
84        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
85        uses: ./.github/actions/ccache-buckets
86        env:
87          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
88        with:
89          key: cuda-ubuntu-24.04-cuda
90          folder: llama.cpp
91          evict-old-files: 1d
92          hf_bucket: ggml-org/cache
93          save: true
94
95  hip:
96    runs-on: ubuntu-22.04
97    container: rocm/dev-ubuntu-22.04:6.1.2
98
99    steps:
100      - name: Clone
101        id: checkout
102        uses: actions/checkout@v6
103
104      - name: Dependencies
105        id: depends
106        run: |
107          sudo apt-get update
108          sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libssl-dev rocwmma-dev jq python3-venv
109
110      - name: ccache
111        uses: ggml-org/ccache-action@v1.2.24
112        with:
113          key: cuda-ubuntu-22.04-hip
114          save: false
115
116      - name: ccache-buckets-restore
117        uses: ./.github/actions/ccache-buckets
118        env:
119          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
120        with:
121          key: cuda-ubuntu-22.04-hip
122          folder: llama.cpp
123          hf_bucket: ggml-org/cache
124
125      - name: Build with native CMake HIP support
126        id: cmake_build
127        run: |
128          cmake -B build -S . \
129            -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
130            -DGPU_TARGETS="gfx1030" \
131            -DGGML_HIP=ON
132          cmake --build build --config Release -j $(nproc)
133
134      - name: ccache-buckets-save
135        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
136        uses: ./.github/actions/ccache-buckets
137        env:
138          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
139        with:
140          key: cuda-ubuntu-22.04-hip
141          folder: llama.cpp
142          evict-old-files: 1d
143          hf_bucket: ggml-org/cache
144          save: true
145
146  musa:
147    runs-on: ubuntu-22.04
148    container: mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64
149
150    steps:
151      - name: Clone
152        id: checkout
153        uses: actions/checkout@v6
154
155      - name: Dependencies
156        id: depends
157        run: |
158          apt-get update
159          apt-get install -y build-essential git cmake libssl-dev jq
160
161      - name: ccache
162        uses: ggml-org/ccache-action@v1.2.24
163        with:
164          key: cuda-ubuntu-22.04-musa
165          save: false
166
167      - name: ccache-buckets-restore
168        uses: ./.github/actions/ccache-buckets
169        env:
170          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
171        with:
172          key: cuda-ubuntu-22.04-musa
173          folder: llama.cpp
174          hf_bucket: ggml-org/cache
175
176      - name: Build with native CMake MUSA support
177        id: cmake_build
178        run: |
179          cmake -B build -S . \
180            -DGGML_MUSA=ON
181          time cmake --build build --config Release -j $(nproc)
182
183      - name: ccache-buckets-save
184        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
185        uses: ./.github/actions/ccache-buckets
186        env:
187          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
188        with:
189          key: cuda-ubuntu-22.04-musa
190          folder: llama.cpp
191          evict-old-files: 1d
192          hf_bucket: ggml-org/cache
193          save: true