-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ci: refactor cpu wheel build workflow #2164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [build-system] | ||
| requires = ["scikit-build-core[pyproject]>=0.9.2"] | ||
| requires = ["scikit-build-core>=0.12.2"] | ||
| build-backend = "scikit_build_core.build" | ||
|
|
||
| [project] | ||
|
|
@@ -63,6 +63,7 @@ all = [ | |
|
|
||
| [tool.scikit-build] | ||
| wheel.packages = ["llama_cpp"] | ||
| wheel.py-api = "py3" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option generates tags like py3-none-manylinux_2_34_x86_64.whl. |
||
| cmake.verbose = true | ||
| cmake.minimum-version = "3.21" | ||
| minimum-version = "0.5.1" | ||
|
|
@@ -91,3 +92,25 @@ ignore = ["E712"] | |
|
|
||
| [tool.pytest.ini_options] | ||
| testpaths = "tests" | ||
|
|
||
| [tool.cibuildwheel] | ||
| archs = ["auto64"] | ||
| # llama.cpp requires glibc 2.31+. manylinux_2_34 is the oldest manylinux image with glibc 2.31. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. INFO:auditwheel.wheel_abi:setting libc to glibc
llama_cpp_python-0.3.19-py3-none-linux_x86_64.whl is consistent with
the following platform tag: "linux_x86_64".
The wheel references external versioned symbols in these
system-provided shared libraries: libgcc_s.so.1 with versions
{'GCC_3.0', 'GCC_3.4'}, libm.so.6 with versions {'GLIBC_2.27',
'GLIBC_2.2.5'}, libstdc++.so.6 with versions {'GLIBCXX_3.4.17',
'CXXABI_1.3.8', 'CXXABI_1.3.5', 'GLIBCXX_3.4.19', 'CXXABI_1.3',
'GLIBCXX_3.4.18', 'GLIBCXX_3.4.25', 'CXXABI_1.3.11', 'GLIBCXX_3.4.22',
'GLIBCXX_3.4.9', 'GLIBCXX_3.4.14', 'GLIBCXX_3.4.21', 'GLIBCXX_3.4.15',
'CXXABI_1.3.2', 'CXXABI_1.3.9', 'GLIBCXX_3.4', 'GLIBCXX_3.4.20',
'GLIBCXX_3.4.11', 'CXXABI_1.3.3'}, libc.so.6 with versions
{'GLIBC_2.17', 'GLIBC_2.16', 'GLIBC_2.14', 'GLIBC_2.3', 'GLIBC_2.6',
'GLIBC_2.4', 'GLIBC_2.7', 'GLIBC_2.2.5'}, libpthread.so.0 with
versions {'GLIBC_2.3.4', 'GLIBC_2.2.5'}, libgomp.so.1 with versions
{'GOMP_1.0', 'GOMP_4.0', 'OMP_1.0'}, libdl.so.2 with versions
{'GLIBC_2.2.5'}
This constrains the platform tag to "manylinux_2_31_x86_64". In order
to achieve a more compatible tag, you would need to recompile a new
wheel from source on a system with earlier versions of these
libraries, such as a recent manylinux image.
INFO:auditwheel.main_repair:Repairing llama_cpp_python-0.3.19-py3-none-linux_x86_64.whl
usage: auditwheel [-h] [-V] [-v] command ...
auditwheel: error: cannot repair "/tmp/cibuildwheel/built_wheel/llama_cpp_python-0.3.19-py3-none-linux_x86_64.whl" to "manylinux_2_28_x86_64" ABI because of the presence of too-recent versioned symbols. You'll need to compile the wheel on an older toolchain. |
||
| # see all manylinux images here: https://github.com/pypa/manylinux | ||
| manylinux-x86_64-image = "manylinux_2_34" | ||
| manylinux-aarch64-image = "manylinux_2_34" | ||
| skip = "*musllinux*" # Segmentation fault occurs on musllinux python 3.10+ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Successfully installed MarkupSafe-3.0.3 annotated-doc-0.0.4 annotated-types-0.7.0 anyio-4.13.0 certifi-2026.2.25 click-8.3.1 diskcache-5.6.3 exceptiongroup-1.3.1 fastapi-0.135.2 filelock-3.25.2 fsspec-2026.2.0 h11-0.16.0 hf-xet-1.4.2 httpcore-1.0.9 httpx-0.28.1 huggingface-hub-1.8.0 idna-3.11 iniconfig-2.3.0 jinja2-3.1.6 llama-cpp-python-0.3.19 markdown-it-py-4.0.0 mdurl-0.1.2 numpy-2.2.6 packaging-26.0 pluggy-1.6.0 pydantic-2.12.5 pydantic-core-2.41.5 pydantic-settings-2.13.1 pygments-2.19.2 pytest-9.0.2 python-dotenv-1.2.2 pyyaml-6.0.3 rich-14.3.3 scipy-1.15.3 shellingham-1.5.4 sse-starlette-3.3.3 starlette-1.0.0 starlette-context-0.3.6 tomli-2.4.1 tqdm-4.67.3 typer-0.24.1 typing-extensions-4.15.0 typing-inspection-0.4.2
+ mkdir -p /tmp/tmp.ACiMCD/test_cwd
+ mkdir -p /tmp/tmp.ACiMCD/test_cwd/tests
+ mkdir -p /tmp/tmp.ACiMCD/test_cwd/vendor
+ sh -c 'pytest -v ./tests'
============================= test session starts ==============================
platform linux -- Python 3.10.19, pytest-9.0.2, pluggy-1.6.0 -- /tmp/tmp.ACiMCD/venv/bin/python
cachedir: .pytest_cache
rootdir: /tmp/tmp.ACiMCD/test_cwd
plugins: anyio-4.13.0
collecting ... collected 11 items
tests/test_llama.py::test_llama_cpp_version PASSED [ 9%]
tests/test_llama.py::test_llama_cpp_tokenization PASSED [ 18%]
tests/test_llama.py::test_real_model PASSED [ 27%]
Fatal Python error: Segmentation fault
Thread 0x00007fe9f04f6b30 (most recent call first):
File "/opt/python/cp310-cp310/lib/python3.10/threading.py", line 324 in wait
File "/opt/python/cp310-cp310/lib/python3.10/threading.py", line 607 in wait
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/tqdm/_monitor.py", line 60 in run
File "/opt/python/cp310-cp310/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
File "/opt/python/cp310-cp310/lib/python3.10/threading.py", line 973 in _bootstrap
Current thread 0x00007fea0c0bab28 (most recent call first):
Garbage-collecting
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/llama_cpp/_internals.py", line 273 in free_ctx
File "/opt/python/cp310-cp310/lib/python3.10/contextlib.py", line 449 in _exit_wrapper
File "/opt/python/cp310-cp310/lib/python3.10/contextlib.py", line 561 in __exit__
File "/opt/python/cp310-cp310/lib/python3.10/contextlib.py", line 584 in close
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/llama_cpp/_internals.py", line 279 in close
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/llama_cpp/_internals.py", line 282 in __del__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 721 in parse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 731 in parse_tuple
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1021 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 214 in parse_statements
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 260 in parse_if
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 177 in parse_statement
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1030 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 214 in parse_statements
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 260 in parse_if
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 177 in parse_statement
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1030 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 214 in parse_statements
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 248 in parse_for
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 177 in parse_statement
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1030 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 214 in parse_statements
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 260 in parse_if
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 177 in parse_statement
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1030 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 214 in parse_statements
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 447 in parse_macro
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 177 in parse_statement
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1030 in subparse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/parser.py", line 1047 in parse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/environment.py", line 622 in _parse
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/environment.py", line 763 in compile
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/jinja2/environment.py", line 1111 in from_string
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/llama_cpp/llama_chat_format.py", line 216 in __init__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/llama_cpp/llama.py", line 516 in __init__
File "/tmp/tmp.ACiMCD/test_cwd/tests/test_llama.py", line 135 in test_real_llama
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/python.py", line 166 in pytest_pyfunc_call
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121 in _multicall
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 512 in __call__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/python.py", line 1720 in runtest
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 179 in pytest_runtest_call
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121 in _multicall
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 512 in __call__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 245 in <lambda>
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 353 in from_call
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 244 in call_and_report
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 137 in runtestprotocol
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/runner.py", line 118 in pytest_runtest_protocol
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121 in _multicall
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 512 in __call__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/main.py", line 396 in pytest_runtestloop
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121 in _multicall
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 512 in __call__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/main.py", line 372 in _main
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/main.py", line 318 in wrap_session
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/main.py", line 365 in pytest_cmdline_main
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121 in _multicall
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 512 in __call__
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 199 in main
File "/tmp/tmp.ACiMCD/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 223 in console_main
File "/tmp/tmp.ACiMCD/venv/bin/pytest", line 6 in <module>
Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, scipy._lib._ccallback_c, scipy.special._ufuncs_cxx, scipy.special._ufuncs, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, scipy.special._specfun, scipy.special._comb, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg._matfuncs_expm, scipy.linalg._linalg_pythran, scipy.linalg.cython_blas, scipy.linalg._decomp_update, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.linalg._propack._spropack, scipy.sparse.linalg._propack._dpropack, scipy.sparse.linalg._propack._cpropack, scipy.sparse.linalg._propack._zpropack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.special._ellip_harm_2, yaml._yaml, markupsafe._speedups (total: 46)
/bin/bash: line 258: 1252 Segmentation fault (core dumped) env CIBUILDWHEEL=1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig HOSTNAME=168e6e417a38 LANGUAGE=en_US.UTF-8 AUDITWHEEL_POLICY=musllinux_1_2 AUDITWHEEL_ARCH=x86_64 *** HOME=/root LANG=en_US.UTF-8 SHLVL=1 LD_LIBRARY_PATH='' SSL_CERT_FILE=/opt/_internal/certs.pem AUDITWHEEL_PLAT=musllinux_1_2_x86_64 LC_ALL=en_US.UTF-8 PATH=/tmp/tmp.ACiMCD/venv/bin:/opt/python/cp310-cp310/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEVTOOLSET_ROOTPATH='' OLDPWD=/ _=/usr/bin/env PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_ROOT_USER_ACTION=ignore CMAKE_ARGS='-DGGML_NATIVE=off -DBUILD_SHARED_LIBS=OFF' VIRTUAL_ENV=/tmp/tmp.ACiMCD/venv sh -c 'pytest -v ./tests'
tests/test_llama.py::test_real_llama ::endgroup::Testing wheel... |
||
| test-sources = ["tests", "vendor"] | ||
| test-command = "pytest -v ./tests" | ||
| test-extras = ["test"] | ||
| test-skip = "*_riscv64" # riscv64 cannot install test packages (e.g. numpy, scipy, pydantic-core, hf-xet, etc.) | ||
|
|
||
| [tool.cibuildwheel.linux] | ||
| before-build = "command -v dnf && dnf install -y openssl-devel || (command -v apk && apk add --no-cache openssl-dev) || true" | ||
| repair-wheel-command = "auditwheel repair --exclude 'libcu*' -w {dest_dir} {wheel}" # don't bundle CUDA libraries | ||
|
|
||
| [tool.cibuildwheel.linux.environment] | ||
| CMAKE_ARGS = "-DGGML_NATIVE=OFF" | ||
|
|
||
| [tool.cibuildwheel.macos.environment] | ||
| CMAKE_ARGS = "-DGGML_NATIVE=OFF" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macos-15-intel failed to build, so it was excluded.
https://github.com/Bing-su/llama-cpp-python/actions/runs/23578504562/job/68656271494