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.7 KiB213 linesraw
1name: Server
2
3on:
4  workflow_dispatch: # allows manual triggering
5    inputs:
6      sha:
7        description: 'Commit SHA1 to build'
8        required: false
9        type: string
10      slow_tests:
11        description: 'Run slow tests'
12        required: true
13        type: boolean
14  push:
15    branches:
16      - master
17    paths: [
18      '.github/workflows/server.yml',
19      '**/CMakeLists.txt',
20      '**/Makefile',
21      '**/*.h',
22      '**/*.hpp',
23      '**/*.c',
24      '**/*.cpp',
25      '**/*.cu',
26      '**/*.swift',
27      '**/*.m',
28      'tools/server/**.*'
29    ]
30  pull_request:
31    types: [opened, synchronize, reopened]
32    paths: [
33      '.github/workflows/server.yml',
34      '**/CMakeLists.txt',
35      '**/Makefile',
36      '**/*.h',
37      '**/*.hpp',
38      '**/*.c',
39      '**/*.cpp',
40      '**/*.cu',
41      '**/*.swift',
42      '**/*.m',
43      'tools/server/**.*'
44    ]
45
46env:
47  LLAMA_ARG_LOG_COLORS: 1
48  LLAMA_ARG_LOG_PREFIX: 1
49  LLAMA_ARG_LOG_TIMESTAMPS: 1
50  LLAMA_ARG_LOG_VERBOSITY: 10
51
52concurrency:
53  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
54  cancel-in-progress: true
55
56jobs:
57  ubuntu:
58    runs-on: ubuntu-24.04-arm
59
60    steps:
61      - name: Dependencies
62        id: depends
63        run: |
64          sudo apt-get update
65          sudo apt-get -y install \
66            build-essential \
67            xxd \
68            git \
69            cmake \
70            curl \
71            wget \
72            language-pack-en \
73            libssl-dev
74
75      - name: Clone
76        id: checkout
77        uses: actions/checkout@v6
78        with:
79          fetch-depth: 0
80          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
81
82      - name: ccache
83        uses: ggml-org/ccache-action@v1.2.24
84        with:
85          key: server-ubuntu-24.04-arm
86          save: false
87
88      - name: ccache-buckets-restore
89        uses: ./.github/actions/ccache-buckets
90        env:
91          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
92        with:
93          key: server-ubuntu-24.04-arm
94          folder: llama.cpp
95          hf_bucket: ggml-org/cache
96
97      - name: Build
98        id: cmake_build
99        run: |
100          cmake -B build \
101            -DGGML_SCHED_NO_REALLOC=ON
102          cmake --build build --config Release -j $(nproc) --target llama-server
103
104      - name: ccache-buckets-save
105        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
106        uses: ./.github/actions/ccache-buckets
107        env:
108          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
109        with:
110          key: server-ubuntu-24.04-arm
111          folder: llama.cpp
112          evict-old-files: 1d
113          hf_bucket: ggml-org/cache
114          save: true
115
116      - name: Python setup
117        id: setup_python
118        uses: actions/setup-python@v6
119        with:
120          python-version: '3.11'
121          pip-install: -r tools/server/tests/requirements.txt
122
123      - name: Tests
124        id: server_integration_tests
125        run: |
126          cd tools/server/tests
127          ./tests.sh
128
129      - name: Slow tests
130        id: server_integration_tests_slow
131        if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
132        run: |
133          cd tools/server/tests
134          SLOW_TESTS=1 ./tests.sh
135
136      - name: Tests (Backend sampling)
137        id: server_integration_tests_backend_sampling
138        run: |
139          cd tools/server/tests
140          export LLAMA_ARG_BACKEND_SAMPLING=1
141          ./tests.sh
142
143      - name: Slow tests (Backend sampling)
144        id: server_integration_tests_slow_backend_sampling
145        if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
146        run: |
147          cd tools/server/tests
148          export LLAMA_ARG_BACKEND_SAMPLING=1
149          SLOW_TESTS=1 ./tests.sh
150
151  windows:
152    runs-on: windows-2025
153
154    steps:
155      - name: Clone
156        id: checkout
157        uses: actions/checkout@v6
158        with:
159          fetch-depth: 0
160          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
161
162      - name: ccache
163        uses: ggml-org/ccache-action@v1.2.24
164        with:
165          key: server-windows-2025-x64
166          evict-old-files: 1d
167          save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
168
169      - name: Build
170        id: cmake_build
171        shell: cmd
172        run: |
173          cmake -B build -G "Ninja Multi-Config" ^
174            -DCMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake ^
175            -DCMAKE_BUILD_TYPE=Release ^
176            -DLLAMA_BUILD_BORINGSSL=ON ^
177            -DGGML_SCHED_NO_REALLOC=ON
178          set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
179          cmake --build build --config Release -j %NINJA_JOBS% --target llama-server
180
181      - name: Python setup
182        id: setup_python
183        uses: actions/setup-python@v6
184        with:
185          python-version: '3.11'
186          pip-install: -r tools/server/tests/requirements.txt
187
188      - name: Tests
189        id: server_integration_tests
190        shell: bash
191        run: |
192          cd tools/server/tests
193          export PYTHONIOENCODING=":replace"
194          ./tests.sh
195
196      - name: Slow tests
197        id: server_integration_tests_slow
198        if: ${{ github.event.schedule || github.event.inputs.slow_tests == 'true' }}
199        shell: bash
200        run: |
201          cd tools/server/tests
202          export SLOW_TESTS="1"
203          ./tests.sh
204
205      - name: ccache-clear
206        uses: ./.github/actions/ccache-clear
207        env:
208          GH_TOKEN: ${{ github.token }}
209        with:
210          key: server-windows-2025-x64
211          older: 5m
212          min: 1
213          dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}