44 workflow_call :
55
66jobs :
7- ubuntu-24-riscv64-cpu-cross :
8- runs-on : ubuntu-24.04
9- if : false
10-
11- steps :
12- - uses : actions/checkout@v4
13- - name : Setup Riscv
14- run : |
15- sudo dpkg --add-architecture riscv64
16-
17- # Add arch-specific repositories for non-amd64 architectures
18- cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
19- deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
20- deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
21- deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
22- deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
23- EOF
24-
25- sudo apt-get update || true ;# Prevent failure due to missing URLs.
26-
27- sudo apt-get install -y --no-install-recommends \
28- build-essential \
29- gcc-14-riscv64-linux-gnu \
30- g++-14-riscv64-linux-gnu
31-
32- - name : Build
33- run : |
34- cmake -B build -DLLAMA_CURL=OFF \
35- -DCMAKE_BUILD_TYPE=Release \
36- -DGGML_OPENMP=OFF \
37- -DLLAMA_BUILD_EXAMPLES=ON \
38- -DLLAMA_BUILD_TOOLS=ON \
39- -DLLAMA_BUILD_TESTS=OFF \
40- -DCMAKE_SYSTEM_NAME=Linux \
41- -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
42- -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
43- -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
44- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
45- -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
46- -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
47- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
48- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
49-
50- cmake --build build --config Release -j $(nproc)
51-
52- # ubuntu-24-riscv64-vulkan-cross:
7+ # ubuntu-24-riscv64-cpu-cross:
538 # runs-on: ubuntu-24.04
549
5510 # steps:
@@ -70,16 +25,13 @@ jobs:
7025
7126 # sudo apt-get install -y --no-install-recommends \
7227 # build-essential \
73- # glslc \
7428 # gcc-14-riscv64-linux-gnu \
75- # g++-14-riscv64-linux-gnu \
76- # libvulkan-dev:riscv64
29+ # g++-14-riscv64-linux-gnu
7730
7831 # - name: Build
7932 # run: |
8033 # cmake -B build -DLLAMA_CURL=OFF \
8134 # -DCMAKE_BUILD_TYPE=Release \
82- # -DGGML_VULKAN=ON \
8335 # -DGGML_OPENMP=OFF \
8436 # -DLLAMA_BUILD_EXAMPLES=ON \
8537 # -DLLAMA_BUILD_TOOLS=ON \
@@ -96,30 +48,31 @@ jobs:
9648
9749 # cmake --build build --config Release -j $(nproc)
9850
99- # ubuntu-24-arm64 -vulkan-cross:
51+ # ubuntu-24-riscv64 -vulkan-cross:
10052 # runs-on: ubuntu-24.04
10153
10254 # steps:
10355 # - uses: actions/checkout@v4
104- # - name: Setup Arm64
56+ # - name: Setup Riscv
10557 # run: |
106- # sudo dpkg --add-architecture arm64
58+ # sudo dpkg --add-architecture riscv64
10759
10860 # # Add arch-specific repositories for non-amd64 architectures
109- # cat << EOF | sudo tee /etc/apt/sources.list.d/arm64 -ports.list
110- # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
111- # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
112- # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
113- # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
61+ # cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64 -ports.list
62+ # deb [arch=riscv64 ] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
63+ # deb [arch=riscv64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
64+ # deb [arch=riscv64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
65+ # deb [arch=riscv64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
11466 # EOF
11567
11668 # sudo apt-get update || true ;# Prevent failure due to missing URLs.
11769
11870 # sudo apt-get install -y --no-install-recommends \
11971 # build-essential \
12072 # glslc \
121- # crossbuild-essential-arm64 \
122- # libvulkan-dev:arm64
73+ # gcc-14-riscv64-linux-gnu \
74+ # g++-14-riscv64-linux-gnu \
75+ # libvulkan-dev:riscv64
12376
12477 # - name: Build
12578 # run: |
@@ -131,87 +84,41 @@ jobs:
13184 # -DLLAMA_BUILD_TOOLS=ON \
13285 # -DLLAMA_BUILD_TESTS=OFF \
13386 # -DCMAKE_SYSTEM_NAME=Linux \
134- # -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
135- # -DCMAKE_C_COMPILER=aarch64 -linux-gnu-gcc \
136- # -DCMAKE_CXX_COMPILER=aarch64 -linux-gnu-g++ \
87+ # -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
88+ # -DCMAKE_C_COMPILER=riscv64 -linux-gnu-gcc-14 \
89+ # -DCMAKE_CXX_COMPILER=riscv64 -linux-gnu-g++-14 \
13790 # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
138- # -DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64 -linux-gnu \
91+ # -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64 -linux-gnu \
13992 # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
14093 # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
14194 # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
14295
14396 # cmake --build build --config Release -j $(nproc)
14497
145- ubuntu-24-ppc64el-cpu-cross :
146- runs-on : ubuntu-24.04
147- if : false
148-
149- steps :
150- - uses : actions/checkout@v4
151- - name : Setup PowerPC64le
152- run : |
153- sudo dpkg --add-architecture ppc64el
154-
155- # Add arch-specific repositories for non-amd64 architectures
156- cat << EOF | sudo tee /etc/apt/sources.list.d/ppc64el-ports.list
157- deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
158- deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
159- deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
160- deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
161- EOF
162-
163- sudo apt-get update || true ;# Prevent failure due to missing URLs.
164-
165- sudo apt-get install -y --no-install-recommends \
166- build-essential \
167- gcc-14-powerpc64le-linux-gnu \
168- g++-14-powerpc64le-linux-gnu
169-
170- - name : Build
171- run : |
172- cmake -B build -DLLAMA_CURL=OFF \
173- -DCMAKE_BUILD_TYPE=Release \
174- -DGGML_OPENMP=OFF \
175- -DLLAMA_BUILD_EXAMPLES=ON \
176- -DLLAMA_BUILD_TOOLS=ON \
177- -DLLAMA_BUILD_TESTS=OFF \
178- -DCMAKE_SYSTEM_NAME=Linux \
179- -DCMAKE_SYSTEM_PROCESSOR=ppc64 \
180- -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc-14 \
181- -DCMAKE_CXX_COMPILER=powerpc64le-linux-gnu-g++-14 \
182- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
183- -DCMAKE_FIND_ROOT_PATH=/usr/lib/powerpc64le-linux-gnu \
184- -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
185- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
186- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
187-
188- cmake --build build --config Release -j $(nproc)
189-
190- # ubuntu-24-ppc64el-vulkan-cross:
98+ # ubuntu-24-arm64-vulkan-cross:
19199 # runs-on: ubuntu-24.04
192100
193101 # steps:
194102 # - uses: actions/checkout@v4
195- # - name: Setup PowerPC64le
103+ # - name: Setup Arm64
196104 # run: |
197- # sudo dpkg --add-architecture ppc64el
105+ # sudo dpkg --add-architecture arm64
198106
199107 # # Add arch-specific repositories for non-amd64 architectures
200- # cat << EOF | sudo tee /etc/apt/sources.list.d/ppc64el -ports.list
201- # deb [arch=ppc64el ] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
202- # deb [arch=ppc64el ] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
203- # deb [arch=ppc64el ] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
204- # deb [arch=ppc64el ] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
108+ # cat << EOF | sudo tee /etc/apt/sources.list.d/arm64 -ports.list
109+ # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
110+ # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
111+ # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
112+ # deb [arch=arm64 ] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
205113 # EOF
206114
207115 # sudo apt-get update || true ;# Prevent failure due to missing URLs.
208116
209117 # sudo apt-get install -y --no-install-recommends \
210118 # build-essential \
211119 # glslc \
212- # gcc-14-powerpc64le-linux-gnu \
213- # g++-14-powerpc64le-linux-gnu \
214- # libvulkan-dev:ppc64el
120+ # crossbuild-essential-arm64 \
121+ # libvulkan-dev:arm64
215122
216123 # - name: Build
217124 # run: |
@@ -223,11 +130,11 @@ jobs:
223130 # -DLLAMA_BUILD_TOOLS=ON \
224131 # -DLLAMA_BUILD_TESTS=OFF \
225132 # -DCMAKE_SYSTEM_NAME=Linux \
226- # -DCMAKE_SYSTEM_PROCESSOR=ppc64 \
227- # -DCMAKE_C_COMPILER=powerpc64le -linux-gnu-gcc-14 \
228- # -DCMAKE_CXX_COMPILER=powerpc64le -linux-gnu-g++-14 \
133+ # -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
134+ # -DCMAKE_C_COMPILER=aarch64 -linux-gnu-gcc \
135+ # -DCMAKE_CXX_COMPILER=aarch64 -linux-gnu-g++ \
229136 # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
230- # -DCMAKE_FIND_ROOT_PATH=/usr/lib/powerpc64le -linux-gnu \
137+ # -DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64 -linux-gnu \
231138 # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
232139 # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
233140 # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
@@ -346,3 +253,46 @@ jobs:
346253 -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
347254
348255 cmake --build build --config Release -j $(nproc)
256+
257+ ubuntu-24-riscv64-cpu-spacemit-ime-cross :
258+ runs-on : ubuntu-24.04
259+
260+ env :
261+ # Make sure this is in sync with build-cache.yml
262+ SPACEMIT_IME_TOOLCHAIN_VERSION : " 1.1.2"
263+
264+ steps :
265+ - uses : actions/checkout@v4
266+
267+ - name : Use SpacemiT Toolchain Cache
268+ uses : actions/cache@v4
269+ id : cache-toolchain
270+ with :
271+ path : ./spacemit_toolchain
272+ key : spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
273+
274+ - name : Setup SpacemiT Toolchain
275+ if : steps.cache-toolchain.outputs.cache-hit != 'true'
276+ uses : ./.github/actions/linux-setup-spacemit
277+ with :
278+ path : ./spacemit_toolchain
279+ version : ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
280+
281+ - name : Build
282+ run : |
283+ export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain
284+ cmake -B build -DLLAMA_CURL=OFF \
285+ -DCMAKE_BUILD_TYPE=Release \
286+ -DGGML_OPENMP=OFF \
287+ -DLLAMA_BUILD_EXAMPLES=ON \
288+ -DLLAMA_BUILD_TOOLS=ON \
289+ -DLLAMA_BUILD_TESTS=OFF \
290+ -DGGML_CPU_RISCV64_SPACEMIT=ON \
291+ -DGGML_RVV=ON \
292+ -DGGML_RV_ZFH=ON \
293+ -DGGML_RV_ZICBOP=ON \
294+ -DGGML_RV_ZIHINTPAUSE=ON \
295+ -DRISCV64_SPACEMIT_IME_SPEC=RISCV64_SPACEMIT_IME1 \
296+ -DCMAKE_TOOLCHAIN_FILE=${PWD}/cmake/riscv64-spacemit-linux-gnu-gcc.cmake
297+
298+ cmake --build build --config Release -j $(nproc)
0 commit comments