Skip to content

Commit 1516ca8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into kkraus14→agent/selective-ci-orchestration
2 parents ceaae51 + f687d34 commit 1516ca8

205 files changed

Lines changed: 15125 additions & 16183 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/RELEASE-core.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ platforms as appropriate for each release.
6464
Review `cuda_core/pyproject.toml` and verify that all dependency
6565
requirements are current.
6666

67+
Update the cuda_core dependency in `cuda_python/setup.py`.
68+
6769
---
6870

6971
## Sweep deprecations whose removal version has arrived

‎.github/workflows/ci-pixi-source-test.yml‎

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
# - build-smoke (PRs): CPU-only. Source-builds bindings + core, imports them,
1616
# builds the cython test extensions and checks placement. Catches the
1717
# compile / ABI / .so-placement regressions WITHOUT a GPU.
18+
# - build-identity-roundtrip (nightly + manual): CPU-only. cu13 -> cu12 ->
19+
# cu13 in one checkout, so build artifacts cannot be reused across CUDA
20+
# majors. Kept off PRs to avoid adding another job to the org's shared
21+
# concurrent-job quota; the fast unit tests in
22+
# cuda_core/tests/test_build_hooks.py cover the same intent per-PR.
1823
# - full-test (nightly + manual): GPU runner, full `pixi run test`.
1924

2025
name: "CI: pixi run test (source build)"
@@ -62,7 +67,9 @@ jobs:
6267
# ── PR guard: CPU-only build + import + placement smoke ──
6368
build-smoke:
6469
name: "build smoke (cu13, linux-64, CPU)"
65-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
70+
if: >-
71+
github.repository_owner == 'nvidia' &&
72+
(github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
6673
runs-on: ubuntu-latest
6774
timeout-minutes: 45
6875
steps:
@@ -108,6 +115,63 @@ jobs:
108115
done
109116
echo "cython test extensions placed correctly"
110117
118+
# ── Nightly guard: build artifacts must be CUDA-major aware ──
119+
#
120+
# Neither Cython nor setuptools tracks the CUDA major in its own up-to-date
121+
# check: Cython does not hash `compile_time_env`, and an editable install's
122+
# .so is named by the Python ABI tag alone. Before build_hooks keyed them,
123+
# a cu13 build followed by a cu12 build in the same checkout failed while
124+
# compiling cu13-generated C++ against CUDA 12 headers.
125+
#
126+
# The round trip (not just cu13 -> cu12) is what catches the second half:
127+
# coming back to cu13 must not silently reuse the cu12 extension.
128+
#
129+
# cuda_core only: cuda_bindings cannot be source-built in its cu12
130+
# environment at all, for reasons unrelated to stale artifacts.
131+
build-identity-roundtrip:
132+
name: "cu13 -> cu12 -> cu13 round trip (linux-64, CPU)"
133+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository_owner == 'nvidia' }}
134+
runs-on: ubuntu-latest
135+
timeout-minutes: 60
136+
steps:
137+
- name: Checkout ${{ github.event.repository.name }}
138+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
139+
with:
140+
# Full history + tags so setuptools-scm derives the real (13.x)
141+
# package version; a shallow checkout yields 0.1.dev1, which trips
142+
# cuda.core's "cuda.bindings 12.x or 13.x must be installed" guard.
143+
fetch-depth: 0
144+
145+
- name: Setup pixi
146+
# Pinned to a commit SHA; install logic lives in the action and is
147+
# auditable/pinned (vs. a curl|bash of an unverified installer).
148+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
149+
with:
150+
pixi-version: ${{ env.PIXI_VERSION }}
151+
run-install: false
152+
153+
- name: Build cu13, then cu12, then cu13 again in one checkout
154+
run: |
155+
for cuda_env in cu13 cu12 cu13; do
156+
echo "::group::${cuda_env}"
157+
pixi run --manifest-path cuda_core -e "${cuda_env}" \
158+
python -c "import cuda.core; print('core import OK')"
159+
echo "::endgroup::"
160+
done
161+
# The last build was cu13, and each major must have kept its own
162+
# generated sources rather than overwriting the other's.
163+
stamp=$(cat cuda_core/build/.build-cuda-major)
164+
if [ "${stamp}" != "13" ]; then
165+
echo "::error::build stamp is '${stamp}', expected 13"
166+
exit 1
167+
fi
168+
for major in cu12 cu13; do
169+
if [ ! -d "cuda_core/build/cython/${major}" ]; then
170+
echo "::error::no ${major} generated-source directory"
171+
exit 1
172+
fi
173+
done
174+
111175
# ── Nightly: full `pixi run test` on a GPU runner ──
112176
full-test:
113177
name: "pixi run test (${{ inputs.cuda-env || 'cu13' }}, linux-64, GPU)"

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ on:
2828

2929
jobs:
3030
ci-vars:
31+
if: ${{ github.repository_owner == 'nvidia' }}
3132
runs-on: ubuntu-latest
3233
outputs:
3334
CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }}
@@ -47,6 +48,7 @@ jobs:
4748
echo "cuda_prev_build_ver=$cuda_prev_build_ver" >> $GITHUB_OUTPUT
4849
4950
should-skip:
51+
if: ${{ github.repository_owner == 'nvidia' }}
5052
runs-on: ubuntu-latest
5153
permissions:
5254
contents: read
@@ -100,6 +102,7 @@ jobs:
100102
# unconditionally run everything because there is no meaningful "changed
101103
# paths" baseline for those events.
102104
detect-changes:
105+
if: ${{ github.repository_owner == 'nvidia' }}
103106
runs-on: ubuntu-latest
104107
needs: should-skip
105108
permissions:
@@ -601,7 +604,7 @@ jobs:
601604
602605
checks:
603606
name: Check job status
604-
if: always()
607+
if: ${{ always() && github.repository_owner == 'nvidia' }}
605608
runs-on: ubuntu-latest
606609
needs:
607610
- ci-vars

‎.github/workflows/coverage.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717

1818
jobs:
1919
coverage-vars:
20+
if: ${{ github.repository_owner == 'nvidia' }}
2021
runs-on: ubuntu-latest
2122
outputs:
2223
CUDA_VER: ${{ steps.get-vars.outputs.cuda_ver }}
@@ -467,7 +468,7 @@ jobs:
467468
name: Combine Coverage and Deploy
468469
needs: [coverage-linux, coverage-windows]
469470
runs-on: ubuntu-latest
470-
if: always()
471+
if: ${{ always() && github.repository_owner == 'nvidia' }}
471472
permissions:
472473
id-token: write
473474
contents: write

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
# Collect release metadata, find the CI run, create a draft release.
3434
# --------------------------------------------------------------------------
3535
prepare:
36+
if: ${{ github.repository_owner == 'nvidia' }}
3637
runs-on: ubuntu-latest
3738
permissions:
3839
contents: write

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ defaults:
7676

7777
jobs:
7878
determine-run-id:
79+
if: ${{ github.repository_owner == 'nvidia' }}
7980
runs-on: ubuntu-latest
8081
outputs:
8182
run-id: ${{ steps.lookup-run-id.outputs.run-id }}
@@ -103,6 +104,7 @@ jobs:
103104
echo "run-id=$RUN_ID" >> "$GITHUB_OUTPUT"
104105
105106
check-tag:
107+
if: ${{ github.repository_owner == 'nvidia' }}
106108
runs-on: ubuntu-latest
107109
steps:
108110
- name: Checkout Source
@@ -154,6 +156,7 @@ jobs:
154156
fi
155157
156158
check-release-notes:
159+
if: ${{ github.repository_owner == 'nvidia' }}
157160
runs-on: ubuntu-latest
158161
steps:
159162
- name: Checkout Source

‎.github/workflows/security-suite.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ permissions:
3131
jobs:
3232
security-suite:
3333
name: Security Suite
34-
# Pulse needs nv-gha-runners + Vault/nvcr vars; skip on forks.
35-
if: github.repository == 'NVIDIA/cuda-python'
34+
# Repository-specific workflow opt-ins use CI_CUSTOMIZATIONS_* Actions variables;
35+
# see ci/README.md. Enable this only after the security-suite prerequisites exist.
36+
if: >-
37+
github.repository == 'NVIDIA/cuda-python' ||
38+
vars.CI_CUSTOMIZATIONS_SECURITY_SUITE_ENABLED == 'true'
3639
uses: NVIDIA/security-workflows/.github/workflows/security-suite.yml@711025b090f2aa728da576700750b195d1e816dc # v0.3.0
3740
with:
3841
enable-secret-scan: true

‎.github/workflows/triagelabel.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
triage:
15+
if: ${{ github.repository_owner == 'nvidia' }}
1516
runs-on: ubuntu-latest
1617
permissions:
1718
issues: write

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ repos:
8383

8484
- id: stubgen-pyx-cuda-core
8585
name: Generate .pyi stubs for cuda_core
86-
entry: python ./toolshed/run_stubgen_pyx.py
86+
entry: python -X utf8 -m stubgen_pyx cuda_core/cuda --continue-on-error --include-private
8787
language: python
8888
files: ^cuda_core/cuda/.*\.(pyx|pxd)$
8989
pass_filenames: false
9090
additional_dependencies:
91-
- stubgen-pyx==0.2.6
91+
- stubgen-pyx==0.2.19
9292
- Cython==3.2.9
9393

9494
# Link checking for authored documentation files
@@ -97,6 +97,7 @@ repos:
9797
hooks:
9898
- id: lychee
9999
args:
100+
- LYCHEE_VERSION=0.24.2 # Must match the pinned rev above
100101
- --cache
101102
- --max-concurrency=4
102103
- --max-retries=3
@@ -167,6 +168,8 @@ repos:
167168
- id: cython-lint
168169
args: [--no-pycodestyle]
169170
exclude: ^cuda_bindings/
171+
additional_dependencies:
172+
- Cython==3.2.9
170173

171174

172175
default_language_version:

‎ci/README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Continuous Integration
2+
3+
## Repository Customizations
4+
5+
The workflows in this repository use the `CI_CUSTOMIZATIONS_*` namespace for
6+
GitHub Actions configuration variables that opt an alternative synchronized
7+
repository into repository-specific CI behavior. This keeps the workflow logic
8+
shared without hard-coding the names of private repositories into the public
9+
source tree.
10+
11+
These variables are non-secret strings configured under
12+
**Settings > Secrets and variables > Actions > Variables**.
13+
An unset variable, or any value other than the literal string `true`, leaves
14+
the customization disabled. Do not store credentials or other secret values in
15+
these variables.
16+
17+
| Variable | Default | Purpose |
18+
| --- | --- | --- |
19+
| `CI_CUSTOMIZATIONS_SECURITY_SUITE_ENABLED` | Disabled | Enables the NVIDIA Security Suite after its runner, Actions variables, and OIDC/Vault authorization have been provisioned for the repository. |
20+
21+
The canonical `NVIDIA/cuda-python` repository does not need this variable
22+
because its standard workflow behavior is enabled directly. Before enabling a
23+
customization elsewhere, document the repository-specific prerequisites and
24+
verification procedure in that repository's own documentation.

0 commit comments

Comments
 (0)