char-fork/llama.cpp

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

Georgi Gerganovci : reduce (disable SYCL and CANN builds/releases) (#23705)3dc7684f3

char/aliceai-t5-moe
13.3 KiB317 linesraw
1name: CI (cross)
2on:
3  # only manual triggers due to low-importance of the workflows
4  # TODO: for regular runs, provision dedicated self-hosted runners
5  workflow_dispatch:
6  push:
7    branches:
8      - master
9    paths: [
10      '.github/workflows/build-cross.yml',
11      'ggml/src/spacemit/*',
12      'ggml/src/arch/loongarch/*'
13    ]
14  # run once every week
15  schedule:
16    - cron: '0 0 * * 0'
17
18concurrency:
19  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
20  cancel-in-progress: true
21
22
23jobs:
24  # ubuntu-24-riscv64-cpu-cross:
25  #   runs-on: ubuntu-24.04
26
27  #   steps:
28  #     - uses: actions/checkout@v6
29  #     - name: Setup Riscv
30  #       run: |
31  #         sudo dpkg --add-architecture riscv64
32
33  #         # Add arch-specific repositories for non-amd64 architectures
34  #         cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
35  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
36  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
37  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
38  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
39  #         EOF
40
41  #         sudo apt-get update || true    ;# Prevent failure due to missing URLs.
42
43  #         sudo apt-get install -y --no-install-recommends \
44  #                 build-essential \
45  #                 gcc-14-riscv64-linux-gnu \
46  #                 g++-14-riscv64-linux-gnu
47
48  #     - name: Build
49  #       run: |
50  #         cmake -B build -DLLAMA_OPENSSL=OFF \
51  #                        -DCMAKE_BUILD_TYPE=Release \
52  #                        -DGGML_OPENMP=OFF \
53  #                        -DLLAMA_BUILD_EXAMPLES=ON \
54  #                        -DLLAMA_BUILD_TOOLS=ON \
55  #                        -DLLAMA_BUILD_TESTS=OFF \
56  #                        -DCMAKE_SYSTEM_NAME=Linux \
57  #                        -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
58  #                        -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
59  #                        -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
60  #                        -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
61  #                        -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
62  #                        -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
63  #                        -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
64  #                        -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
65
66  #         cmake --build build --config Release -j $(nproc)
67
68  # ubuntu-24-riscv64-vulkan-cross:
69  #   runs-on: ubuntu-24.04
70
71  #   steps:
72  #     - uses: actions/checkout@v6
73  #     - name: Setup Riscv
74  #       run: |
75  #         sudo dpkg --add-architecture riscv64
76
77  #         # Add arch-specific repositories for non-amd64 architectures
78  #         cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
79  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
80  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
81  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
82  #         deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
83  #         EOF
84
85  #         sudo apt-get update || true    ;# Prevent failure due to missing URLs.
86
87  #         sudo apt-get install -y --no-install-recommends \
88  #                 build-essential \
89  #                 glslc \
90  #                 gcc-14-riscv64-linux-gnu \
91  #                 g++-14-riscv64-linux-gnu \
92  #                 libvulkan-dev:riscv64
93
94  #     - name: Build
95  #       run: |
96  #         cmake -B build -DLLAMA_OPENSSL=OFF \
97  #                        -DCMAKE_BUILD_TYPE=Release \
98  #                        -DGGML_VULKAN=ON \
99  #                        -DGGML_OPENMP=OFF \
100  #                        -DLLAMA_BUILD_EXAMPLES=ON \
101  #                        -DLLAMA_BUILD_TOOLS=ON \
102  #                        -DLLAMA_BUILD_TESTS=OFF \
103  #                        -DCMAKE_SYSTEM_NAME=Linux \
104  #                        -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
105  #                        -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
106  #                        -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
107  #                        -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
108  #                        -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
109  #                        -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
110  #                        -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
111  #                        -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
112
113  #         cmake --build build --config Release -j $(nproc)
114
115  # ubuntu-24-arm64-vulkan-cross:
116  #   runs-on: ubuntu-24.04
117
118  #   steps:
119  #     - uses: actions/checkout@v6
120  #     - name: Setup Arm64
121  #       run: |
122  #         sudo dpkg --add-architecture arm64
123
124  #         # Add arch-specific repositories for non-amd64 architectures
125  #         cat << EOF | sudo tee /etc/apt/sources.list.d/arm64-ports.list
126  #         deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
127  #         deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
128  #         deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
129  #         deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
130  #         EOF
131
132  #         sudo apt-get update || true    ;# Prevent failure due to missing URLs.
133
134  #         sudo apt-get install -y --no-install-recommends \
135  #                 build-essential \
136  #                 glslc \
137  #                 crossbuild-essential-arm64 \
138  #                 libvulkan-dev:arm64
139
140  #     - name: Build
141  #       run: |
142  #         cmake -B build -DLLAMA_OPENSSL=OFF \
143  #                        -DCMAKE_BUILD_TYPE=Release \
144  #                        -DGGML_VULKAN=ON \
145  #                        -DGGML_OPENMP=OFF \
146  #                        -DLLAMA_BUILD_EXAMPLES=ON \
147  #                        -DLLAMA_BUILD_TOOLS=ON \
148  #                        -DLLAMA_BUILD_TESTS=OFF \
149  #                        -DCMAKE_SYSTEM_NAME=Linux \
150  #                        -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
151  #                        -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
152  #                        -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
153  #                        -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
154  #                        -DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64-linux-gnu \
155  #                        -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
156  #                        -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
157  #                        -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
158
159  #         cmake --build build --config Release -j $(nproc)
160
161  debian-13-loongarch64-cpu-cross:
162    runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
163    container: debian@sha256:653dfb9f86c3782e8369d5f7d29bb8faba1f4bff9025db46e807fa4c22903671
164
165    steps:
166      - uses: actions/checkout@v6
167      - name: Setup LoongArch
168        run: |
169          rm -f /etc/apt/sources.list.d/*
170          cat << EOF | tee /etc/apt/sources.list.d/debian-ports.list
171          deb http://snapshot.debian.org/archive/debian/20250515T202920Z/ trixie main
172          EOF
173          ( echo 'quiet "true";'; \
174            echo 'APT::Get::Assume-Yes "true";'; \
175            echo 'APT::Install-Recommends "false";'; \
176            echo 'Acquire::Check-Valid-Until "false";'; \
177            echo 'Acquire::Retries "5";'; \
178          ) > /etc/apt/apt.conf.d/99snapshot-repos
179
180          apt-get update
181          apt-get install -y ca-certificates debian-ports-archive-keyring cmake git zip
182          dpkg --add-architecture loong64
183
184          # Add arch-specific repositories for non-amd64 architectures
185          cat << EOF | tee /etc/apt/sources.list.d/loong64-ports.list
186          deb [arch=loong64] http://snapshot.debian.org/archive/debian-ports/20250515T194251Z/ sid main
187          EOF
188
189          apt-get update || true    ;# Prevent failure due to missing URLs.
190
191          apt-get install -y --no-install-recommends \
192                  build-essential \
193                  gcc-14-loongarch64-linux-gnu \
194                  g++-14-loongarch64-linux-gnu
195
196      - name: Build
197        run: |
198          cmake -B build -DLLAMA_OPENSSL=OFF \
199                         -DCMAKE_BUILD_TYPE=Release \
200                         -DGGML_OPENMP=OFF \
201                         -DLLAMA_BUILD_EXAMPLES=ON \
202                         -DLLAMA_BUILD_TOOLS=ON \
203                         -DLLAMA_BUILD_TESTS=OFF \
204                         -DCMAKE_SYSTEM_NAME=Linux \
205                         -DCMAKE_SYSTEM_PROCESSOR=loongarch64 \
206                         -DCMAKE_C_COMPILER=loongarch64-linux-gnu-gcc-14 \
207                         -DCMAKE_CXX_COMPILER=loongarch64-linux-gnu-g++-14 \
208                         -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
209                         -DCMAKE_FIND_ROOT_PATH=/usr/lib/loongarch64-linux-gnu \
210                         -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
211                         -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
212                         -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
213
214          cmake --build build --config Release -j $(nproc)
215
216  debian-13-loongarch64-vulkan-cross:
217    runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
218    container: debian@sha256:653dfb9f86c3782e8369d5f7d29bb8faba1f4bff9025db46e807fa4c22903671
219
220    steps:
221      - uses: actions/checkout@v6
222      - name: Setup LoongArch
223        run: |
224          rm -f /etc/apt/sources.list.d/*
225          cat << EOF | tee /etc/apt/sources.list.d/debian-ports.list
226          deb http://snapshot.debian.org/archive/debian/20250515T202920Z/ trixie main
227          EOF
228          ( echo 'quiet "true";'; \
229            echo 'APT::Get::Assume-Yes "true";'; \
230            echo 'APT::Install-Recommends "false";'; \
231            echo 'Acquire::Check-Valid-Until "false";'; \
232            echo 'Acquire::Retries "5";'; \
233          ) > /etc/apt/apt.conf.d/99snapshot-repos
234
235          apt-get update
236          apt-get install -y ca-certificates debian-ports-archive-keyring cmake git zip
237          dpkg --add-architecture loong64
238
239          # Add arch-specific repositories for non-amd64 architectures
240          cat << EOF | tee /etc/apt/sources.list.d/loong64-ports.list
241          deb [arch=loong64] http://snapshot.debian.org/archive/debian-ports/20250515T194251Z/ sid main
242          EOF
243
244          apt-get update || true    ;# Prevent failure due to missing URLs.
245
246          apt-get install -y --no-install-recommends \
247                  build-essential \
248                  glslc \
249                  spirv-headers \
250                  gcc-14-loongarch64-linux-gnu \
251                  g++-14-loongarch64-linux-gnu \
252                  libvulkan-dev:loong64
253
254      - name: Build
255        run: |
256          cmake -B build -DLLAMA_OPENSSL=OFF \
257                         -DCMAKE_BUILD_TYPE=Release \
258                         -DGGML_VULKAN=ON \
259                         -DGGML_OPENMP=OFF \
260                         -DLLAMA_BUILD_EXAMPLES=ON \
261                         -DLLAMA_BUILD_TOOLS=ON \
262                         -DLLAMA_BUILD_TESTS=OFF \
263                         -DCMAKE_SYSTEM_NAME=Linux \
264                         -DCMAKE_SYSTEM_PROCESSOR=loongarch64 \
265                         -DCMAKE_C_COMPILER=loongarch64-linux-gnu-gcc-14 \
266                         -DCMAKE_CXX_COMPILER=loongarch64-linux-gnu-g++-14 \
267                         -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
268                         -DCMAKE_FIND_ROOT_PATH=/usr/lib/loongarch64-linux-gnu \
269                         -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
270                         -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
271                         -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
272
273          cmake --build build --config Release -j $(nproc)
274
275  ubuntu-24-riscv64-cpu-spacemit-ime-cross:
276    runs-on: ubuntu-24.04
277
278    env:
279      # Make sure this is in sync with build-cache.yml
280      SPACEMIT_IME_TOOLCHAIN_VERSION: "1.2.4"
281
282    steps:
283      - uses: actions/checkout@v6
284
285      #- name: Use SpacemiT Toolchain Cache
286      #  uses: actions/cache@v5
287      #  id: cache-toolchain
288      #  with:
289      #    path: ./spacemit_toolchain
290      #    key: cache-gha-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
291
292      - name: Setup SpacemiT Toolchain
293        #if: steps.cache-toolchain.outputs.cache-hit != 'true'
294        uses: ./.github/actions/linux-setup-spacemit
295        with:
296          path: ./spacemit_toolchain
297          version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
298
299      - name: Build
300        run: |
301          export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain
302          cmake -B build -DLLAMA_OPENSSL=OFF \
303                         -DCMAKE_BUILD_TYPE=Release \
304                         -DLLAMA_BUILD_EXAMPLES=ON \
305                         -DGGML_CPU_REPACK=OFF \
306                         -DLLAMA_BUILD_TOOLS=ON \
307                         -DLLAMA_BUILD_TESTS=OFF \
308                         -DGGML_CPU_RISCV64_SPACEMIT=ON \
309                         -DGGML_RVV=ON \
310                         -DGGML_RV_ZVFH=ON \
311                         -DGGML_RV_ZFH=ON \
312                         -DGGML_RV_ZICBOP=ON \
313                         -DGGML_RV_ZIHINTPAUSE=ON \
314                         -DGGML_RV_ZBA=ON \
315                         -DCMAKE_TOOLCHAIN_FILE=${PWD}/cmake/riscv64-spacemit-linux-gnu-gcc.cmake
316
317          cmake --build build --config Release -j $(nproc)