Skip to content

Commit be92020

Browse files
authored
Merge branch 'main' into main
2 parents ef73d2e + 1e7dcf2 commit be92020

File tree

118 files changed

+784
-575
lines changed

Some content is hidden

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

118 files changed

+784
-575
lines changed

.bandit

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/actions/doc_preview/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
name: Preview or clean up docs built from PRs
5+
name: Docs in PRs
6+
description: Preview or clean up docs built from PRs
67

78
# A re-implementation based on the logic of https://github.com/rossjrw/pr-preview-action/blob/41a957c44a456a34718e9bcf825363194db5e6d5/README.md, due to limitations illustrated in NVIDIA/cuda-python#380.
89

910
inputs:
1011
source-folder:
1112
required: true
1213
type: string
14+
description: "Source code directory"
1315
pr-number:
1416
required: true
1517
type: string
18+
description: "Pull request number"
1619

1720
runs:
1821
using: composite

.github/workflows/bandit.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,27 @@ jobs:
1919
permissions:
2020
security-events: write
2121
steps:
22-
- name: Perform Bandit Analysis
23-
# KEEP IN SYNC WITH bandit rev in .pre-commit-config.yaml
24-
# Current runner uses Python 3.8, so the action installs bandit==1.7.10
25-
# via `pip install bandit[sarif]`. If runner Python moves to >=3.9,
26-
# the action will resolve to 1.8.x and you'll need to bump pre-commit.
27-
# (Bandit >=1.8.0 dropped Python 3.8 via Requires-Python metadata.)
28-
uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de # v1.0.0
22+
- name: Checkout
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
27+
28+
- name: Get ignore codes
29+
id: ignore-codes
30+
# This are computed so that we can run only the `S` (bandit)
31+
# checks. Passing --select to ruff overrides any config files
32+
# (ruff.toml, pyproject.toml, etc), so to avoid having keep everything
33+
# in sync we grab them from the TOML programmatically
34+
run: |
35+
set -euxo pipefail
36+
37+
echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT"
38+
- name: Perform Bandit Analysis using Ruff
39+
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
40+
with:
41+
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
42+
- name: Upload SARIF file
43+
uses: github/codeql-action/upload-sarif@v3
44+
with:
45+
sarif_file: results.sarif

.github/workflows/build-wheel.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
- "3.12"
3232
- "3.13"
3333
- "3.13t"
34+
- "3.14"
35+
- "3.14t"
3436
name: py${{ matrix.python-version }}
3537
runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') ||
3638
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
@@ -109,15 +111,6 @@ jobs:
109111

110112
- name: Build cuda.core wheel
111113
uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
112-
env:
113-
CIBW_BUILD: ${{ env.CIBW_BUILD }}
114-
CIBW_ARCHS_LINUX: "native"
115-
CIBW_BUILD_VERBOSITY: 1
116-
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
117-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
118-
CIBW_ENVIRONMENT: >
119-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
120-
CIBW_ENABLE: "cpython-freethreading"
121114
with:
122115
package-dir: ./cuda_core/
123116
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
@@ -152,20 +145,6 @@ jobs:
152145

153146
- name: Build cuda.bindings wheel
154147
uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
155-
env:
156-
CIBW_BUILD: ${{ env.CIBW_BUILD }}
157-
CIBW_ARCHS_LINUX: "native"
158-
CIBW_BUILD_VERBOSITY: 1
159-
# CIBW mounts the host filesystem under /host
160-
CIBW_ENVIRONMENT_LINUX: >
161-
CUDA_PATH=/host/${{ env.CUDA_PATH }}
162-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
163-
CIBW_ENVIRONMENT_WINDOWS: >
164-
CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})"
165-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
166-
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
167-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
168-
CIBW_ENABLE: "cpython-freethreading"
169148
with:
170149
package-dir: ./cuda_bindings/
171150
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
@@ -225,9 +204,11 @@ jobs:
225204
with:
226205
# workaround for actions/runner-images#12377 (the cached 3.13.4 is buggy on Windows)
227206
python-version: ${{ matrix.python-version == '3.13' && '3.13.5' || matrix.python-version }}
207+
# allow prereleases only fetches prereleases for unreleased versions of Python
208+
allow-prereleases: true
228209

229210
- name: verify free-threaded build
230-
if: endsWith(matrix.python-verison, 't')
211+
if: endsWith(matrix.python-version, 't')
231212
run: python -c 'import sys; assert not sys._is_gil_enabled()'
232213

233214
- name: Set up Python include paths
@@ -246,7 +227,7 @@ jobs:
246227
247228
- name: Build cuda.bindings Cython tests
248229
run: |
249-
pip install $(ls ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl)[test]
230+
pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test
250231
pushd ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}
251232
bash build_tests.sh
252233
popd
@@ -260,7 +241,7 @@ jobs:
260241

261242
- name: Build cuda.core Cython tests
262243
run: |
263-
pip install $(ls ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl)[test]
244+
pip install ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl --group ./cuda_core/pyproject.toml:test
264245
pushd ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
265246
bash build_tests.sh
266247
popd

.github/workflows/ci.yml

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,115 @@ jobs:
3232
cuda_build_ver=$(jq -r .cuda.build.version ci/versions.json)
3333
echo "cuda_build_ver=$cuda_build_ver" >> $GITHUB_OUTPUT
3434
35-
build:
35+
should-skip:
36+
runs-on: ubuntu-latest
37+
outputs:
38+
skip: ${{ steps.get-should-skip.outputs.skip }}
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
- name: Compute whether to skip builds and tests
43+
id: get-should-skip
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
set -euxo pipefail
48+
if ${{ startsWith(github.ref_name, 'pull-request/') }}; then
49+
skip="$(gh pr view "$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')" --json title --jq '.title | contains("[no-ci]")')"
50+
else
51+
skip=false
52+
fi
53+
echo "skip=${skip}" >> "$GITHUB_OUTPUT"
54+
55+
# WARNING: make sure all of the build jobs are in sync
56+
build-linux-64:
3657
needs:
3758
- ci-vars
59+
- should-skip
3860
strategy:
3961
fail-fast: false
4062
matrix:
4163
host-platform:
4264
- linux-64
65+
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
66+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
67+
secrets: inherit
68+
uses: ./.github/workflows/build-wheel.yml
69+
with:
70+
host-platform: ${{ matrix.host-platform }}
71+
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
72+
73+
# WARNING: make sure all of the build jobs are in sync
74+
build-linux-aarch64:
75+
needs:
76+
- ci-vars
77+
- should-skip
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
host-platform:
4382
- linux-aarch64
83+
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
84+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
85+
secrets: inherit
86+
uses: ./.github/workflows/build-wheel.yml
87+
with:
88+
host-platform: ${{ matrix.host-platform }}
89+
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
90+
91+
# WARNING: make sure all of the build jobs are in sync
92+
build-windows:
93+
needs:
94+
- ci-vars
95+
- should-skip
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
host-platform:
44100
- win-64
45101
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
46-
if: ${{ github.repository_owner == 'nvidia' }}
102+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
47103
secrets: inherit
48104
uses: ./.github/workflows/build-wheel.yml
49105
with:
50106
host-platform: ${{ matrix.host-platform }}
51107
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
52108

53-
test-linux:
109+
# WARNING: make sure both Linux test jobs are in sync
110+
test-linux-64:
54111
strategy:
55112
fail-fast: false
56113
matrix:
57114
host-platform:
58115
- linux-64
116+
name: Test ${{ matrix.host-platform }}
117+
if: ${{ github.repository_owner == 'nvidia' }}
118+
permissions:
119+
contents: read # This is required for actions/checkout
120+
needs:
121+
- ci-vars
122+
- build-linux-64
123+
secrets: inherit
124+
uses: ./.github/workflows/test-wheel-linux.yml
125+
with:
126+
build-type: pull-request
127+
host-platform: ${{ matrix.host-platform }}
128+
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
129+
130+
# WARNING: make sure both Linux test jobs are in sync
131+
test-linux-aarch64:
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
host-platform:
59136
- linux-aarch64
60137
name: Test ${{ matrix.host-platform }}
61138
if: ${{ github.repository_owner == 'nvidia' }}
62139
permissions:
63140
contents: read # This is required for actions/checkout
64141
needs:
65142
- ci-vars
66-
- build
143+
- build-linux-aarch64
67144
secrets: inherit
68145
uses: ./.github/workflows/test-wheel-linux.yml
69146
with:
@@ -83,7 +160,7 @@ jobs:
83160
contents: read # This is required for actions/checkout
84161
needs:
85162
- ci-vars
86-
- build
163+
- build-windows
87164
secrets: inherit
88165
uses: ./.github/workflows/test-wheel-windows.yml
89166
with:
@@ -101,20 +178,20 @@ jobs:
101178
pull-requests: write
102179
needs:
103180
- ci-vars
104-
- build
181+
- build-linux-64
105182
secrets: inherit
106183
uses: ./.github/workflows/build-docs.yml
107184
with:
108185
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
109186

110187
checks:
111188
name: Check job status
112-
permissions:
113-
checks: read
189+
runs-on: ubuntu-latest
114190
needs:
115-
- build
116-
- test-linux
191+
- test-linux-64
192+
- test-linux-aarch64
117193
- test-windows
118194
- doc
119-
secrets: inherit
120-
uses: ./.github/workflows/status-check.yml
195+
steps:
196+
- name: Exit
197+
run: exit 0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
name: "CI: Release"
66

7-
description: Manually-triggered release workflow. Creates a release draft if one doesn't exist for the given tag, or uses existing draft.
7+
# Manually-triggered release workflow. Creates a release draft if one doesn't exist for the given tag, or uses existing draft.
88

99
on:
1010
workflow_dispatch:

.github/workflows/status-check.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ jobs:
228228
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
229229
with:
230230
python-version: ${{ matrix.PY_VER }}
231+
allow-prereleases: true
231232
env:
232233
# we use self-hosted runners on which setup-python behaves weirdly...
233234
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
@@ -283,7 +284,7 @@ jobs:
283284
run: |
284285
set -euo pipefail
285286
pushd cuda_pathfinder
286-
pip install --only-binary=:all: -v ".[test_nvidia_wheels_cu${TEST_CUDA_MAJOR},test_nvidia_wheels_host]"
287+
pip install --only-binary=:all: -v . --group "test_nvidia_wheels_cu${TEST_CUDA_MAJOR}" --group test_nvidia_wheels_host
287288
pip list
288289
popd
289290

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ jobs:
213213
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
214214
with:
215215
python-version: ${{ matrix.PY_VER }}
216+
allow-prereleases: true
216217

217218
- name: Set up mini CTK
218219
if: ${{ matrix.LOCAL_CTK == '1' }}
@@ -256,7 +257,7 @@ jobs:
256257
shell: bash --noprofile --norc -xeuo pipefail {0}
257258
run: |
258259
pushd cuda_pathfinder
259-
pip install --only-binary=:all: -v ".[test_nvidia_wheels_cu${TEST_CUDA_MAJOR},test_nvidia_wheels_host]"
260+
pip install --only-binary=:all: -v . --group "test_nvidia_wheels_cu${TEST_CUDA_MAJOR}" --group test_nvidia_wheels_host
260261
pip list
261262
popd
262263

0 commit comments

Comments
 (0)