@@ -14,12 +14,12 @@ jobs:
1414 os : [ubuntu-22.04, windows-2022, macos-14, macos-15]
1515
1616 steps :
17- - uses : actions/checkout@v4
17+ - uses : actions/checkout@v6
1818 with :
1919 submodules : " recursive"
2020
2121 # Used to host cibuildwheel
22- - uses : actions/setup-python@v5
22+ - uses : actions/setup-python@v6
2323 with :
2424 python-version : " 3.9"
2525
@@ -42,16 +42,25 @@ jobs:
4242 shell : cmd
4343
4444 - name : Build wheels
45- uses : pypa/cibuildwheel@v2.22.0
45+ uses : pypa/cibuildwheel@v3.4.1
4646 env :
4747 # Keep repair disabled by default for non-Linux platforms in this job.
4848 CIBW_REPAIR_WHEEL_COMMAND : " "
4949 # Linux needs auditwheel repair so manylinux and musllinux wheels are
5050 # published with distinct platform tags instead of generic linux tags.
51- CIBW_REPAIR_WHEEL_COMMAND_LINUX : " auditwheel repair -w {dest_dir} {wheel}"
51+ CIBW_REPAIR_WHEEL_COMMAND_LINUX : " LD_LIBRARY_PATH=/project/llama_cpp/lib auditwheel repair -w {dest_dir} {wheel}"
52+ # cibuildwheel v3 defaults to manylinux_2_28 images whose current
53+ # GCC toolchain emits symbols newer than the policy allows.
54+ CIBW_MANYLINUX_X86_64_IMAGE : " manylinux2014"
55+ # The release wheel is tagged py3-none, so one build per platform
56+ # covers all supported Python versions and avoids duplicate names.
57+ CIBW_BUILD_LINUX : " cp38-*"
58+ CIBW_BUILD_MACOS : " cp39-*"
59+ CIBW_BUILD_WINDOWS : " cp39-*"
5260 # Skip cibuildwheel's default i686 sidecar and keep Linux release
5361 # wheels on a portable x86_64 CPU baseline.
5462 CIBW_ARCHS_LINUX : " auto64"
63+ CIBW_ARCHS_WINDOWS : " AMD64"
5564 CIBW_ENVIRONMENT_LINUX : CMAKE_ARGS="-DGGML_NATIVE=off"
5665 # Keep macOS release wheels on a portable CPU baseline instead of
5766 # inheriting the hosted runner's native flags.
6069 package-dir : .
6170 output-dir : wheelhouse
6271
63- - uses : actions/upload-artifact@v4
72+ - uses : actions/upload-artifact@v7
6473 with :
6574 name : wheels-${{ matrix.os }}
6675 path : ./wheelhouse/*.whl
@@ -69,92 +78,108 @@ jobs:
6978 name : Build arm64 wheels
7079 runs-on : ubuntu-24.04-arm
7180 steps :
72- - uses : actions/checkout@v4
81+ - uses : actions/checkout@v6
7382 with :
7483 submodules : " recursive"
7584
7685 - name : Build wheels
77- uses : pypa/cibuildwheel@v2.22.0
86+ uses : pypa/cibuildwheel@v3.4.1
7887 env :
79- CIBW_SKIP : " *musllinux* pp*"
80- CIBW_REPAIR_WHEEL_COMMAND : " "
88+ CIBW_SKIP : " pp*"
89+ CIBW_REPAIR_WHEEL_COMMAND : " LD_LIBRARY_PATH=$PWD/llama_cpp/lib auditwheel repair -w {dest_dir} {wheel} "
8190 CIBW_ARCHS : " aarch64"
91+ # Keep this consistent with the x86_64 Linux release wheels.
92+ CIBW_MANYLINUX_AARCH64_IMAGE : " manylinux2014"
8293 # Keep native arm64 builds on a portable CPU baseline instead of
8394 # tuning wheels to the hosted runner.
8495 CIBW_ENVIRONMENT : CMAKE_ARGS="-DGGML_NATIVE=off"
85- CIBW_BUILD : " cp38-* cp39-* cp310-* cp311-* cp312-*"
96+ # The release wheel is tagged py3-none, so one build covers all
97+ # supported Python versions and avoids duplicate wheel names.
98+ CIBW_BUILD : " cp38-*"
8699 with :
87100 output-dir : wheelhouse
88101
89102 - name : Upload wheels as artifacts
90- uses : actions/upload-artifact@v4
103+ uses : actions/upload-artifact@v7
91104 with :
92105 name : wheels_arm64
93106 path : ./wheelhouse/*.whl
94107
95108 build_wheels_riscv64 :
96- name : Build riscv64 wheels (${{ matrix.shard.name }})
109+ name : Build riscv64 wheel
97110 runs-on : ubuntu-latest
98- strategy :
99- fail-fast : false
100- matrix :
101- shard :
102- - name : cp310
103- build : " cp310-*"
104- artifact : wheels_riscv64_cp310
105- - name : cp311
106- build : " cp311-*"
107- artifact : wheels_riscv64_cp311
108- - name : cp312
109- build : " cp312-*"
110- artifact : wheels_riscv64_cp312
111- - name : cp313
112- build : " cp313-*"
113- artifact : wheels_riscv64_cp313
114- - name : cp314
115- build : " cp314-*"
116- artifact : wheels_riscv64_cp314
117111 steps :
118- - uses : actions/checkout@v4
112+ - uses : actions/checkout@v6
119113 with :
120114 submodules : " recursive"
121115
122116 - name : Set up QEMU
123- uses : docker/setup-qemu-action@v3
117+ uses : docker/setup-qemu-action@v4
124118 with :
125119 platforms : linux/riscv64
126120
127121 - name : Build wheels
128- uses : pypa/cibuildwheel@v3.1.2
122+ uses : pypa/cibuildwheel@v3.4.1
129123 env :
130124 CIBW_SKIP : " *musllinux* pp*"
131125 CIBW_REPAIR_WHEEL_COMMAND : " "
132126 CIBW_ARCHS : " riscv64"
133127 # Build riscv64 wheels against a conservative baseline instead of
134128 # enabling RVV-related extensions from the build container.
135129 CIBW_ENVIRONMENT : CMAKE_ARGS="-DGGML_NATIVE=off -DGGML_RVV=off -DGGML_RV_ZFH=off -DGGML_RV_ZVFH=off -DGGML_RV_ZICBOP=off -DGGML_RV_ZIHINTPAUSE=off"
136- # Split the emulated riscv64 build into one Python version per job
137- # to minimize wall-clock time without changing the release artifacts.
138- CIBW_BUILD : ${{ matrix.shard.build }}
130+ # The release wheel is tagged py3-none, so one riscv64 build is
131+ # enough and avoids duplicate same-name release artifacts.
132+ CIBW_BUILD : " cp310-*"
133+ with :
134+ output-dir : wheelhouse
135+
136+ - name : Upload wheels as artifacts
137+ uses : actions/upload-artifact@v7
138+ with :
139+ name : wheels_riscv64
140+ path : ./wheelhouse/*.whl
141+
142+ build_wheels_pyodide :
143+ name : Build Pyodide wheel
144+ runs-on : ubuntu-latest
145+ steps :
146+ - uses : actions/checkout@v6
147+ with :
148+ submodules : " recursive"
149+
150+ - uses : actions/setup-python@v6
151+ with :
152+ python-version : " 3.12"
153+
154+ - name : Build wheel
155+ uses : pypa/cibuildwheel@v4.1.0
156+ env :
157+ CIBW_PLATFORM : " pyodide"
158+ CIBW_BUILD : " cp314-pyodide_wasm32"
159+ CIBW_BUILD_VERBOSITY : " 1"
160+ CIBW_REPAIR_WHEEL_COMMAND : " "
161+ CIBW_BEFORE_TEST : " curl -L --fail --retry 3 -o /tmp/stories260K.gguf https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K.gguf"
162+ CIBW_TEST_COMMAND : " python -c \" import llama_cpp.mtmd_cpp as mtmd; from llama_cpp import Llama; print('mtmd marker', mtmd.mtmd_default_marker().decode()); llm = Llama(model_path='/tmp/stories260K.gguf', n_ctx=64, n_batch=8, n_threads=1, verbose=False); print('loaded', llm.n_vocab(), llm.n_ctx()); print('generated', llm('Once upon a', max_tokens=1, temperature=0)['choices'][0]['text'])\" "
163+ CMAKE_ARGS : " -DLLAMA_WASM_MEM64=OFF -DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm32 -DGGML_NATIVE=OFF -DGGML_OPENMP=OFF -DGGML_METAL=OFF -DGGML_BLAS=OFF -DGGML_CUDA=OFF -DGGML_HIP=OFF -DGGML_VULKAN=OFF -DGGML_OPENCL=OFF -DGGML_RPC=OFF -DLLAMA_CURL=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TOOLS=OFF -DLLAMA_BUILD_SERVER=OFF"
139164 with :
140165 output-dir : wheelhouse
141166
142167 - name : Upload wheels as artifacts
143- uses : actions/upload-artifact@v4
168+ uses : actions/upload-artifact@v7
144169 with :
145- name : ${{ matrix.shard.artifact }}
170+ name : wheels_pyodide
146171 path : ./wheelhouse/*.whl
147172
148173 build_sdist :
149174 name : Build source distribution
150175 runs-on : ubuntu-latest
151176
152177 steps :
153- - uses : actions/checkout@v4
178+ - uses : actions/checkout@v6
154179 with :
155180 submodules : " recursive"
156181
157- - uses : actions/setup-python@v5
182+ - uses : actions/setup-python@v6
158183 with :
159184 python-version : " 3.9"
160185
@@ -182,24 +207,24 @@ jobs:
182207 run : |
183208 python -m build --sdist
184209
185- - uses : actions/upload-artifact@v4
210+ - uses : actions/upload-artifact@v7
186211 with :
187212 name : sdist
188213 path : ./dist/*.tar.gz
189214
190215 release :
191216 name : Release
192- needs : [build_wheels, build_wheels_arm64, build_wheels_riscv64, build_sdist]
217+ needs : [build_wheels, build_wheels_arm64, build_wheels_riscv64, build_wheels_pyodide, build_sdist]
193218 if : startsWith(github.ref, 'refs/tags/')
194219 runs-on : ubuntu-latest
195220
196221 steps :
197- - uses : actions/download-artifact@v4
222+ - uses : actions/download-artifact@v8
198223 with :
199224 merge-multiple : true
200225 path : dist
201226
202- - uses : softprops/action-gh-release@v2
227+ - uses : softprops/action-gh-release@v3
203228 with :
204229 files : dist/*
205230 env :
0 commit comments