Skip to content

Release witwin 0.3.0 with Stable ABI CUDA wheels#2

Closed
Asixa wants to merge 6 commits into
mainfrom
codex/mesh-sdf-native-cuda
Closed

Release witwin 0.3.0 with Stable ABI CUDA wheels#2
Asixa wants to merge 6 commits into
mainfrom
codex/mesh-sdf-native-cuda

Conversation

@Asixa

@Asixa Asixa commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • release witwin core 0.3.0
  • add Stable ABI CUDA wheels for Windows and Linux
  • narrow shared geometry/material contracts for solver packages
  • add polygon primitives and dependency-contract coverage
  • route optional solver extras to current package names

Validation

  • C:\Users\Asixa\miniconda3\envs\witwin2\python.exe -m pytest tests -q (47 passed)
  • python -m build --sdist --no-isolation (built and verified witwin-0.3.0 metadata)

Publishing is triggered by the witwin-v0.3.0 GitHub Release after merge.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Asixa added 6 commits July 9, 2026 04:00
Replace smplpytorch's per-call forward with a batched LBS (~10x faster,
~2ms vs ~21ms) that is numerically equivalent, plus a Rodrigues that
offsets the axis-angle vector rather than its norm so the gradient at
exactly-zero pose stays finite. Cache SMPL faces per (gender, root,
device). Enables stable pose optimization starting from T-pose.
Copilot AI review requested due to automatic review settings July 15, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment on lines 86 to +248
@@ -99,7 +98,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
python-version: "3.10"

- name: Free disk space (Linux)
if: runner.os == 'Linux'
@@ -113,11 +112,11 @@ jobs:
echo "Disk after cleanup:"; df -h /

- name: Install CUDA Toolkit
uses: Jimver/cuda-toolkit@v0.2.29
uses: Jimver/cuda-toolkit@v0.2.35
with:
cuda: "12.5.0"
cuda: "12.8.1"
method: local
log-file-suffix: "${{ runner.os }}-py${{ matrix.python_version }}"
log-file-suffix: "${{ runner.os }}-stable-abi"

- name: Set up MSVC
if: runner.os == 'Windows'
@@ -149,41 +148,54 @@ jobs:
- name: Install CUDA extension build dependencies
run: |
python -m pip install --upgrade pip setuptools wheel ninja numpy
python -m pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu124
python -m pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
python -m pip install build

- name: Build packaged mesh SDF CUDA extension
- name: Build packaged stable mesh SDF CUDA extension
shell: bash
env:
MAX_JOBS: "2"
TORCH_CUDA_ARCH_LIST: "7.0;8.0;8.6;8.9;9.0+PTX"
WITWIN_CORE_MESH_SDF_CUDA_BUILD_DIR: ${{ runner.temp }}/witwin_core_mesh_sdf_cuda
WITWIN_CUDA_GENCODE_ARCHES: "7.0;7.5;8.0;8.6;8.9;9.0;10.0;10.1;12.0+PTX"
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
WITWIN_CORE_MESH_SDF_CUDA_BUILD_DIR: ${{ runner.temp }}/witwin_core_mesh_sdf_cuda/stable_abi_v1
run: |
python "$PACKAGE_DIR"/scripts/build_mesh_sdf_cuda_prebuilt.py --verbose

- name: Verify compiled CUDA architectures
shell: bash
env:
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
run: |
python "$PACKAGE_DIR"/scripts/verify_cuda_binary_arches.py \
--stem witwin_core_mesh_sdf_cuda \
"$PACKAGE_DIR"/witwin/core/geometry/cuda/prebuilt

- name: Build platform wheel
shell: bash
env:
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
run: |
python -m build --wheel "$PACKAGE_DIR"

- name: Normalize Linux wheel platform tag
- name: Repair Linux wheel platform tag
if: runner.os == 'Linux'
shell: bash
env:
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
run: |
# PyPI rejects the raw linux_x86_64 tag; the extension is built on the
# ubuntu-22.04 runner (glibc 2.35), so retag to the matching manylinux
# tag. torch/CUDA runtime libraries are runtime dependencies and stay
# unbundled, so no auditwheel repair is required.
shopt -s nullglob
python -m pip install auditwheel patchelf
mkdir -p "$PACKAGE_DIR"/wheelhouse
for whl in "$PACKAGE_DIR"/dist/*-linux_x86_64.whl; do
echo "Retagging $whl"
python -m wheel tags --platform-tag manylinux_2_35_x86_64 --remove "$whl"
python -m auditwheel repair "$whl" \
--plat manylinux_2_35_x86_64 \
--wheel-dir "$PACKAGE_DIR"/wheelhouse \
--exclude libc10.so --exclude libc10_cuda.so \
--exclude libtorch.so --exclude libtorch_cpu.so \
--exclude libtorch_cuda.so --exclude libtorch_python.so \
--exclude libcudart.so.12 --exclude libcuda.so.1
done
rm -f "$PACKAGE_DIR"/dist/*-linux_x86_64.whl
mv "$PACKAGE_DIR"/wheelhouse/*.whl "$PACKAGE_DIR"/dist/
ls -l "$PACKAGE_DIR"/dist

- name: Smoke install prebuilt wheel
@@ -197,9 +209,18 @@ jobs:
python -m pip install --no-deps "$PACKAGE_DIR"/dist/*.whl
python - <<'PY'
import importlib.util
import os
import site
import zipfile
from pathlib import Path

wheel = next((Path(os.environ["PACKAGE_DIR"]) / "dist").glob("*.whl"))
names = zipfile.ZipFile(wheel).namelist()
native = [name for name in names if "witwin_core_mesh_sdf_cuda" in name and name.endswith((".so", ".pyd"))]
assert len(native) == 1, native
assert "/prebuilt/" in f"/{native[0]}"
assert "torch_" not in native[0]

candidates = []
for root in site.getsitepackages() + [site.getusersitepackages()]:
candidates.append(Path(root) / "witwin" / "core" / "geometry" / "cuda" / "build.py")
@@ -212,17 +233,91 @@ jobs:

path = module.prebuilt_extension_path()
assert path.exists(), f"missing packaged prebuilt extension: {path}"
assert path.parent.name == "prebuilt"
extension = module.build_extension()
print(f"Loaded packaged mesh SDF CUDA extension from {extension.__file__}")
PY

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-py${{ matrix.python_version }}
name: wheel-${{ matrix.os }}
path: ${{ needs.validate_release.outputs.package_dir }}/dist/*.whl
if-no-files-found: error

test_torch_compatibility:
name: Stable ABI / ${{ matrix.os }} / py${{ matrix.compatibility.python_version }} / torch${{ matrix.compatibility.torch_version }}
needs:
- validate_release
- build_cuda_wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
compatibility:
- {python_version: "3.10", torch_version: "2.10.0", cuda_index: "cu128"}
- {python_version: "3.11", torch_version: "2.10.0", cuda_index: "cu128"}
- {python_version: "3.12", torch_version: "2.10.0", cuda_index: "cu128"}
- {python_version: "3.13", torch_version: "2.10.0", cuda_index: "cu128"}
- {python_version: "3.14", torch_version: "2.10.0", cuda_index: "cu128"}
- {python_version: "3.14", torch_version: "2.11.0", cuda_index: "cu128"}
- {python_version: "3.14", torch_version: "2.12.0", cuda_index: "cu126"}

steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.compatibility.python_version }}

- name: Download stable wheel
uses: actions/download-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: dist

- name: Install compatibility environment
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --no-cache-dir "torch==${{ matrix.compatibility.torch_version }}" \
--index-url "https://download.pytorch.org/whl/${{ matrix.compatibility.cuda_index }}"
python -m pip install --no-deps dist/*.whl

- name: Load the same stable binary
shell: bash
env:
EXPECTED_TORCH: ${{ matrix.compatibility.torch_version }}
@Asixa

Asixa commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of the requested direct main-branch release workflow.

@Asixa Asixa closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants