Skip to content

Commit 086e7fb

Browse files
committed
Merge branch 'main' into update-cuda-13.1.1
2 parents e99ec49 + 27e9066 commit 086e7fb

82 files changed

Lines changed: 5662 additions & 2003 deletions

Some content is hidden

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

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ cuda/_version.py export-subst
66
# we do not own any headers checked in, don't touch them
77
*.h binary
88
*.hpp binary
9-
# Exception: headers we own (cuda_core C++ implementation)
9+
# Exception: headers we own
10+
cuda_bindings/cuda/bindings/_bindings/*.h -binary text diff
11+
cuda_bindings/cuda/bindings/_lib/*.h -binary text diff
1012
cuda_core/cuda/core/_cpp/*.h -binary text diff
1113
cuda_core/cuda/core/_cpp/*.hpp -binary text diff
1214
# git should not convert line endings in PNG files

.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"
17+
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink,libcufile,libnvfatbin"
1818
cuda-path:
1919
description: "where the CTK components will be installed to, relative to $PWD"
2020
required: false

.github/workflows/backport.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@ on:
99
types: [closed, labeled]
1010
branches:
1111
- main
12+
workflow_dispatch:
13+
inputs:
14+
backport-branch:
15+
description: "Branch to backport commits onto"
16+
required: false
17+
type: string
18+
pull-request:
19+
description: "PR to backport"
20+
required: true
21+
type: number
22+
1223

1324
permissions:
1425
contents: write # so it can comment
1526
pull-requests: write # so it can create pull requests
1627

1728
jobs:
18-
backport:
19-
name: Backport pull request
29+
backport-from-pr:
30+
name: Backport directly from a pull request
2031
if: ${{ github.repository_owner == 'nvidia' &&
2132
github.event.pull_request.merged == true &&
2233
contains( github.event.pull_request.labels.*.name, 'to-be-backported')
@@ -38,3 +49,28 @@ jobs:
3849
copy_labels_pattern: true
3950
copy_requested_reviewers: true
4051
target_branches: ${{ env.OLD_BRANCH }}
52+
backport-to-branch:
53+
name: Backport a specific PR against a specific branch
54+
if: github.repository_owner == 'nvidia' && github.event_name == 'workflow_dispatch'
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
58+
59+
- name: Load branch from environment name
60+
if: inputs.backport-branch == null
61+
run: |
62+
BACKPORT_BRANCH=$(yq '.backport_branch' ci/versions.yml)
63+
echo "BACKPORT_BRANCH=${BRANCH}" >> $GITHUB_ENV
64+
65+
- name: Load branch name from input
66+
if: inputs.backport-branch != null
67+
run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV
68+
69+
- name: Create backport pull requests
70+
uses: korthout/backport-action@c656f5d5851037b2b38fb5db2691a03fa229e3b2 # v4.0.1
71+
with:
72+
copy_assignees: true
73+
copy_labels_pattern: true
74+
copy_requested_reviewers: true
75+
target_branches: ${{ env.BACKPORT_BRANCH }}
76+
source_pr_number: ${{ inputs.pull-request }}

.github/workflows/build-docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
run:
4848
shell: bash -el {0}
4949
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
5056
- name: Checkout ${{ github.event.repository.name }}
5157
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5258
with:

.github/workflows/ci.yml

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
outputs:
4242
skip: ${{ steps.get-should-skip.outputs.skip }}
43+
doc-only: ${{ steps.get-should-skip.outputs.doc_only }}
4344
steps:
4445
- name: Checkout repository
4546
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -50,13 +51,23 @@ jobs:
5051
run: |
5152
set -euxo pipefail
5253
if ${{ startsWith(github.ref_name, 'pull-request/') }}; then
53-
skip="$(gh pr view "$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')" --json title --jq '.title | contains("[no-ci]")')"
54+
pr_number="$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')"
55+
pr_title="$(gh pr view "${pr_number}" --json title --jq '.title')"
56+
skip="$(echo "${pr_title}" | grep -q '\[no-ci\]' && echo true || echo false)"
57+
doc_only="$(echo "${pr_title}" | grep -q '\[doc-only\]' && echo true || echo false)"
5458
else
5559
skip=false
60+
doc_only=false
5661
fi
5762
echo "skip=${skip}" >> "$GITHUB_OUTPUT"
63+
echo "doc_only=${doc_only}" >> "$GITHUB_OUTPUT"
5864
59-
# WARNING: make sure all of the build jobs are in sync
65+
# NOTE: Build jobs are intentionally split by platform rather than using a single
66+
# matrix. This allows each test job to depend only on its corresponding build,
67+
# so faster platforms can proceed through build & test without waiting for slower
68+
# ones. Keep these job definitions textually identical except for:
69+
# - host-platform value
70+
# - if: condition (build-linux-64 omits doc-only check since it's needed for docs)
6071
build-linux-64:
6172
needs:
6273
- ci-vars
@@ -75,7 +86,7 @@ jobs:
7586
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
7687
prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }}
7788

78-
# WARNING: make sure all of the build jobs are in sync
89+
# See build-linux-64 for why build jobs are split by platform.
7990
build-linux-aarch64:
8091
needs:
8192
- ci-vars
@@ -86,15 +97,15 @@ jobs:
8697
host-platform:
8798
- linux-aarch64
8899
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
89-
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
100+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }}
90101
secrets: inherit
91102
uses: ./.github/workflows/build-wheel.yml
92103
with:
93104
host-platform: ${{ matrix.host-platform }}
94105
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
95106
prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }}
96107

97-
# WARNING: make sure all of the build jobs are in sync
108+
# See build-linux-64 for why build jobs are split by platform.
98109
build-windows:
99110
needs:
100111
- ci-vars
@@ -105,27 +116,32 @@ jobs:
105116
host-platform:
106117
- win-64
107118
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
108-
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
119+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }}
109120
secrets: inherit
110121
uses: ./.github/workflows/build-wheel.yml
111122
with:
112123
host-platform: ${{ matrix.host-platform }}
113124
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
114125
prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }}
115126

116-
# WARNING: make sure both Linux test jobs are in sync
127+
# NOTE: Test jobs are split by platform for the same reason as build jobs (see
128+
# build-linux-64). Keep these job definitions textually identical except for:
129+
# - host-platform value
130+
# - build job under needs:
131+
# - uses: (test-wheel-linux.yml vs test-wheel-windows.yml)
117132
test-linux-64:
118133
strategy:
119134
fail-fast: false
120135
matrix:
121136
host-platform:
122137
- linux-64
123138
name: Test ${{ matrix.host-platform }}
124-
if: ${{ github.repository_owner == 'nvidia' }}
139+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) }}
125140
permissions:
126141
contents: read # This is required for actions/checkout
127142
needs:
128143
- ci-vars
144+
- should-skip
129145
- build-linux-64
130146
secrets: inherit
131147
uses: ./.github/workflows/test-wheel-linux.yml
@@ -134,19 +150,20 @@ jobs:
134150
host-platform: ${{ matrix.host-platform }}
135151
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
136152

137-
# WARNING: make sure both Linux test jobs are in sync
153+
# See test-linux-64 for why test jobs are split by platform.
138154
test-linux-aarch64:
139155
strategy:
140156
fail-fast: false
141157
matrix:
142158
host-platform:
143159
- linux-aarch64
144160
name: Test ${{ matrix.host-platform }}
145-
if: ${{ github.repository_owner == 'nvidia' }}
161+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) }}
146162
permissions:
147163
contents: read # This is required for actions/checkout
148164
needs:
149165
- ci-vars
166+
- should-skip
150167
- build-linux-aarch64
151168
secrets: inherit
152169
uses: ./.github/workflows/test-wheel-linux.yml
@@ -155,18 +172,20 @@ jobs:
155172
host-platform: ${{ matrix.host-platform }}
156173
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
157174

175+
# See test-linux-64 for why test jobs are split by platform.
158176
test-windows:
159177
strategy:
160178
fail-fast: false
161179
matrix:
162180
host-platform:
163181
- win-64
164182
name: Test ${{ matrix.host-platform }}
165-
if: ${{ github.repository_owner == 'nvidia' }}
183+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) }}
166184
permissions:
167185
contents: read # This is required for actions/checkout
168186
needs:
169187
- ci-vars
188+
- should-skip
170189
- build-windows
171190
secrets: inherit
172191
uses: ./.github/workflows/test-wheel-windows.yml
@@ -196,6 +215,7 @@ jobs:
196215
if: always()
197216
runs-on: ubuntu-latest
198217
needs:
218+
- should-skip
199219
- test-linux-64
200220
- test-linux-aarch64
201221
- test-windows
@@ -219,11 +239,18 @@ jobs:
219239
# failing job(s) will timeout causing a cancellation here and the
220240
# build to succeed which we don't want (originally this was just
221241
# 'exit 0')
222-
if ${{ needs.test-linux-64.result == 'cancelled' ||
223-
needs.test-linux-aarch64.result == 'cancelled' ||
224-
needs.test-windows.result == 'cancelled' ||
225-
needs.doc.result == 'cancelled' }}; then
242+
#
243+
# Note: When [doc-only] is in PR title, test jobs are intentionally
244+
# skipped and should not cause failure.
245+
doc_only=${{ needs.should-skip.outputs.doc-only }}
246+
if ${{ needs.doc.result == 'cancelled' }}; then
226247
exit 1
227-
else
228-
exit 0
229248
fi
249+
if [[ "${doc_only}" != "true" ]]; then
250+
if ${{ needs.test-linux-64.result == 'cancelled' ||
251+
needs.test-linux-aarch64.result == 'cancelled' ||
252+
needs.test-windows.result == 'cancelled' }}; then
253+
exit 1
254+
fi
255+
fi
256+
exit 0

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
needs:
136136
- check-tag
137137
- determine-run-id
138+
- doc
138139
secrets: inherit
139140
uses: ./.github/workflows/release-upload.yml
140141
with:
@@ -148,6 +149,7 @@ jobs:
148149
needs:
149150
- check-tag
150151
- determine-run-id
152+
- doc
151153
environment:
152154
name: ${{ inputs.wheel-dst }}
153155
url: https://${{ (inputs.wheel-dst == 'testpypi' && 'test.') || '' }}pypi.org/p/${{ inputs.component }}/

.github/workflows/test-wheel-linux.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ jobs:
5757
# Read base matrix from YAML file for the specific architecture
5858
TEST_MATRIX=$(yq -o json ".linux[\"${MATRIX_TYPE}\"] | map(select(.ARCH == \"${ARCH}\"))" ci/test-matrix.yml)
5959
60-
# Add special runner for amd64 if applicable
61-
if [[ "${ARCH}" == "amd64" ]]; then
62-
SPECIAL_RUNNERS=$(yq -o json '.linux.special_runners.amd64' ci/test-matrix.yml)
63-
TEST_MATRIX=$(echo "$TEST_MATRIX" | yq -o json ". + $SPECIAL_RUNNERS")
64-
fi
65-
6660
# Apply matrix filter and wrap in include structure
6761
MATRIX=$(echo "$TEST_MATRIX" | jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end')
6862
@@ -73,12 +67,12 @@ jobs:
7367
echo "OLD_BRANCH=${OLD_BRANCH}" >> "$GITHUB_OUTPUT"
7468
7569
test:
76-
name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, ${{ matrix.GPU }}
70+
name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format('(x{0})', matrix.GPU_COUNT) || '' }}
7771
needs: compute-matrix
7872
strategy:
7973
fail-fast: false
8074
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
81-
runs-on: "linux-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1"
75+
runs-on: "linux-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-${{ matrix.GPU_COUNT }}"
8276
# The build stage could fail but we want the CI to keep moving.
8377
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
8478
# Our self-hosted runners require a container
@@ -269,17 +263,15 @@ jobs:
269263
- name: Ensure cuda-python installable
270264
run: |
271265
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
272-
pip install cuda_python*.whl
266+
pip install --only-binary=:all: cuda_python*.whl
273267
else
274-
pip install $(ls cuda_python*.whl)[all]
268+
pip install --only-binary=:all: $(ls cuda_python*.whl)[all]
275269
fi
276270
277271
- name: Install cuda.pathfinder extra wheels for testing
278272
run: |
279273
set -euo pipefail
280274
pushd cuda_pathfinder
281-
# Install pathfinder from the pre-built wheel, since building from
282-
# source won't work in this context (we don't have a git checkout).
283275
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
284276
pip list
285277
popd

.github/workflows/test-wheel-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
fail-fast: false
6767
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
6868
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
69-
runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1"
69+
runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-${{ matrix.GPU_COUNT }}"
7070
steps:
7171
- name: Checkout ${{ github.event.repository.name }}
7272
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -236,16 +236,16 @@ jobs:
236236
- name: Ensure cuda-python installable
237237
run: |
238238
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
239-
pip install (Get-ChildItem -Filter cuda_python*.whl).FullName
239+
pip install --only-binary=:all: (Get-ChildItem -Filter cuda_python*.whl).FullName
240240
} else {
241-
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
241+
pip install --only-binary=:all: "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
242242
}
243243
244244
- name: Install cuda.pathfinder extra wheels for testing
245245
shell: bash --noprofile --norc -xeuo pipefail {0}
246246
run: |
247247
pushd cuda_pathfinder
248-
pip install --only-binary=:all: -v . --group "test-cu${TEST_CUDA_MAJOR}"
248+
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
249249
pip list
250250
popd
251251

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
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

@@ -30,6 +30,7 @@ repos:
3030
additional_dependencies:
3131
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
3232
exclude: '.*pixi\.lock'
33+
args: ["--fix"]
3334

3435
- id: no-markdown-in-docs-source
3536
name: Prevent markdown files in docs/source directories
@@ -89,5 +90,6 @@ repos:
8990
args: [--no-pycodestyle]
9091
exclude: ^cuda_bindings/
9192

93+
9294
default_language_version:
9395
python: python3

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c
1313
* [nvshmem4py](https://docs.nvidia.com/nvshmem/api/api/language_bindings/python/index.html): Pythonic interface to the NVSHMEM library, enabling Python applications to leverage NVSHMEM's high-performance PGAS (Partitioned Global Address Space) programming model for GPU-accelerated computing
1414
* [Nsight Python](https://docs.nvidia.com/nsight-python/index.html): Python kernel profiling interface that automates performance analysis across multiple kernel configurations using NVIDIA Nsight Tools
1515
* [CUPTI Python](https://docs.nvidia.com/cupti-python/): Python APIs for creation of profiling tools that target CUDA Python applications via the CUDA Profiling Tools Interface (CUPTI)
16+
* [Accelerated Computing Hub](https://github.com/NVIDIA/accelerated-computing-hub): Open-source learning materials related to GPU computing. You will find user guides, tutorials, and other works freely available for all learners interested in GPU computing.
1617

1718
CUDA Python is currently undergoing an overhaul to improve existing and introduce new components. All of the previously available functionality from the `cuda-python` package will continue to be available, please refer to the [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest) documentation for installation guide and further detail.
1819

0 commit comments

Comments
 (0)