Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion .github/workflows/publish-hf-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions scripts/prepare_hf_wheel_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ 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:",
"",
"```bash",
"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",
*[
Expand Down
Loading