Skip to content

Commit 35dbf78

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/main' into origin→work_around_orin_nvml_field_values_bug
# Conflicts: # cuda_bindings_13/tests/nvml/test_field_values.py
2 parents 77925c0 + 585038d commit 35dbf78

300 files changed

Lines changed: 840 additions & 236 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.coderabbit.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ reviews:
6565
custom_checks: []
6666

6767
path_instructions:
68-
- path: "cuda_bindings/**/*"
68+
- path: "cuda_bindings_13/**/*"
6969
instructions: |
7070
Focus on Cython binding correctness, API and ABI stability, error-code propagation,
7171
resource ownership and reference counting, GIL handling, cross-platform behavior.
@@ -122,23 +122,23 @@ knowledge_base:
122122
filePatterns:
123123
- "AGENTS.md"
124124
- "CONTRIBUTING.md"
125-
- "cuda_bindings/AGENTS.md"
125+
- "cuda_bindings_13/AGENTS.md"
126126
- "cuda_core/AGENTS.md"
127127
- "cuda_core/tests/AGENTS.md"
128128
- "cuda_pathfinder/AGENTS.md"
129129
- "cuda_python/AGENTS.md"
130130
- "benchmarks/cuda_bindings/AGENTS.md"
131131
- "benchmarks/cuda_core/AGENTS.md"
132-
- "cuda_bindings/README.md"
132+
- "cuda_bindings_13/README.md"
133133
- "cuda_core/README.md"
134134
- "cuda_pathfinder/DESCRIPTION.rst"
135135
- "cuda_python/DESCRIPTION.rst"
136-
- "cuda_bindings/docs/source/contribute.rst"
136+
- "cuda_bindings_13/docs/source/contribute.rst"
137137
- "cuda_core/docs/source/contribute.rst"
138138
- "cuda_core/docs/source/concurrency.rst"
139139
- "cuda_core/docs/source/error_handling.rst"
140140
- "cuda_pathfinder/docs/source/contribute.rst"
141-
- "cuda_bindings/docs/source/release.rst"
141+
- "cuda_bindings_13/docs/source/release.rst"
142142
- "cuda_core/docs/source/release.rst"
143143
- "cuda_pathfinder/docs/source/release.rst"
144144
- "cuda_python/docs/source/release.rst"

‎.github/actions/lychee-links/action.yml‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ runs:
6969
KIND: ${{ inputs.kind }}
7070
# Anything that can change a check result or the cache's meaning. The
7171
# hook configuration carries the native wheel pin and every hook option.
72-
POLICY_HASH: ${{ hashFiles('.pre-commit-config.yaml', 'lychee.toml', 'ci/tools/run_lychee.py', 'ci/tools/run_lychee_precommit.py', 'ci/tools/retry_lychee.py') }}
72+
POLICY_HASH: ${{ hashFiles('.pre-commit-config.yaml', 'lychee.toml', 'ci/tools/run_lychee.py', 'ci/tools/run_lychee_precommit.py', 'ci/tools/retry_lychee.py', 'ci/tools/checkout_source_links.py') }}
7373
run: |
7474
# Authored and rendered results stay apart: only rendered checks validate
7575
# fragments, and Lychee's cache does not record which validation ran.
@@ -84,6 +84,7 @@ runs:
8484
echo "key=${prefix}${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "${GITHUB_OUTPUT}"
8585
8686
- name: Restore successful link checks
87+
id: cache-restore
8788
# Refresh mode deliberately skips earlier URL results.
8889
if: ${{ inputs.refresh != 'true' }}
8990
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -93,6 +94,25 @@ runs:
9394
restore-keys: ${{ steps.cache.outputs.prefix }}
9495
enableCrossOsArchive: true
9596

97+
- name: Explain a missing shared Lychee cache
98+
# Prefix restores are normal; cache-hit only identifies exact key matches.
99+
if: ${{ inputs.refresh != 'true' && steps.cache-restore.outputs.cache-matched-key == '' }}
100+
shell: bash --noprofile --norc -euo pipefail {0}
101+
env:
102+
KIND: ${{ inputs.kind }}
103+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
104+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/workflows/lychee.yml
105+
run: |
106+
message="No shared Lychee ${KIND} cache was restored for this checker configuration. Checking links without this baseline may take longer and make more network requests."
107+
context="This is expected after checker changes in a PR; a refresh on ${DEFAULT_BRANCH} cannot seed settings that exist only in a PR."
108+
hint="For an unexpected miss on ${DEFAULT_BRANCH}, maintainers can run CI: Lychee checks and caches (lychee.yml) on ${DEFAULT_BRANCH} with refresh-cache enabled."
109+
echo "::notice title=Lychee ${KIND} cache::${message} ${context} ${hint} ${WORKFLOW_URL}"
110+
{
111+
printf '### Lychee %s cache\n\n' "$KIND"
112+
printf '%s\n\n%s\n\n%s\n\n' "$message" "$context" "$hint"
113+
printf '[Open the cache refresh workflow](%s).\n' "$WORKFLOW_URL"
114+
} >> "$GITHUB_STEP_SUMMARY"
115+
96116
- name: Check links through the configured pre-commit hook
97117
shell: bash --noprofile --norc -euo pipefail {0}
98118
env:
@@ -107,7 +127,7 @@ runs:
107127
--report "${RUNNER_TEMP}/lychee-reports/lychee-${KIND}.json"
108128
109129
- name: Publish fresh successful link checks
110-
# Only nightly refreshes publish, so every pull request restores the same
130+
# Only refresh runs publish, so every pull request restores the same
111131
# baseline. Saving keeps original timestamps and never caches failures.
112132
if: ${{ !cancelled() && inputs.refresh == 'true' }}
113133
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0

‎.github/labeler.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cuda.bindings:
99
- changed-files:
1010
- any-glob-to-any-file:
11-
- 'cuda_bindings/**'
11+
- 'cuda_bindings_13/**'
1212
- 'samples/cuda_bindings/**'
1313

1414
cuda.core:

‎.github/workflows/build-docs.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ jobs:
110110
PYTHON_VERSION_FORMATTED="312" # see above
111111
REPO_DIR=$(pwd)
112112
113+
# Release docs may check out tags from before the source-root rename.
114+
if [[ -d cuda_bindings_13 ]]; then
115+
CUDA_BINDINGS_SOURCE_DIR=cuda_bindings_13
116+
elif [[ -d cuda_bindings ]]; then
117+
CUDA_BINDINGS_SOURCE_DIR=cuda_bindings
118+
else
119+
echo "error: cannot find the cuda.bindings source directory" >&2
120+
exit 1
121+
fi
122+
echo "CUDA_BINDINGS_SOURCE_DIR=${CUDA_BINDINGS_SOURCE_DIR}" >> "$GITHUB_ENV"
123+
113124
if [[ ${{ inputs.is-release }} == "true" ]]; then
114125
FILE_HASH="*"
115126
DOCS_GITHUB_REF="${{ inputs.git-tag }}"
@@ -118,7 +129,7 @@ jobs:
118129
fi
119130
else
120131
FILE_HASH="${{ github.sha }}"
121-
DOCS_GITHUB_REF="${{ github.sha }}"
132+
DOCS_GITHUB_REF=$(python ci/tools/checkout_source_links.py --github-ref)
122133
fi
123134
124135
# make outputs from the previous job as env vars
@@ -130,7 +141,7 @@ jobs:
130141
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64"
131142
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
132143
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
133-
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
144+
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/$CUDA_BINDINGS_SOURCE_DIR/dist")" >> $GITHUB_ENV
134145
135146
- name: Download cuda-python build artifacts
136147
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
@@ -262,6 +273,9 @@ jobs:
262273
if: ${{ inputs.component != 'all' }}
263274
run: |
264275
COMPONENT=$(echo "${{ inputs.component }}" | tr '-' '_')
276+
if [[ "${{ inputs.component }}" == "cuda-bindings" ]]; then
277+
COMPONENT="${CUDA_BINDINGS_SOURCE_DIR}"
278+
fi
265279
pushd ${COMPONENT}/docs/
266280
if [[ "${{ inputs.is-release }}" == "false" ]]; then
267281
./build_docs.sh latest-only

‎.github/workflows/build-wheel.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229
if: ${{ env.BUILD_BINDINGS == 'true' }}
230230
uses: pypa/cibuildwheel@b3395e271a35f73dad77f21802abe9b986dfe299 # v4.3.1
231231
with:
232-
package-dir: ./cuda_bindings/
232+
package-dir: ./cuda_bindings_13/
233233
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
234234
extras: uv
235235
env:
@@ -476,7 +476,7 @@ jobs:
476476
- name: Build cuda.bindings Cython tests
477477
if: ${{ env.TEST_BINDINGS == 'true' }}
478478
run: |
479-
pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test
479+
pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings_13/pyproject.toml:test
480480
pushd ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}
481481
bash build_tests.sh
482482
popd
@@ -565,7 +565,7 @@ jobs:
565565
--branch "${OLD_BRANCH}" \
566566
--artifact "${OLD_ARTIFACT_PATTERN}" \
567567
NVIDIA/cuda-python "CI")
568-
PREV_BINDINGS_DIR="cuda_bindings/dist-prev"
568+
PREV_BINDINGS_DIR="cuda_bindings_13/dist-prev"
569569
570570
gh run download \
571571
"${LATEST_PRIOR_RUN_ID}" \
@@ -582,7 +582,7 @@ jobs:
582582
if: ${{ !inputs.single-cuda-major && env.BUILD_CORE == 'true' }}
583583
run: |
584584
pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl)
585-
bindings_wheels=(cuda_bindings/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl)
585+
bindings_wheels=(cuda_bindings_13/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl)
586586
test "${#pathfinder_wheels[@]}" -eq 1
587587
test "${#bindings_wheels[@]}" -eq 1
588588
test -f "${pathfinder_wheels[0]}"

‎.github/workflows/ci-pixi-source-test.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ on:
4141
# Path-dependency metadata (including cuda_python_test_helpers) feeds the
4242
# solve, so it can break the source build without a pixi.toml edit.
4343
- "**/pyproject.toml"
44-
- "cuda_bindings/build_hooks.py"
44+
- "cuda_bindings_13/build_hooks.py"
4545
- "cuda_core/build_hooks.py"
46-
- "cuda_bindings/cuda/bindings/**" # generated bindings sources
47-
- "cuda_bindings/tests/cython/**"
46+
- "cuda_bindings_13/cuda/bindings/**" # generated bindings sources
47+
- "cuda_bindings_13/tests/cython/**"
4848
- "cuda_core/tests/cython/**"
4949
- "ci/versions.yml"
5050
- "ci/pixi-version.env"
@@ -103,16 +103,16 @@ jobs:
103103
104104
# bindings + core: force the source build (catches nvrtc/driver
105105
# compile errors like #2182) and import them (catches ABI mismatches).
106-
pixi run --manifest-path cuda_bindings -e "${CUDA_ENV}" \
106+
pixi run --manifest-path cuda_bindings_13 -e "${CUDA_ENV}" \
107107
python -c "import cuda.bindings.driver, cuda.bindings.nvrtc, cuda.bindings.runtime; print('bindings import OK')"
108108
pixi run --manifest-path cuda_core -e "${CUDA_ENV}" \
109109
python -c "import cuda.core; print('core import OK')"
110110
111111
# cython test extensions: build them and confirm each .so landed next
112112
# to its .pyx in tests/cython (catches the placement regression #2180).
113-
pixi run --manifest-path cuda_bindings -e "${CUDA_ENV}" build-cython-tests
113+
pixi run --manifest-path cuda_bindings_13 -e "${CUDA_ENV}" build-cython-tests
114114
pixi run --manifest-path cuda_core -e "${CUDA_ENV}" build-cython-tests
115-
for d in cuda_bindings/tests/cython cuda_core/tests/cython; do
115+
for d in cuda_bindings_13/tests/cython cuda_core/tests/cython; do
116116
if ! compgen -G "${d}/*.cpython-*.so" > /dev/null; then
117117
echo "::error::no compiled cython test .so in ${d} (placement regression)"
118118
exit 1
@@ -131,7 +131,7 @@ jobs:
131131
# The round trip (not just cu13 -> cu12) is what catches the second half:
132132
# coming back to cu13 must not silently reuse the cu12 extension.
133133
#
134-
# cuda_core only: cuda_bindings cannot be source-built in its cu12
134+
# cuda_core only: cuda_bindings_13 cannot be source-built in its cu12
135135
# environment at all, for reasons unrelated to stale artifacts.
136136
build-identity-roundtrip:
137137
name: "cu13 -> cu12 -> cu13 round trip (linux-64, CPU)"

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ jobs:
122122
#
123123
# Dependency graph (verified in pyproject.toml files):
124124
# cuda_pathfinder -> (no internal deps)
125-
# cuda_bindings -> cuda_pathfinder
126-
# cuda_core -> cuda_pathfinder, cuda_bindings
127-
# cuda_python -> cuda_pathfinder, cuda_bindings, cuda_core (meta package)
125+
# cuda_bindings_13 -> cuda_pathfinder
126+
# cuda_core -> cuda_pathfinder, cuda_bindings_13
127+
# cuda_python -> cuda_pathfinder, cuda_bindings_13, cuda_core (meta package)
128128
#
129129
# A change to cuda_pathfinder (or shared infra) forces a rebuild of every
130-
# downstream module. A change to cuda_bindings forces rebuild of cuda_core.
131-
# A change to cuda_core alone skips rebuilding/retesting cuda_bindings and
130+
# downstream module. A change to cuda_bindings_13 forces rebuild of cuda_core.
131+
# A change to cuda_core alone skips rebuilding/retesting cuda_bindings_13 and
132132
# cuda_pathfinder, but still retests the downstream cuda-python metapackage.
133133
# Shared build/orchestration changes run the full pipeline; test-only CI
134134
# infrastructure runs every test suite without rebuilding package wheels.
@@ -477,7 +477,7 @@ jobs:
477477
python-versions: ${{ needs.ci-vars.outputs.PYTHON_SUPPORTED }}
478478

479479
# NOTE: test-sdist jobs are split by platform (mirroring build-* and test-wheel-*)
480-
# so platform-specific sources (e.g. cuda_bindings/*_windows.pyx selected by
480+
# so platform-specific sources (e.g. cuda_bindings_13/*_windows.pyx selected by
481481
# build_hooks.py) are exercised on their target OS. Keep these job definitions
482482
# textually identical except for:
483483
# - host-platform value

‎.github/workflows/coverage.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ jobs:
142142
run: |
143143
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-bindings.txt"
144144
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
145-
.venv/bin/pip wheel -v --no-deps ./cuda_bindings -w ./wheels/
146-
.venv/bin/pip install -v ./wheels/cuda_bindings*.whl --group ./cuda_bindings/pyproject.toml:test
145+
.venv/bin/pip wheel -v --no-deps ./cuda_bindings_13 -w ./wheels/
146+
.venv/bin/pip install -v ./wheels/cuda_bindings*.whl --group ./cuda_bindings_13/pyproject.toml:test
147147
148148
- name: Constrain cuda-core to the local cuda-bindings wheel
149149
run: |
@@ -188,7 +188,7 @@ jobs:
188188
continue-on-error: true
189189
run: |
190190
cd $INSTALL_ROOT
191-
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-context=test --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_bindings/tests
191+
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-context=test --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_bindings_13/tests
192192
193193
- name: Run cuda.core tests
194194
continue-on-error: true
@@ -284,7 +284,7 @@ jobs:
284284
run: |
285285
export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-bindings.txt")"
286286
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
287-
cd cuda_bindings
287+
cd cuda_bindings_13
288288
../.venv/Scripts/pip wheel -v --no-deps . -w ../wheels/
289289
290290
- name: Constrain cuda.core to the local cuda.bindings wheel
@@ -423,7 +423,7 @@ jobs:
423423
run: |
424424
.venv/Scripts/pip install coverage pytest-cov Cython
425425
.venv/Scripts/pip install --group ./cuda_pathfinder/pyproject.toml:test
426-
.venv/Scripts/pip install --group ./cuda_bindings/pyproject.toml:test
426+
.venv/Scripts/pip install --group ./cuda_bindings_13/pyproject.toml:test
427427
.venv/Scripts/pip install --group ./cuda_core/pyproject.toml:test
428428
429429
- name: Get install root
@@ -448,7 +448,7 @@ jobs:
448448
--cwd "${{ steps.install-root.outputs.INSTALL_ROOT }}" \
449449
-v --cov=./cuda --cov-append --cov-context=test \
450450
--cov-config="$GITHUB_WORKSPACE/.coveragerc" \
451-
"$GITHUB_WORKSPACE/cuda_bindings/tests"
451+
"$GITHUB_WORKSPACE/cuda_bindings_13/tests"
452452
453453
- name: Run cuda.core tests (with 8MB stack)
454454
continue-on-error: true

‎.github/workflows/lychee.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
# Warm authored and rendered link caches through the configured pre-commit
66
# hooks. Ordinary PRs reuse authored results; full docs CI reuses rendered
7-
# results. Nightly starts afresh, reports unresolved links as warnings, and is
8-
# the only producer of both shared baselines.
7+
# results. Nightly and manual dispatches with refresh-cache=true start afresh,
8+
# report unresolved links as warnings, and can produce both shared baselines.
99

10-
name: "CI: Documentation links"
10+
name: "CI: Lychee checks and caches"
1111

1212
on:
1313
workflow_call:

‎.github/workflows/test-sdist-linux.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
host-platform: ${{ inputs.host-platform }}
110110
cuda-version: ${{ inputs.cuda-version }}
111111

112-
# cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH
112+
# cuda_bindings_13/setup.py parses CUDA headers at import time, so CUDA_PATH
113113
# (set by fetch_ctk) must be available for both sdist and wheel builds.
114114
- name: Build cuda.bindings sdist and wheel-from-sdist
115115
if: ${{ env.BUILD_BINDINGS == 'true' }}
@@ -119,22 +119,22 @@ jobs:
119119
export CXX="sccache c++"
120120
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-bindings.txt"
121121
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
122-
python -m build --sdist cuda_bindings/
123-
pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz
122+
python -m build --sdist cuda_bindings_13/
123+
pip wheel --no-deps --wheel-dir cuda_bindings_13/dist cuda_bindings_13/dist/*.tar.gz
124124
125125
- name: Download cuda.bindings wheel
126126
if: ${{ env.BUILD_BINDINGS != 'true' && env.BUILD_CORE == 'true' }}
127127
uses: ./.github/actions/download-artifact-retry
128128
with:
129129
name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
130-
path: cuda_bindings/dist
130+
path: cuda_bindings_13/dist
131131

132132
- name: Constrain cuda.core to the local cuda.bindings wheel
133133
if: ${{ env.BUILD_CORE == 'true' }}
134134
run: |
135135
CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
136136
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
137-
bindings_wheels=(cuda_bindings/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl)
137+
bindings_wheels=(cuda_bindings_13/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl)
138138
test "${#pathfinder_wheels[@]}" -eq 1
139139
test "${#bindings_wheels[@]}" -eq 1
140140
test -f "${pathfinder_wheels[0]}"

0 commit comments

Comments
 (0)