diff --git a/.github/workflows/publish-hf-wheels.yml b/.github/workflows/publish-hf-wheels.yml index 4aaf4f4..f5f6be4 100644 --- a/.github/workflows/publish-hf-wheels.yml +++ b/.github/workflows/publish-hf-wheels.yml @@ -168,9 +168,71 @@ jobs: name: hf-wheel-${{ matrix.flavor }}-${{ matrix.arch }} path: wheelhouse/*.whl + build-cpu-wheels: + name: Linux ${{ matrix.arch }} CPU HF wheel + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + runner: ubuntu-22.04 + manylinux_platform: manylinux_2_35_x86_64 + build_jobs: "2" + - arch: aarch64 + runner: ubuntu-22.04-arm + manylinux_platform: manylinux_2_35_aarch64 + build_jobs: "2" + env: + QWENTTS_CPP_BACKEND: cpu + QWENTTS_CPP_BUILD_JOBS: ${{ matrix.build_jobs }} + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build tools + run: | + python -m pip install --upgrade pip auditwheel build wheel + sudo apt-get update + sudo apt-get install -y --no-install-recommends cmake ninja-build patchelf ca-certificates + + - name: Fetch qwentts.cpp + run: | + git clone --recursive https://github.com/ServeurpersoCom/qwentts.cpp third_party/qwentts.cpp + git -C third_party/qwentts.cpp checkout "$QWENTTS_REF" + git -C third_party/qwentts.cpp submodule update --init --recursive + + - name: Build wheel + run: | + python scripts/set_local_version.py cpu + python scripts/build_native.py \ + --source third_party/qwentts.cpp \ + --backend cpu \ + --clean \ + --cmake-arg=-G \ + --cmake-arg=Ninja + python -m build --wheel + mkdir -p wheelhouse + python -m auditwheel repair \ + --plat ${{ matrix.manylinux_platform }} \ + -w wheelhouse \ + dist/*.whl + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: hf-wheel-cpu-${{ matrix.arch }} + path: wheelhouse/*.whl + publish-hf: name: Publish HF wheel index - needs: build-wheels + needs: + - build-wheels + - build-cpu-wheels runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 diff --git a/AGENTS.md b/AGENTS.md index f757fcd..86562f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,12 +20,12 @@ The PR wheel workflow may still build CPU and CUDA 13 wheels as downloadable validation artifacts. Those artifacts are not uploaded to PyPI by the publish workflow. -Additional CUDA wheels can be published to Hugging Face Hub by +Additional backend-specific wheels can be published to Hugging Face Hub by `.github/workflows/publish-hf-wheels.yml`. That workflow builds local-version -variants such as `0.2.0+cu124`, `0.2.0+cu128`, and `0.2.0+cu130`, prepares -static `--find-links` pages, creates the public dataset repo if needed, and -uploads the wheel index using the `HF_TOKEN` repository secret. Do not upload -those local-version CUDA variants to PyPI. +variants such as `0.2.0+cpu`, `0.2.0+cu124`, `0.2.0+cu128`, and +`0.2.0+cu130`, prepares static `--find-links` pages, creates the public dataset +repo if needed, and uploads the wheel index using the `HF_TOKEN` repository +secret. Do not upload those local-version variants to PyPI. CUDA release wheels keep native cubins for sm_86, sm_90, and sm_120, plus PTX fallbacks for sm_75 and the newest supported CUDA architecture. This keeps the diff --git a/README.md b/README.md index 8a8b8b7..143f80b 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,14 @@ The default PyPI package is built for CUDA 12.8: pip install qwentts-cpp-python ``` -Additional CUDA wheels are published to Hugging Face Hub as local-version +Additional backend-specific wheels are published to Hugging Face Hub as local-version variants. Use them when the PyPI CUDA 12.8 wheel does not match the runtime or GPU target, for example DGX Spark / GB10 with CUDA 13: ```bash +pip install "qwentts-cpp-python==0.2.0+cpu" \ + -f https://huggingface.co/datasets/andimarafioti/qwentts-cpp-python-wheels/resolve/main/whl/cpu.html + pip install "qwentts-cpp-python==0.2.0+cu124" \ -f https://huggingface.co/datasets/andimarafioti/qwentts-cpp-python-wheels/resolve/main/whl/cu124.html diff --git a/scripts/prepare_hf_wheel_repo.py b/scripts/prepare_hf_wheel_repo.py index 03dd778..0ea2c6a 100644 --- a/scripts/prepare_hf_wheel_repo.py +++ b/scripts/prepare_hf_wheel_repo.py @@ -106,7 +106,7 @@ def main() -> int: "", "# qwentts-cpp-python wheels", "", - "Optional CUDA wheel variants for `qwentts-cpp-python`.", + "Optional backend-specific wheel variants for `qwentts-cpp-python`.", "", "The default PyPI package is CUDA 12.8:", "", @@ -114,7 +114,7 @@ def main() -> int: "pip install qwentts-cpp-python", "```", "", - "Install a CUDA-specific wheel from this repository with `--find-links`:", + "Install a backend-specific wheel from this repository with `--find-links`:", "", "```bash", *[