Skip to content

Commit bb9ba91

Browse files
authored
Merge branch 'main' into ci/auto-label-prs
2 parents cf63f32 + 355fcaa commit bb9ba91

382 files changed

Lines changed: 48482 additions & 14085 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.

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2-
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
2+
# SPDX-License-Identifier: Apache-2.0
33

44
[paths]
55
source =

.github/RELEASE-core.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -123,41 +123,21 @@ Pushing the tag triggers a CI run automatically. Monitor it in the
123123

124124
## Upload wheels to PyPI
125125

126-
This is a two-stage process: first publish to TestPyPI, verify, then
127-
publish to PyPI.
128-
129-
### Stage 1: TestPyPI
126+
This is a single `CI: Release` workflow run with two sequential stages:
127+
publish to TestPyPI, then publish the same wheel set to PyPI.
130128

131129
1. Go to **Actions > CI: Release** and run the workflow with:
132130
- **Component**: `cuda-core`
133131
- **The release git tag**: `cuda-core-v0.6.0`
134-
- **The GHA run ID that generated validated artifacts**: This is the
135-
run ID of the successful tag-triggered CI run from the previous step.
136-
You can find it in the URL when viewing the run in the Actions tab
137-
(e.g. `https://github.com/NVIDIA/cuda-python/actions/runs/123456789`
138-
— the run ID is `123456789`).
139-
- **build-ctk-ver**: the `cuda.build.version` from
140-
[`ci/versions.yml`](../ci/versions.yml) (e.g. `13.1.1`)
141-
- **Which wheel index to publish to**: `testpypi`
142-
143-
2. Wait for the workflow to complete.
144-
145-
3. Verify the TestPyPI upload by installing and running tests from a
146-
checked-out copy of the repository:
147-
148-
```bash
149-
pip install -i https://test.pypi.org/simple/ \
150-
--extra-index-url https://pypi.org/simple/ \
151-
cuda-core==0.6.0
152-
cd cuda_core/tests && pytest
153-
```
154132

155-
### Stage 2: PyPI
133+
The workflow automatically looks up the successful tag-triggered CI run
134+
for the selected release tag.
156135

157-
Once TestPyPI verification passes, rerun the same workflow with:
158-
- **Which wheel index to publish to**: `pypi`
136+
2. Wait for the workflow to complete. It will:
137+
- publish the selected wheels to TestPyPI
138+
- publish the same wheel set to PyPI
159139

160-
After completion, verify:
140+
3. After completion, verify the final PyPI upload:
161141

162142
```bash
163143
pip install cuda-core==0.6.0

.github/actions/doc_preview/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
# Note: the PR previews will be removed once merged to main or release/* (see below)
2323
- name: Deploy doc preview
2424
if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
25-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
25+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
2626
with:
2727
git-config-name: cuda-python-bot
2828
git-config-email: cuda-python-bot@users.noreply.github.com
@@ -32,7 +32,7 @@ runs:
3232

3333
- name: Leave a comment after deployment
3434
if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
35-
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
35+
uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3
3636
with:
3737
header: pr-preview
3838
number: ${{ inputs.pr-number }}
@@ -49,7 +49,7 @@ runs:
4949
# The steps below are executed only when building on main or release/*.
5050
- name: Remove doc preview
5151
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }}
52-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
52+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
5353
with:
5454
git-config-name: cuda-python-bot
5555
git-config-email: cuda-python-bot@users.noreply.github.com
@@ -59,7 +59,7 @@ runs:
5959

6060
- name: Leave a comment after removal
6161
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }}
62-
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
62+
uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3
6363
with:
6464
header: pr-preview
6565
number: ${{ inputs.pr-number }}

.github/actions/fetch_ctk/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -60,7 +60,7 @@ runs:
6060

6161
- name: Download CTK cache
6262
id: ctk-get-cache
63-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
63+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
6464
continue-on-error: true
6565
with:
6666
key: ${{ env.CTK_CACHE_KEY }}
@@ -103,7 +103,7 @@ runs:
103103
function populate_cuda_path() {
104104
# take the component name as a argument
105105
function download() {
106-
curl -kLSs $1 -o $2
106+
curl -LSs $1 -o $2
107107
}
108108
CTK_COMPONENT=$1
109109
CTK_COMPONENT_REL_PATH="$(curl -s $CTK_JSON_URL |
@@ -142,7 +142,7 @@ runs:
142142
- name: Upload CTK cache
143143
if: ${{ !cancelled() &&
144144
steps.ctk-get-cache.outputs.cache-hit != 'true' }}
145-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
145+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
146146
with:
147147
key: ${{ env.CTK_CACHE_KEY }}
148148
path: ./${{ env.CTK_CACHE_FILENAME }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: sccache summary
6+
description: Parse sccache stats JSON and write a summary table to GITHUB_STEP_SUMMARY
7+
8+
# Inspired by NVIDIA/cccl's prepare-execution-summary.py (PR #3621).
9+
# Only counts C/C++ and CUDA language hits (excludes PTX/CUBIN which are
10+
# not included in sccache's compile_requests counter).
11+
12+
inputs:
13+
json-file:
14+
description: "Path to the sccache stats JSON file (from sccache --show-stats --stats-format=json)"
15+
required: true
16+
label:
17+
description: "Label for the stats row (e.g. cuda.bindings, cuda.core)"
18+
required: false
19+
default: "sccache"
20+
build-step:
21+
description: "Name of the cibuildwheel build step (for deep-link in summary)"
22+
required: false
23+
default: ""
24+
25+
runs:
26+
using: composite
27+
steps:
28+
- name: Report sccache stats
29+
shell: bash --noprofile --norc -euo pipefail {0}
30+
env:
31+
SCCACHE_JSON: ${{ inputs.json-file }}
32+
SCCACHE_LABEL: ${{ inputs.label }}
33+
SCCACHE_BUILD_STEP: ${{ inputs.build-step }}
34+
run: |
35+
if [ ! -f "$SCCACHE_JSON" ]; then
36+
echo "::warning::sccache stats file not found: $SCCACHE_JSON"
37+
exit 0
38+
fi
39+
40+
python3 - <<'PYEOF'
41+
import json, os, urllib.parse
42+
43+
json_file = os.environ["SCCACHE_JSON"]
44+
label = os.environ["SCCACHE_LABEL"]
45+
build_step = os.environ.get("SCCACHE_BUILD_STEP", "")
46+
47+
with open(json_file) as f:
48+
stats = json.load(f)["stats"]
49+
50+
# compile_requests includes non-compilation calls (linker, etc).
51+
# Use cache_hits + cache_misses as the denominator to match sccache's
52+
# own "Cache hits rate" which only counts actual compilation requests.
53+
counted_languages = {"C/C++", "CUDA"}
54+
hits = sum(
55+
v for k, v in stats.get("cache_hits", {}).get("counts", {}).items()
56+
if k in counted_languages
57+
)
58+
misses = sum(
59+
v for k, v in stats.get("cache_misses", {}).get("counts", {}).items()
60+
if k in counted_languages
61+
)
62+
total = hits + misses
63+
pct = int(100 * hits / total) if total > 0 else 0
64+
65+
# Build a deep-link to the cibuildwheel step if step name is provided.
66+
# GHA step summary links use the format: #step:N:L but we can't know the
67+
# step number here. Instead, link to the job page with a search hint.
68+
link_note = ""
69+
if build_step:
70+
link_note = f"\n\n_Full stats in the **{build_step}** step log._\n"
71+
72+
summary_file = os.environ.get("GITHUB_STEP_SUMMARY", "")
73+
if summary_file:
74+
with open(summary_file, "a") as sf:
75+
sf.write(f"### 📊 {label} — sccache stats\n")
76+
sf.write("| Hit Rate | Hits | Misses | Requests |\n")
77+
sf.write("|----------|------|--------|----------|\n")
78+
sf.write(f"| {pct}% | {hits} | {misses} | {total} |{link_note}\n")
79+
80+
print(f"{label}: {pct}% hit rate ({hits}/{total})")
81+
PYEOF

.github/copy-pr-bot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/
66

77
enabled: true
8-
# always require manual CI triggering, ignoring signed commits
8+
# auto-sync ready PRs so CI starts immediately; keep draft PRs manual
99
auto_sync_draft: false
10-
auto_sync_ready: false
10+
auto_sync_ready: true

.github/workflows/backport.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV
4444
4545
- name: Create backport pull requests
46-
uses: korthout/backport-action@01619ebc9a6e3f6820274221b9956b3e7365000a # v4.1.0
46+
uses: korthout/backport-action@3c06f323a58619da1e8522229ebc8d5de2633e46 # v4.3.0
4747
with:
4848
copy_assignees: true
4949
copy_labels_pattern: true
@@ -67,7 +67,7 @@ jobs:
6767
run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV
6868

6969
- name: Create backport pull requests
70-
uses: korthout/backport-action@01619ebc9a6e3f6820274221b9956b3e7365000a # v4.1.0
70+
uses: korthout/backport-action@3c06f323a58619da1e8522229ebc8d5de2633e46 # v4.3.0
7171
with:
7272
copy_assignees: true
7373
copy_labels_pattern: true

.github/workflows/bandit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2424

2525
- name: Install uv
26-
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
26+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
2727
with:
2828
enable-cache: false
2929

@@ -42,6 +42,6 @@ jobs:
4242
with:
4343
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
4444
- name: Upload SARIF file
45-
uses: github/codeql-action/upload-sarif@v4.32.5
45+
uses: github/codeql-action/upload-sarif@v4.35.1
4646
with:
4747
sarif_file: results.sarif

.github/workflows/build-docs.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ name: "CI: Build and update docs"
77
on:
88
workflow_call:
99
inputs:
10-
build-ctk-ver:
11-
type: string
12-
required: true
1310
component:
1411
description: "Component(s) to build docs for"
1512
required: false
@@ -47,18 +44,21 @@ jobs:
4744
run:
4845
shell: bash -el {0}
4946
steps:
50-
- name: validate build-ctk
51-
run: |
52-
if [ ! "${{ inputs.build-ctk-ver }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]; then
53-
echo "error: `build-ctk-ver` ${{ inputs.build-ctk-ver }} version does not match MAJOR.MINOR.MICRO" >&2
54-
exit 1
55-
fi
5647
- name: Checkout ${{ github.event.repository.name }}
5748
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5849
with:
5950
fetch-depth: 0
6051
ref: ${{ inputs.git-tag }}
6152

53+
- name: Read build CTK version
54+
run: |
55+
BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml)
56+
if [[ ! "${BUILD_CTK_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
57+
echo "error: derived CTK build version ${BUILD_CTK_VER} does not match MAJOR.MINOR.MICRO" >&2
58+
exit 1
59+
fi
60+
echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV"
61+
6262
# TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache
6363

6464
- name: Set up miniforge
@@ -82,7 +82,7 @@ jobs:
8282
uses: ./.github/actions/fetch_ctk
8383
with:
8484
host-platform: linux-64
85-
cuda-version: ${{ inputs.build-ctk-ver }}
85+
cuda-version: ${{ env.BUILD_CTK_VER }}
8686

8787
- name: Set environment variables
8888
run: |
@@ -103,13 +103,13 @@ jobs:
103103
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
104104
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
105105
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
106-
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-linux-64"
106+
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64"
107107
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
108108
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
109109
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
110110
111111
- name: Download cuda-python build artifacts
112-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
112+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
113113
with:
114114
name: cuda-python-wheel
115115
path: .
@@ -122,7 +122,7 @@ jobs:
122122
ls -lahR .
123123
124124
- name: Download cuda-pathfinder build artifacts
125-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
125+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
126126
with:
127127
name: cuda-pathfinder-wheel
128128
path: ./cuda_pathfinder
@@ -136,14 +136,14 @@ jobs:
136136
137137
- name: Download cuda.bindings build artifacts
138138
if: ${{ !inputs.is-release }}
139-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
139+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
140140
with:
141141
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
142142
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
143143

144144
- name: Download cuda.bindings build artifacts
145145
if: ${{ inputs.is-release }}
146-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
146+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
147147
with:
148148
pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
149149
merge-multiple: true
@@ -158,14 +158,14 @@ jobs:
158158
159159
- name: Download cuda.core build artifacts
160160
if: ${{ !inputs.is-release }}
161-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
161+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
162162
with:
163163
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
164164
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
165165

166166
- name: Download cuda.core build artifacts
167167
if: ${{ inputs.is-release }}
168-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
168+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
169169
with:
170170
pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
171171
merge-multiple: true

0 commit comments

Comments
 (0)