char-fork/llama.cpp

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

Georgi Gerganovci : run test-backend-ops as a dedicated ci/run.sh test (#28740)b78a39a2f

char/aliceai-t5-moe
6.4 KiB230 linesraw
1name: CI (vulkan)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-vulkan.yml',
10      '**/CMakeLists.txt',
11      '**/.cmake',
12      '**/*.h',
13      '**/*.hpp',
14      '**/*.c',
15      '**/*.cpp',
16      '**/*.comp',
17      '**/*.glsl'
18    ]
19
20  pull_request:
21    types: [opened, synchronize, reopened]
22    paths: [
23      '.github/workflows/build-vulkan.yml',
24      'ggml/src/ggml-vulkan/**'
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  ubuntu-arm64:
40    runs-on: ubuntu-24.04-arm
41
42    steps:
43      - name: Clone
44        id: checkout
45        uses: actions/checkout@v6
46
47      - name: Dependencies
48        id: depends
49        run: |
50          sudo apt-get update
51          sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build
52          echo "CC=gcc-14" >> "$GITHUB_ENV"
53          echo "CXX=g++-14" >> "$GITHUB_ENV"
54
55      - name: ccache
56        uses: ggml-org/ccache-action@v1.2.24
57        with:
58          key: vulkan-ubuntu-24.04-arm
59          variant: ccache
60          save: false
61
62      - name: ccache-buckets-restore
63        uses: ./.github/actions/ccache-buckets
64        env:
65          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
66        with:
67          key: vulkan-ubuntu-24.04-arm
68          folder: llama.cpp
69          hf_bucket: ggml-org/cache
70
71      - name: Configure
72        id: cmake_configure
73        run: |
74          cmake -B build \
75            -G "Ninja" \
76            -DCMAKE_BUILD_TYPE=Release \
77            -DGGML_VULKAN=ON
78
79      - name: Build
80        id: cmake_build
81        run: |
82          time cmake --build build -j $(nproc)
83
84      - name: ccache-buckets-save
85        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
86        uses: ./.github/actions/ccache-buckets
87        env:
88          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
89        with:
90          key: vulkan-ubuntu-24.04-arm
91          folder: llama.cpp
92          evict-old-files: 1d
93          hf_bucket: ggml-org/cache
94          save: true
95
96  ubuntu-llvmpipe:
97    runs-on: ubuntu-24.04
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 add-apt-repository -y ppa:kisak/kisak-mesa
108          sudo apt-get update -y
109          sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev
110
111      - name: Get latest Vulkan SDK version
112        id: vulkan_sdk_version
113        run: |
114          echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
115
116      - name: Setup Vulkan SDK
117        id: setup
118        uses: ./.github/actions/unarchive-tar
119        with:
120          url: https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkan_sdk.tar.xz
121          path: ./vulkan_sdk
122          strip: 1
123
124      - name: ccache
125        uses: ggml-org/ccache-action@v1.2.24
126        with:
127          key: vulkan-ubuntu-24.04-llvmpipe
128          save: false
129
130      - name: ccache-buckets-restore
131        uses: ./.github/actions/ccache-buckets
132        env:
133          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
134        with:
135          key: vulkan-ubuntu-24.04-llvmpipe
136          folder: llama.cpp
137          hf_bucket: ggml-org/cache
138
139      - name: Build
140        id: cmake_build
141        run: |
142          source ./vulkan_sdk/setup-env.sh
143          cmake -B build \
144            -DGGML_NATIVE=OFF \
145            -DGGML_VULKAN=ON
146          cmake --build build --config Release -j $(nproc)
147
148      - name: ccache-buckets-save
149        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
150        uses: ./.github/actions/ccache-buckets
151        env:
152          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
153        with:
154          key: vulkan-ubuntu-24.04-llvmpipe
155          folder: llama.cpp
156          evict-old-files: 1d
157          hf_bucket: ggml-org/cache
158          save: true
159
160      - name: Test
161        id: cmake_test
162        run: |
163          cd build
164          export GGML_VK_VISIBLE_DEVICES=0
165          export GGML_VK_DISABLE_F16=1
166          export GGML_VK_DISABLE_COOPMAT=1
167          ctest -L main --verbose --timeout 900
168
169  windows:
170    runs-on: windows-2025
171
172    env:
173      VULKAN_VERSION: 1.4.357.0
174
175    steps:
176      - name: Clone
177        id: checkout
178        uses: actions/checkout@v6
179
180      - name: ccache
181        uses: ggml-org/ccache-action@v1.2.24
182        with:
183          key: cpu-windows-2025-x64-vulkan
184          variant: ccache
185          evict-old-files: 1d
186          save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
187
188      - name: Install Vulkan SDK
189        id: get_vulkan
190        run: |
191          curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
192          & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
193          Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
194          Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
195
196      - name: Install Ninja
197        id: install_ninja
198        run: |
199          choco install ninja
200
201      - name: Build
202        id: cmake_build
203        run: |
204          cmake -S . -B build -G "Ninja Multi-Config" `
205            -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake `
206            -DCMAKE_BUILD_TYPE=Release `
207            -DGGML_NATIVE=OFF `
208            -DLLAMA_BUILD_SERVER=ON `
209            -DGGML_RPC=ON `
210            -DGGML_BACKEND_DL=ON `
211            -DGGML_CPU_ALL_VARIANTS=ON `
212            -DGGML_VULKAN=ON `
213            -DLLAMA_BUILD_BORINGSSL=ON
214          cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
215
216      - name: Test
217        id: cmake_test
218        run: |
219          cd build
220          ctest -L main -C Release --verbose --timeout 900
221
222      - name: ccache-clear
223        uses: ./.github/actions/ccache-clear
224        env:
225          GH_TOKEN: ${{ github.token }}
226        with:
227          key: cpu-windows-2025-x64-vulkan
228          older: 5m
229          min: 1
230          dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}