wheel: une roue par CPython 3.10 à 3.14 (uv), patchelf de PyPI pour auditwheel
build / build (push) Successful in 5m23s
build / build (push) Successful in 5m23s
Run 10 : les deux paquets Debian sortent ; auditwheel refusait le patchelf 0.14.3 d'Ubuntu (>= 0.14.5 requis). Et une seule roue cp310 ne servirait pas DGX OS (Python 3.12) : uv fournit chaque interpréteur.
This commit is contained in:
1 parent
6e859f1d40
commit
80aa37b21e
3 files changed
+29
-13
No files matched your search
@@ -39,7 +39,7 @@ Contrat des artefacts :
|
|||||||
|
|
||||||
| Artefact | Étiquette | Cible |
|
| Artefact | Étiquette | Cible |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `ctranslate2-4.6.3-cp3*-manylinux_2_35_aarch64.whl` | glibc ≥ 2.35 | Ubuntu 22.04, DGX OS / Ubuntu 24.04, JetPack 6 |
|
| `ctranslate2-4.6.3-cp3{10,11,12,13,14}-manylinux_2_35_aarch64.whl` | glibc ≥ 2.35 | Ubuntu 22.04, DGX OS / Ubuntu 24.04, JetPack 6 |
|
||||||
| `libctranslate2-4_4.6.3-1~cuda13_arm64.deb`, `libctranslate2-dev_…deb` | jammy, noble | idem |
|
| `libctranslate2-4_4.6.3-1~cuda13_arm64.deb`, `libctranslate2-dev_…deb` | jammy, noble | idem |
|
||||||
|
|
||||||
## Construction
|
## Construction
|
||||||
|
|||||||
@@ -66,24 +66,37 @@ etape_wheel() {
|
|||||||
ln -s "$TMP/include" "$STAGE/include"
|
ln -s "$TMP/include" "$STAGE/include"
|
||||||
ln -s "$TMP/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" "$STAGE/lib"
|
ln -s "$TMP/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" "$STAGE/lib"
|
||||||
|
|
||||||
|
# Outillage : uv fournit les CPython demandés (l'image n'a que le 3.10
|
||||||
|
# d'Ubuntu 22.04), patchelf de PyPI remplace le 0.14.3 d'Ubuntu, trop
|
||||||
|
# vieux pour auditwheel (>= 0.14.5).
|
||||||
python3 -m venv "$WORK/venv"
|
python3 -m venv "$WORK/venv"
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. "$WORK/venv/bin/activate"
|
. "$WORK/venv/bin/activate"
|
||||||
pip install -q -U pip setuptools wheel pybind11 auditwheel
|
pip install -q -U pip auditwheel patchelf uv
|
||||||
rm -rf "$WORK/wheel-raw"
|
export UV_PYTHON_INSTALL_DIR=$WORK/pythons
|
||||||
CTRANSLATE2_ROOT=$STAGE pip wheel -q --no-deps --no-build-isolation "$SRC/python" -w "$WORK/wheel-raw"
|
|
||||||
|
|
||||||
# Étiquette manylinux d'après la glibc de l'image (2.35 → manylinux_2_35).
|
# Étiquette manylinux d'après la glibc de l'image (2.35 → manylinux_2_35).
|
||||||
GLIBC=$(ldd --version | head -1 | grep -oE '[0-9]+\.[0-9]+$' | tr . _)
|
GLIBC=$(ldd --version | head -1 | grep -oE '[0-9]+\.[0-9]+$' | tr . _)
|
||||||
mkdir -p "$DIST"
|
mkdir -p "$DIST"
|
||||||
# Les bibliothèques CUDA ne sont PAS embarquées : CTranslate2 les charge
|
for py in $PYTHON_VERSIONS; do
|
||||||
# dynamiquement (CUDA_DYNAMIC_LOADING) depuis le toolkit ou les paquets
|
log "roue pour CPython $py"
|
||||||
# pip nvidia-*. Seules libctranslate2 et OpenBLAS entrent dans la roue.
|
uv venv -q --python "$py" "$WORK/venv-$py"
|
||||||
LD_LIBRARY_PATH=$STAGE/lib auditwheel repair \
|
uv pip install -q --python "$WORK/venv-$py/bin/python" setuptools wheel pybind11
|
||||||
--plat "manylinux_${GLIBC}_aarch64" \
|
rm -rf "$WORK/wheel-raw-$py"
|
||||||
--exclude 'libcuda.so.1' --exclude 'libcublas*' --exclude 'libcublasLt*' \
|
CTRANSLATE2_ROOT=$STAGE "$WORK/venv-$py/bin/python" -m pip wheel -q --no-deps --no-build-isolation \
|
||||||
--exclude 'libcudnn*' --exclude 'libcudart*' \
|
"$SRC/python" -w "$WORK/wheel-raw-$py" 2>/dev/null \
|
||||||
-w "$DIST" "$WORK"/wheel-raw/*.whl
|
|| { uv pip install -q --python "$WORK/venv-$py/bin/python" pip \
|
||||||
|
&& CTRANSLATE2_ROOT=$STAGE "$WORK/venv-$py/bin/python" -m pip wheel -q --no-deps --no-build-isolation \
|
||||||
|
"$SRC/python" -w "$WORK/wheel-raw-$py"; }
|
||||||
|
# Les bibliothèques CUDA ne sont PAS embarquées : CTranslate2 les charge
|
||||||
|
# dynamiquement (CUDA_DYNAMIC_LOADING) depuis le toolkit ou les paquets
|
||||||
|
# pip nvidia-*. Seules libctranslate2 et OpenBLAS entrent dans la roue.
|
||||||
|
LD_LIBRARY_PATH=$STAGE/lib auditwheel repair \
|
||||||
|
--plat "manylinux_${GLIBC}_aarch64" \
|
||||||
|
--exclude 'libcuda.so.1' --exclude 'libcublas*' --exclude 'libcublasLt*' \
|
||||||
|
--exclude 'libcudnn*' --exclude 'libcudart*' \
|
||||||
|
-w "$DIST" "$WORK/wheel-raw-$py"/*.whl
|
||||||
|
done
|
||||||
ls -la "$DIST"/*.whl
|
ls -la "$DIST"/*.whl
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +104,7 @@ etape_check() {
|
|||||||
log "contrôles sans GPU"
|
log "contrôles sans GPU"
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. "$WORK/venv/bin/activate"
|
. "$WORK/venv/bin/activate"
|
||||||
pip install -q "$DIST"/ctranslate2-*.whl numpy pyyaml
|
pip install -q "$DIST"/ctranslate2-*-cp310-*.whl numpy pyyaml
|
||||||
python3 - <<'PY'
|
python3 - <<'PY'
|
||||||
import ctranslate2, subprocess, glob, os
|
import ctranslate2, subprocess, glob, os
|
||||||
print("ctranslate2", ctranslate2.__version__)
|
print("ctranslate2", ctranslate2.__version__)
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ CUDA_IMAGE=nvidia/cuda:13.0.1-cudnn-devel-ubuntu22.04
|
|||||||
# CTranslate2 ajoute les siens à la suite (list(APPEND CUDA_NVCC_FLAGS)).
|
# CTranslate2 ajoute les siens à la suite (list(APPEND CUDA_NVCC_FLAGS)).
|
||||||
CUDA_ARCH_LIST="8.7;9.0"
|
CUDA_ARCH_LIST="8.7;9.0"
|
||||||
CUDA_NVCC_EXTRA="-gencode;arch=compute_121,code=[sm_121,compute_121]"
|
CUDA_NVCC_EXTRA="-gencode;arch=compute_121,code=[sm_121,compute_121]"
|
||||||
|
# CPython visés par les roues (uv les télécharge) : 3.10 (Ubuntu 22.04),
|
||||||
|
# 3.12 (DGX OS / Ubuntu 24.04), et les intermédiaires/suivants des venv uv.
|
||||||
|
PYTHON_VERSIONS="3.10 3.11 3.12 3.13 3.14"
|
||||||
Reference in new issue
Block a user