Skip to content

Commit 184bdec

Browse files
committed
Merge branch 'main' of https://github.com/NVIDIA/cuda-python into codex/pathfinder-site-root-precedence-20261104
Signed-off-by: 0z5a <[email protected]>
2 parents b361e24 + 303fbda commit 184bdec

321 files changed

Lines changed: 53629 additions & 47463 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.

‎.github/ISSUE_TEMPLATE/release_checklist.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ body:
2323
- label: Sweep deprecations whose stated removal version has arrived (`grep -rn 'deprecated::' cuda_core/cuda`) and remove any that are due
2424
- label: "Finalize the doc update, including release notes (\"Note: Touching docstrings/type annotations in code is OK during code freeze, apply your best judgement!\")"
2525
- label: Update the docs for the new version
26-
- label: Create a public release tag
26+
- label: "For cuda-core: create the release branch (`release/cuda-core-vX.Y.x`) from `main` for a minor release, or use the existing one for a patch release"
27+
- label: "Create a public release tag (for cuda-core, on the release branch)"
2728
- label: Wait for the tag-triggered CI run to complete, and use that run ID for release workflows (this will upload the release to PyPI)
2829
- label: Publish the release at https://github.com/NVIDIA/cuda-python/releases (this will trigger the conda package update)
2930
- label: Approve the conda-package update PR

‎.github/RELEASE-core.md‎

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,23 @@ platforms as appropriate for each release.
8585
## Check (or update if needed) the dependency requirements
8686

8787
Review `cuda_core/pyproject.toml` and verify that all dependency
88-
requirements are current. The `cu12`/`cu13` extras declare the
89-
`cuda-bindings` floors; see "Bumping the cuda-bindings floor" in
90-
`cuda_core/AGENTS.md`.
88+
requirements are current.
89+
90+
The `cu12`/`cu13` extras declare the `cuda-bindings` floors. A release
91+
does not raise a floor to the newest `cuda-bindings`; see "Bumping the
92+
cuda-bindings floor" in `cuda_core/AGENTS.md`. Check the floors instead:
93+
94+
- The minor of each floor equals the minor of the toolkit pin of its
95+
major in `ci/versions.yml` (`build` for the current major, `prev_build`
96+
for the prior major). If a floor's minor is lower, the toolkit-bump
97+
window is open: move the floor before the release.
98+
- In the latest CI run on `main`, the CUDA 13 rows whose CUDA minor
99+
differs from the `build` pin (for example "CUDA 13.0.2") installed the
100+
literal floor. Their logs show `Installing bindings (source: floor)` and
101+
`cuda-bindings==<floor>`, and no "predates ... headers" line. Standard
102+
CI does not install the CUDA 12 floor: its rows use the 12.9.x backport
103+
build.
104+
- The release notes list every floor move since the last release.
91105

92106
Update the `cuda-core` pin in `cuda_python/setup.py` to the new minor
93107
series (`cuda-core~=X.Y.0`), and plan a `cuda-python` release right after
@@ -142,17 +156,45 @@ built and deployed automatically by the release workflow.
142156

143157
---
144158

159+
## Create the release branch
160+
161+
Each `cuda-core` minor series has one release branch,
162+
`release/cuda-core-vX.Y.x`. Releases are tagged on that branch, not on
163+
`main`. Patch releases of the series land there too.
164+
165+
For a minor release (`X.Y.0`), create the branch after every pre-release
166+
pull request has merged into `main`. Branch from the `main` commit that
167+
holds the final release notes:
168+
169+
```bash
170+
git fetch origin main
171+
git push origin origin/main:refs/heads/release/cuda-core-v0.6.x
172+
```
173+
174+
For a patch release (`X.Y.Z`), use the existing branch. Changes reach it
175+
through pull requests that cherry-pick the fixes from `main`, with
176+
`(cherry picked from commit ...)` trailers. The release notes for the patch
177+
release must be on the release branch before the tag: the release workflow
178+
checks for them in the tagged tree. Add them to `main` as well, so the docs
179+
switcher and the `latest` docs list them.
180+
181+
The repository ruleset protects `release/**`: a push to an existing release
182+
branch needs a pull request and passing checks.
183+
184+
---
185+
145186
## Create a public release tag
146187

147188
**Warning:** Pushing a tag is a potentially irrevocable action. Be absolutely
148189
certain the tag points to the correct commit before pushing.
149190

150191
Tags should be GPG-signed. The tag name format is `cuda-core-v<VERSION>`
151-
(e.g. `cuda-core-v0.6.0`). The tag must point to a commit on `main`.
192+
(e.g. `cuda-core-v0.6.0`). The tag must point to a commit on the release
193+
branch.
152194

153195
```bash
154-
git checkout main
155-
git pull origin main
196+
git fetch origin release/cuda-core-v0.6.x
197+
git checkout --detach origin/release/cuda-core-v0.6.x
156198
git tag -s cuda-core-v0.6.0 -m "cuda-core v0.6.0"
157199
git push origin cuda-core-v0.6.0
158200
```

‎.github/actions/fetch_ctk/action.yml‎

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ inputs:
1919
description: "where the CTK components will be installed to, relative to $PWD"
2020
required: false
2121
default: "./cuda_toolkit"
22+
install-mode:
23+
description: >
24+
"replace" (default) empties cuda-path before installing.
25+
"add" installs the components on top of the mini CTK that an earlier
26+
fetch_ctk call installed at the same cuda-path, and leaves the
27+
environment that call exported unchanged.
28+
required: false
29+
default: "replace"
2230
redist-base-url:
2331
description: >
2432
Base URL of a redistrib server (manifest and component archives).
@@ -43,6 +51,34 @@ runs:
4351
with:
4452
dependent_exes: "curl unzip tar sha256sum cygpath"
4553

54+
- name: Check install mode
55+
shell: bash --noprofile --norc -xeuo pipefail {0}
56+
run: |
57+
case "${{ inputs.install-mode }}" in
58+
replace)
59+
;;
60+
add)
61+
# The environment exports are skipped in this mode, so the target
62+
# must be the CUDA_PATH an earlier fetch_ctk call exported.
63+
if [[ -z "${CUDA_PATH:-}" ]]; then
64+
echo "::error::install-mode 'add' requires CUDA_PATH from an earlier fetch_ctk call"
65+
exit 1
66+
fi
67+
EXISTING_PATH="$CUDA_PATH"
68+
if [[ "${{ inputs.host-platform }}" == win* ]]; then
69+
EXISTING_PATH="$(cygpath -u "$EXISTING_PATH")"
70+
fi
71+
if [[ "$(realpath -e "${{ inputs.cuda-path }}")" != "$(realpath -e "$EXISTING_PATH")" ]]; then
72+
echo "::error::install-mode 'add' requires cuda-path to be the existing CUDA_PATH ($CUDA_PATH)"
73+
exit 1
74+
fi
75+
;;
76+
*)
77+
echo "::error::install-mode must be 'replace' or 'add', got '${{ inputs.install-mode }}'"
78+
exit 1
79+
;;
80+
esac
81+
4682
- name: Set up CTK cache variable
4783
shell: bash --noprofile --norc -xeuo pipefail {0}
4884
run: |
@@ -82,9 +118,11 @@ runs:
82118
# prefixes its output line with "\", which would end up in the cache key.
83119
MANIFEST_SHA256="$(sha256sum < "$CTK_JSON_FILE" | awk '{print $1}')"
84120
HASH=$(echo -n "${CTK_CACHE_COMPONENTS}" | sha256sum | awk '{print $1}')
121+
# Bump the layout tag (l2) whenever the unpacked tree changes shape, so
122+
# caches saved with an older layout are not restored.
85123
{
86-
echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH-m$MANIFEST_SHA256"
87-
echo "CTK_CACHE_FILENAME=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH-m$MANIFEST_SHA256.tar.gz"
124+
echo "CTK_CACHE_KEY=mini-ctk-l2-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH-m$MANIFEST_SHA256"
125+
echo "CTK_CACHE_FILENAME=mini-ctk-l2-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH-m$MANIFEST_SHA256.tar.gz"
88126
echo "CTK_CACHE_COMPONENTS=${CTK_CACHE_COMPONENTS}"
89127
echo "CTK_BASE_URL=${CTK_BASE_URL}"
90128
echo "CTK_JSON_FILE=${CTK_JSON_FILE}"
@@ -115,16 +153,16 @@ runs:
115153
# "Set up CTK cache variable".
116154
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
117155
function extract() {
118-
tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1
156+
tar -xvf $1 -C $2 --strip-components=1
119157
}
120158
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
121159
function extract() {
122160
_TEMP_DIR_=$(mktemp -d)
123161
unzip $1 -d $_TEMP_DIR_
124-
cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR
162+
cp -r $_TEMP_DIR_/*/* $2
125163
rm -rf $_TEMP_DIR_
126164
# see commit NVIDIA/cuda-python@69410f1d9228e775845ef6c8b4a9c7f37ffc68a5
127-
chmod 644 $CACHE_TMP_DIR/LICENSE
165+
chmod 644 $2/LICENSE
128166
}
129167
fi
130168
function populate_cuda_path() {
@@ -147,17 +185,34 @@ runs:
147185
--component "$CTK_COMPONENT" \
148186
--metadata-path "$CTK_JSON_FILE")"
149187
echo "${CTK_COMPONENT_SHA256} ${CTK_COMPONENT_COMPONENT_FILENAME}" | sha256sum --check --strict -
150-
extract $CTK_COMPONENT_COMPONENT_FILENAME
188+
# cuda.pathfinder looks for CUPTI only under extras/CUPTI, the CTK installer
189+
# layout; the redistrib archive itself has a flat include/ + lib/ layout.
190+
CTK_COMPONENT_DEST="$CACHE_TMP_DIR"
191+
if [[ "$CTK_COMPONENT" == cuda_cupti ]]; then
192+
CTK_COMPONENT_DEST="$CACHE_TMP_DIR/extras/CUPTI"
193+
fi
194+
mkdir -p "$CTK_COMPONENT_DEST"
195+
extract $CTK_COMPONENT_COMPONENT_FILENAME "$CTK_COMPONENT_DEST"
151196
rm $CTK_COMPONENT_COMPONENT_FILENAME
152197
}
153198
154199
# Get headers and shared libraries in place
155200
for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do
156201
populate_cuda_path "$item"
157202
done
158-
# TODO: check Windows
159-
if [[ "${{ inputs.host-platform }}" == linux* && -d "${CACHE_TMP_DIR}/lib" ]]; then
160-
mv $CACHE_TMP_DIR/lib $CACHE_TMP_DIR/lib64
203+
CUPTI_DIR="$CACHE_TMP_DIR/extras/CUPTI"
204+
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
205+
for lib_parent in "$CACHE_TMP_DIR" "$CUPTI_DIR"; do
206+
if [[ -d "$lib_parent/lib" ]]; then
207+
mv "$lib_parent/lib" "$lib_parent/lib64"
208+
fi
209+
done
210+
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
211+
# CUPTI archives before 13.4 put the DLLs directly in lib/, where the
212+
# CTK installer uses extras/CUPTI/lib64; later ones use lib/<arch>.
213+
if [[ -d "$CUPTI_DIR/lib" && ! -d "$CUPTI_DIR/lib/x64" && ! -d "$CUPTI_DIR/lib/arm64" ]]; then
214+
mv "$CUPTI_DIR/lib" "$CUPTI_DIR/lib64"
215+
fi
161216
fi
162217
ls -l $CACHE_TMP_DIR
163218
@@ -170,7 +225,9 @@ runs:
170225
# symlinks from a prerelease CTK at ./cuda_toolkit/include etc., causing
171226
# "cp: cannot overwrite non-directory" failures on the next restore).
172227
CUDA_PATH="${{ inputs.cuda-path }}"
173-
rm -rf $CUDA_PATH
228+
if [[ "${{ inputs.install-mode }}" == replace ]]; then
229+
rm -rf $CUDA_PATH
230+
fi
174231
mkdir -p $CUDA_PATH
175232
# Unfortunately we cannot use "rsync -av $CACHE_TMP_DIR/ $CUDA_PATH" because
176233
# not all runners have rsync pre-installed (or even installable, such as
@@ -194,7 +251,9 @@ runs:
194251
ls -l
195252
CACHE_TMP_DIR="./cache_tmp_dir"
196253
CUDA_PATH="${{ inputs.cuda-path }}"
197-
rm -rf $CUDA_PATH
254+
if [[ "${{ inputs.install-mode }}" == replace ]]; then
255+
rm -rf $CUDA_PATH
256+
fi
198257
mkdir -p $CUDA_PATH
199258
tar -xzvf $CTK_CACHE_FILENAME
200259
# Can't use rsync here, see above
@@ -203,6 +262,7 @@ runs:
203262
ls -l $CUDA_PATH
204263
205264
- name: Set output environment variables
265+
if: ${{ inputs.install-mode == 'replace' }}
206266
shell: bash --noprofile --norc -xeuo pipefail {0}
207267
run: |
208268
# mimics actual CTK installation

‎.github/actions/upgrade-ca-certificates/emudhra_intermediates.ps1‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,56 @@ function Test-ExplicitlyDistrusted([System.Security.Cryptography.X509Certificate
6969
$chain.Dispose()
7070
}
7171
}
72+
73+
# Classifies how Windows chain building treats the certificate, using only the
74+
# local trust state (no revocation, no AIA downloads):
75+
# ExplicitDistrust : in LocalMachine\Disallowed or Microsoft's disallowed list
76+
# NoTrustAnchor : the chain no longer ends in a trusted root, and
77+
# UntrustedRoot / PartialChain are the only problems
78+
# reported, e.g. because the root was removed
79+
# Trusted : the chain builds cleanly, so the compromised key is usable
80+
# Indeterminate : the build failed for some other reason; never a pass
81+
# Verification time is pinned (the instant used by runner_trust_probe.sh) so an
82+
# expired certificate cannot masquerade as untrusted.
83+
# A PartialChain only shows that the root is untrusted if the issuers are
84+
# available to the build, so callers pass the non-root issuers in
85+
# $ExtraCertificates. Issuers that are roots need not be supplied: a missing
86+
# root is exactly the condition this function reports as NoTrustAnchor.
87+
function Get-ChainTrustState(
88+
[System.Security.Cryptography.X509Certificates.X509Certificate2]$Cert,
89+
[System.Security.Cryptography.X509Certificates.X509Certificate2[]]$ExtraCertificates = @()
90+
) {
91+
$explicitDistrust = [System.Security.Cryptography.X509Certificates.X509ChainStatusFlags]::ExplicitDistrust
92+
$noAnchor = [int]([System.Security.Cryptography.X509Certificates.X509ChainStatusFlags]::UntrustedRoot -bor
93+
[System.Security.Cryptography.X509Certificates.X509ChainStatusFlags]::PartialChain)
94+
$chain = [System.Security.Cryptography.X509Certificates.X509Chain]::new()
95+
try {
96+
foreach ($extra in $ExtraCertificates) {
97+
[void]$chain.ChainPolicy.ExtraStore.Add($extra)
98+
}
99+
$chain.ChainPolicy.RevocationMode = [System.Security.Cryptography.X509Certificates.X509RevocationMode]::NoCheck
100+
$chain.ChainPolicy.VerificationTime = [DateTime]::new(2026, 10, 23, 0, 0, 0, [DateTimeKind]::Utc)
101+
# DisableCertificateDownloads does not exist on .NET Framework (Windows PowerShell 5.1).
102+
if ($chain.ChainPolicy | Get-Member -Name DisableCertificateDownloads) {
103+
$chain.ChainPolicy.DisableCertificateDownloads = $true
104+
}
105+
$built = $chain.Build($Cert)
106+
$statuses = @($chain.ChainStatus) + @($chain.ChainElements | ForEach-Object { $_.ChainElementStatus })
107+
$names = @($statuses | ForEach-Object { $_.Status.ToString() } | Where-Object { $_ -ne 'NoError' } | Sort-Object -Unique)
108+
if ($statuses | Where-Object { $_.Status.HasFlag($explicitDistrust) }) {
109+
$state = 'ExplicitDistrust'
110+
} elseif ($built) {
111+
$state = 'Trusted'
112+
} elseif (
113+
($statuses | Where-Object { ([int]$_.Status -band $noAnchor) -ne 0 }) -and
114+
-not ($statuses | Where-Object { ([int]$_.Status -band (-bnot $noAnchor)) -ne 0 })
115+
) {
116+
$state = 'NoTrustAnchor'
117+
} else {
118+
$state = 'Indeterminate'
119+
}
120+
return [pscustomobject]@{ State = $state; Statuses = ($names -join ',') }
121+
} finally {
122+
$chain.Dispose()
123+
}
124+
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ jobs:
7272
# but not historical blobs.
7373
fetch-depth: 0
7474
filter: blob:none
75-
# third_party/cccl provides the CCCL headers cuda.core compiles against.
76-
submodules: true
75+
# Fetch CCCL separately: checkout's filter does not apply to submodules.
76+
submodules: false
77+
78+
- name: Checkout CCCL submodule
79+
run: |
80+
git submodule sync --recursive
81+
git submodule update --init --force --depth=1 --filter=blob:none --recursive
7782
7883
- name: Register problem matchers
7984
# Compiler and Cython errors from the wheel builds become annotations

‎.github/workflows/ci-nightly.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,12 @@ jobs:
6161
- name: Set up Python
6262
uses: ./.github/actions/setup-hardened-python
6363
with:
64-
python-version: "3.12"
64+
python-version: "3.11"
6565

6666
- name: Run CI tools unit tests
6767
run: |
68-
python -m pip install pytest pyyaml==6.0.3 pathspec==0.12.1
69-
# Standalone CI tool tests; skip repo-root conftest.py (imports cuda.pathfinder).
70-
python -m pytest -v --noconftest ci/tools/tests
68+
python -m pip install -e './ci[test]'
69+
python -m pytest -v ci/tools/tests
7170
7271
find-wheels:
7372
if: ${{ github.repository_owner == 'nvidia' && !inputs.documentation-links-only }}

0 commit comments

Comments
 (0)