Skip to content

Fix CUDA CI runtime for Python 3.14t and stable PyTorch 2.15 - #5103

Merged
Qubitium merged 2 commits into
mainfrom
fix/ci-py314t-torch215-stable
Nov 18, 2026
Merged

Qubitium merged 2 commits into
mainfrom
fix/ci-py314t-torch215-stable

Conversation

@ZX-ModelCloud

@ZX-ModelCloud ZX-ModelCloud commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The source-release install in run 44224550990 used the old CUDA 13.0 runtime and cu130 wheel index, which cannot satisfy the current Torch requirement. Publication gates used !cancelled() and could run after installation failed.

Unify the affected CUDA unit, source-release, and setuptools lanes on CPython 3.14.10t with GIL=0, stable PyTorch 2.15.0+cu132, and a digest-pinned public CUDA 13.2.1 image. Require a successful clean-environment installation before publication. The new validation workflow can test the sdist without publication credentials.

What Changed

25 files, +646/-444 lines.

Area Files / scope Purpose
Runtime setup-ci-runtime action, Dockerfile, uv/Rust bootstrap, constraints Own the interpreter and tooling in the repository; remove runner-mounted executable bootstrap. Pin uv 0.13.8 and Rust 1.94.0 with verified bootstrap checksums.
Workflows release, unit tests/reusable, setuptools reusable, ci_runtime Pin free-threaded Python and Torch; preserve CPU/multi-GPU cases and data-only caches. Remove obsolete safety bypass.
Validation/publication ci_assert_free_threaded.py, ci_release_test_install.sh, release-source-common Check runtime versions, GIL before/after imports, installed module origins, and dependency consistency. Publish only the tested sdist after successful installation and explicit opt-in.
Tests/docs two CI test files, docs/ci-runtime.md, GIL ledger, README Pin wiring and failure propagation; document migration and limits.

TorchAO is pinned to the public 0.18.0 universal wheel by URL and SHA256 because the CUDA-index abi3 wheel is incompatible with cp314t. NVFP4 Python imports are checked; native TorchAO GPU operators remain unqualified here. Python is pinned to the current stable patch for reproducibility; future patches require updating the pin and assertion together.

Tests

  • Affected unit tests executed and passed.
  • Added fast CI regression coverage, including executable installer failure injection and checking its next consumer is not reached after failure.
Invariant / trigger Evidence
Old runtime and failed-install publication gates Pre-fix CI regression run: 4 intended assertion failures (old release image, fail-open publication, old unit image, absent validation workflow), 4 passes, 1 ordinary-interpreter skip. The absent-workflow assertion is wiring evidence, not an executed GitHub failure path.
Stable Torch resolves on the selected backend Exact Torch 2.15.0 fails resolution on cu130; cu132 resolves. Full cp314t requirements fail on TorchAO abi3 without the constraint; with the universal-wheel constraint, 82 dependencies resolve.
Resolver failure stops the installer test_install_smoke_uses_the_pinned_backend_and_propagates_resolver_failures[37] verifies exit-code propagation and that dependency/import checks are not called after failure.
Final CI and documentation contracts 36 passed, 0 skipped on CPython 3.14.10t/GIL=0, 13.14 seconds.
CPU concurrency and checkpoint regression families 65 passed, 0 skipped, 33.71 seconds on the same free-threaded runtime.
Actual container sdist consumer CUDA 13.2.1 container without GPU: build + twine check + clean installation + dependency check + isolated installed imports all passed. 83 packages installed; safetensors and pypcre built from source inside the container.

Exact commands used (temporary paths identify the isolated local environments):

# Final publishing checkout: 36 passed, no skips
PYTHON_GIL=0 /tmp/gptqmodel-ci-installed-t2/bin/python -m pytest --noconftest tests/test_ci_release_runtime.py tests/test_ci_free_threaded_lane.py tests/test_docs_contract_refs.py -q -rs

# Implementation checkout: 65 passed, no skips
PYTHON_GIL=0 CUDA_VISIBLE_DEVICES= PYTHONPATH=/tmp/gptqmodel-ci-runtime-fix timeout 120 /tmp/gptqmodel-ci-installed-t2/bin/python -m pytest tests/test_threadx_cpu_locks.py tests/test_threadx_shutdown.py tests/test_looper_concurrency.py tests/test_checkpoint_store.py -q -rs --durations=4

PATH=/tmp/gptqmodel-ci-tools/bin:$PATH bash format/check.sh
/tmp/gptqmodel-actionlint/actionlint -config-file /tmp/gptqmodel-actionlint/config.yml .github/workflows/ci_runtime.yml .github/workflows/release.yml .github/workflows/unit_tests.yml .github/workflows/unit_tests_reusable.yml .github/workflows/setuptools_compatibility_reusable.yml
git diff --check

# Actual Docker smoke, using only local artifacts and package downloads
DOCKER_CONFIG=/tmp/gptqmodel-ci-docker-config docker build --network=host --platform linux/amd64 -f .github/ci/Dockerfile -t gptqmodel-ci-local:cu132 .
DOCKER_CONFIG=/tmp/gptqmodel-ci-docker-config docker run --rm --runtime=runc --network=host \
  --name gptqmodel-ci-validate-cu132 -e PYTHON_GIL=0 -e UV_CACHE_DIR=/ci-cache \
  -v /tmp/gptqmodel-ci-runtime-fix:/checkout:ro -v /tmp/gptqmodel-ci-cache:/ci-cache \
  gptqmodel-ci-local:cu132 bash -euc '
    cp -a /checkout/. /workspace/
    uv venv --managed-python --python 3.14.10t /tmp/build-venv
    source /tmp/build-venv/bin/activate
    python .github/scripts/ci_assert_free_threaded.py --python-only
    export GITHUB_ENV=/tmp/release-env
    bash .github/scripts/ci_release_build_sdist.sh
    bash .github/scripts/ci_release_check_dist.sh
    source "$GITHUB_ENV"
    bash .github/scripts/ci_release_test_install.sh "$PKG_NAME"
  '

actionlint 1.7.12 used a local config declaring the existing xeon5 runner label. Bash syntax checks and Ruff checks of the changed Python scripts also passed. The setuptools pip path was dry-run checked with the same constraints; a full fresh pip/setuptools matrix was not executed locally.

The lightweight PR workflow intentionally deselects the full model-stack import test; the local full run and manual sdist smoke include that check. Triton emits nanobind reference-leak diagnostics at interpreter shutdown, as recorded in the existing GIL ledger; successful exit status is not a claim that those upstream leaks are fixed.

Model Support / Module Plan

Not applicable: no model registration, aliases, definitions, module plans, or fusion support changed.

AWQ onboarding safety

Not applicable: no AWQ grouping, replay, folding, or model onboarding changed.

Logic Flow Documentation

  • Included old/new flows, publication lifecycle, and before/after failure contracts.
  • Diagrams name the shipped actions/scripts and distinguish failure paths.
  • The same diagrams are in docs/ci-runtime.md, linked from README.md.
Situation Before Current
Select the toolkit and interpreter The CUDA 13.0 image depended on runner-mounted Python and uv bootstrap scripts. The release resolver could report 3.14t while uv still selected ordinary Python 3.14. The workflows pin the public CUDA image digest and use the repository's setup-ci-runtime action to create and verify the exact managed interpreter.
Resolve PyTorch The cu130 wheel index stopped below the package's torch>=2.15.0 requirement on Python 3.14. The unit matrix pinned an older Torch and bypassed the safety gate. torch-cu132.txt constrains Torch to 2.15.0+cu132 and uv selects the cu132 backend explicitly. The normal Torch safety gate applies.
Install TorchAO The default CUDA TorchAO wheel uses an ABI tag that free-threaded CPython 3.14 cannot load. The old compatibility check installed a private wheel. The CI constraints select the public TorchAO 0.18.0 universal wheel by URL and hash. The smoke checks the NVFP4 Python imports. Native TorchAO operators require separate GPU validation.
Publish after installation fails The shared action used !cancelled() for release upload and PyPI steps, so a failed install could still reach publication. Release upload and PyPI confirmation and upload require a successful install step, an overall successful job, an explicit publication opt-in, and the corresponding release event or manual request.
Exercise free-threading Only the dedicated concurrency job forced the GIL off. Both release jobs and all CUDA unit jobs force it off before the model stack loads. The dedicated lane retains its CPU and multi-GPU concurrency cases.
flowchart TD
    A["Old release-source job"] --> B["CUDA 13.0 image and host bootstrap"]
    B --> C["Build and check source distribution"]
    C --> D["Install with cu130"]
    D -->|Resolution failure| E["Job fails"]
    D -->|Success| F["Check publication event"]
    E -->|Job not cancelled| F
    F --> G["Release upload or PyPI confirmation and upload"]
    classDef failed fill:#fee2e2,stroke:#b91c1c,color:#111827
    class E failed
Loading
flowchart TD
    A["Release or CI runtime validation"] --> B["setup-ci-runtime verifies CPython 3.14.10t and GIL=0"]
    B --> C["release-source-common builds and checks the sdist"]
    C --> D["ci_release_test_install.sh installs into a fresh venv"]
    D --> E["ci_assert_free_threaded.py checks installed imports"]
    D -->|Install or dependency failure| H["Job fails"]
    E -->|Version, origin, or GIL mismatch| H
    E -->|Success| F["Upload workflow artifact"]
    F --> G{"Publication enabled and requested?"}
    G -->|Yes| I["Release asset or confirmed PyPI upload"]
    G -->|No| J["Validation complete"]
    classDef failed fill:#fee2e2,stroke:#b91c1c,color:#111827
    class H failed
Loading

The publication lifecycle is owned by
.github/actions/release-source-common/action.yml:60 (installation) and
:81 (publication gates). The previous !cancelled() gates at lines 77,
85, and 92 of the base version admitted a failed installation.

stateDiagram-v2
    [*] --> Validating
    Validating --> Blocked: Build, check, install, or import fails
    Validating --> Validated: All validation succeeds
    Validated --> Complete: Publication disabled or not requested
    Validated --> Publishing: Publication enabled and requested
    Publishing --> Complete: Requested upload succeeds
    Publishing --> Blocked: Confirmation or upload fails
    Blocked --> [*]
    Complete --> [*]
Loading

Review Requirements

  • Reviewed the final diff and runtime/publication consumers.
  • Checked repository conventions and normal extension points.
  • Avoided monkeypatches.
  • Removed obsolete bootstrap paths while retaining runner data/cache mounts and GPU allocation.
  • Tested regression paths; remaining hardware gaps are explicit below.

Opened as a draft. Readiness requires checking the exact pushed head against the current remote main; merging is not part of this change.

Kernel Accuracy Requirements

Not applicable to code changes: no quantization math or kernel implementation changed. GPU execution, NVIDIA driver compatibility, multi-GPU streams/P2P, and native TorchAO GPU operators remain unverified because this device has no GPU. CPU tests and installation smoke are not native GPU qualification.

Notes

No PyPI upload/deletion, release creation, container-image publication, or release-workflow dispatch was performed. The tested artifact is a locally built source distribution; this does not retroactively certify the previously published PyPI release.

Self-hosted jobs now download the public image and provision runtime tools from the checkout. GPU CI must validate the image against runner drivers. Existing model/dataset mounts and GPU allocation remain required. ROCm and other backends are outside this CUDA CI change.

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.

2 participants