Skip to content

Commit 43e2602

Browse files
authored
Merge branch 'main' into cuda-bindings-bench
2 parents 0e0ffab + a81fd07 commit 43e2602

File tree

269 files changed

+31496
-12060
lines changed

Some content is hidden

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

269 files changed

+31496
-12060
lines changed

.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/fetch_ctk/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
cuda-components:
1515
description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
1616
required: false
17-
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink,libcufile,libnvfatbin"
17+
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin"
1818
cuda-path:
1919
description: "where the CTK components will be installed to, relative to $PWD"
2020
required: false

.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/build-docs.yml

Lines changed: 11 additions & 11 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,7 +103,7 @@ 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

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ jobs:
220220
secrets: inherit
221221
uses: ./.github/workflows/build-docs.yml
222222
with:
223-
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
224223
is-release: ${{ github.ref_type == 'tag' }}
225224

226225
checks:

.github/workflows/coverage.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ on:
1111

1212
env:
1313
PY_VER: "3.14"
14-
CUDA_VER: "13.1.0"
1514
LOCAL_CTK: "1"
1615
GPU: "a100"
1716
DRIVER: "latest"
1817

1918
jobs:
19+
coverage-vars:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
CUDA_VER: ${{ steps.get-vars.outputs.cuda_ver }}
23+
steps:
24+
- name: Checkout ${{ github.event.repository.name }}
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
- name: Get CUDA version
27+
id: get-vars
28+
run: |
29+
cuda_ver=$(yq '.cuda.build.version' ci/versions.yml)
30+
echo "cuda_ver=$cuda_ver" >> $GITHUB_OUTPUT
31+
2032
coverage-linux:
2133
name: Coverage (Linux)
34+
needs: [coverage-vars]
2235
runs-on: "linux-amd64-gpu-a100-latest-1"
2336
permissions:
2437
id-token: write
@@ -29,6 +42,7 @@ jobs:
2942
env:
3043
HOST_PLATFORM: "linux-64"
3144
ARCH: "x86_64"
45+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
3246
# Our self-hosted runners require a container
3347
# TODO: use a different (nvidia?) container
3448
container:
@@ -164,6 +178,7 @@ jobs:
164178
# Build Windows wheels on GitHub-hosted runner (has VS, no GPU)
165179
build-wheel-windows:
166180
name: Build Wheels (Windows)
181+
needs: [coverage-vars]
167182
runs-on: windows-2022
168183
permissions:
169184
contents: read
@@ -173,6 +188,7 @@ jobs:
173188
env:
174189
HOST_PLATFORM: "win-64"
175190
CUDA_PYTHON_COVERAGE: "1"
191+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
176192
steps:
177193
- name: Checkout ${{ github.event.repository.name }}
178194
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -231,7 +247,7 @@ jobs:
231247
# Run coverage tests on self-hosted GPU runner (no VS needed, installs pre-built wheels)
232248
coverage-windows:
233249
name: Coverage (Windows)
234-
needs: [build-wheel-windows]
250+
needs: [coverage-vars, build-wheel-windows]
235251
runs-on: "windows-amd64-gpu-a100-latest-1"
236252
permissions:
237253
id-token: write
@@ -240,6 +256,7 @@ jobs:
240256
HOST_PLATFORM: "win-64"
241257
ARCH: "amd64"
242258
CUDA_PYTHON_COVERAGE: "1"
259+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
243260
defaults:
244261
run:
245262
shell: bash --noprofile --norc -xeuo pipefail {0}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: "CI: Enforce assignee/label/milestone on PRs"
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- opened
11+
- edited
12+
- synchronize
13+
- assigned
14+
- unassigned
15+
- labeled
16+
- unlabeled
17+
- reopened
18+
- ready_for_review
19+
20+
jobs:
21+
check-metadata:
22+
name: PR has assignee, labels, and milestone
23+
if: github.repository_owner == 'NVIDIA'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check for assignee, labels, and milestone
27+
env:
28+
ASSIGNEES: ${{ toJson(github.event.pull_request.assignees) }}
29+
LABELS: ${{ toJson(github.event.pull_request.labels) }}
30+
MILESTONE: ${{ github.event.pull_request.milestone && github.event.pull_request.milestone.title || '' }}
31+
PR_URL: ${{ github.event.pull_request.html_url }}
32+
IS_BOT: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' || github.actor == 'copy-pr-bot[bot]' }}
33+
IS_DRAFT: ${{ github.event.pull_request.draft }}
34+
run: |
35+
if [ "$IS_BOT" = "true" ] || [ "$IS_DRAFT" = "true" ]; then
36+
echo "Skipping check for bot or draft PR."
37+
exit 0
38+
fi
39+
40+
ERRORS=""
41+
42+
ASSIGNEE_COUNT=$(echo "$ASSIGNEES" | jq 'length')
43+
if [ "$ASSIGNEE_COUNT" -eq 0 ]; then
44+
ERRORS="${ERRORS}- **Missing assignee**: assign at least one person to this PR.\n"
45+
fi
46+
47+
# Module labels identify which package the PR touches.
48+
# Cross-cutting labels exempt PRs from needing a module label.
49+
# Read label names line-by-line (jq outputs one per line) so
50+
# multi-word GitHub labels are not split by shell word-splitting.
51+
MODULE_LABELS="cuda.bindings cuda.core cuda.pathfinder"
52+
MODULE_EXEMPT_LABELS="CI/CD"
53+
HAS_MODULE=false
54+
while IFS= read -r label; do
55+
[ -n "$label" ] || continue
56+
for mod in $MODULE_LABELS $MODULE_EXEMPT_LABELS; do
57+
if [ "$label" = "$mod" ]; then
58+
HAS_MODULE=true
59+
break 2
60+
fi
61+
done
62+
done < <(echo "$LABELS" | jq -r '.[].name')
63+
64+
if [ "$HAS_MODULE" = "false" ]; then
65+
ERRORS="${ERRORS}- **Missing module label**: add at least one of: \`cuda.bindings\`, \`cuda.core\`, \`cuda.pathfinder\` (or a cross-cutting label such as \`CI/CD\`).\n"
66+
fi
67+
68+
# Type labels categorize the kind of change.
69+
TYPE_LABELS="bug enhancement feature documentation test example CI/CD packaging dependencies performance experiment RFC support P0 P1 P2"
70+
HAS_TYPE=false
71+
while IFS= read -r label; do
72+
[ -n "$label" ] || continue
73+
for typ in $TYPE_LABELS; do
74+
if [ "$label" = "$typ" ]; then
75+
HAS_TYPE=true
76+
break 2
77+
fi
78+
done
79+
done < <(echo "$LABELS" | jq -r '.[].name')
80+
81+
if [ "$HAS_TYPE" = "false" ]; then
82+
ERRORS="${ERRORS}- **Missing type label**: add at least one of: \`bug\`, \`enhancement\`, \`feature\`, \`documentation\`, \`test\`, \`example\`, \`CI/CD\`, \`packaging\`, \`dependencies\`, \`performance\`, \`experiment\`, \`RFC\`, \`support\`, \`P0\`, \`P1\`, \`P2\`.\n"
83+
fi
84+
85+
if [ -z "$MILESTONE" ]; then
86+
ERRORS="${ERRORS}- **Missing milestone**: assign a milestone to this PR.\n"
87+
fi
88+
89+
# Block PRs with labels that indicate they are not ready to merge.
90+
# Match blocked label names exactly (case-insensitively); emit the
91+
# original spelling from the payload so error text matches GitHub.
92+
BLOCKED_LABELS=$(jq -r '
93+
(["blocked", "do not merge"]) as $blocking
94+
| .[]
95+
| .name as $n
96+
| if ($blocking | index($n | ascii_downcase)) != null
97+
then $n
98+
else empty
99+
end
100+
' <<<"$LABELS")
101+
while IFS= read -r label; do
102+
[ -n "$label" ] || continue
103+
ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n"
104+
done <<<"$BLOCKED_LABELS"
105+
106+
if [ -n "$ERRORS" ]; then
107+
echo "::error::This PR is missing required metadata. See the job summary for details."
108+
{
109+
echo "## PR Metadata Check Failed"
110+
echo ""
111+
printf '%b' "$ERRORS"
112+
echo ""
113+
echo "Please update the PR at: $PR_URL"
114+
} >> "$GITHUB_STEP_SUMMARY"
115+
exit 1
116+
fi
117+
118+
ASSIGNEE_LIST=$(echo "$ASSIGNEES" | jq -r '.[].login' | paste -sd ', ' -)
119+
LABEL_LIST=$(echo "$LABELS" | jq -r '.[].name' | paste -sd ', ' -)
120+
{
121+
echo "## PR Metadata Check Passed"
122+
echo ""
123+
echo "- **Assignees**: $ASSIGNEE_LIST"
124+
echo "- **Labels**: $LABEL_LIST"
125+
echo "- **Milestone**: $MILESTONE"
126+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/release-cuda-pathfinder.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
tag: ${{ steps.vars.outputs.tag }}
4141
version: ${{ steps.vars.outputs.version }}
4242
run-id: ${{ steps.detect-run.outputs.run-id }}
43-
ctk-ver: ${{ steps.ctk.outputs.ctk-ver }}
4443
steps:
4544
- name: Verify running on default branch
4645
run: |
@@ -77,12 +76,6 @@ jobs:
7776
exit 1
7877
fi
7978
80-
- name: Read CTK build version
81-
id: ctk
82-
run: |
83-
ctk_ver=$(yq '.cuda.build.version' ci/versions.yml)
84-
echo "ctk-ver=${ctk_ver}" >> "$GITHUB_OUTPUT"
85-
8679
- name: Detect CI run ID
8780
id: detect-run
8881
env:
@@ -146,7 +139,6 @@ jobs:
146139
secrets: inherit
147140
uses: ./.github/workflows/build-docs.yml
148141
with:
149-
build-ctk-ver: ${{ needs.prepare.outputs.ctk-ver }}
150142
component: cuda-pathfinder
151143
git-tag: ${{ needs.prepare.outputs.tag }}
152144
run-id: ${{ needs.prepare.outputs.run-id }}

0 commit comments

Comments
 (0)