Skip to content

Commit e85b170

Browse files
Merge upstream/main into fix-program-debug, superseded by NVIDIA#2679
NVIDIAgh-2385 and NVIDIAgh-2422 were filed for the same NVBug (6420444) and assigned to two people. NVIDIA#2679 landed the temp-file fix from NVIDIAgh-2422 first, so this branch's parallel implementation is dropped in favor of the one on main: keeping both would have left two mechanisms writing a source file on every debug compile, with the NVRTC name deciding which one was actually used. Resolved by taking main's side for every overlapping file and removing _jit_source.py, leaving this branch identical to main. What remains of NVIDIAgh-2385 is handled in follow-up commits.
2 parents 219dc35 + 33f2b42 commit e85b170

183 files changed

Lines changed: 15252 additions & 14583 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/build-wheel.yml‎

Lines changed: 69 additions & 84 deletions
Large diffs are not rendered by default.

‎.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)"

0 commit comments

Comments
 (0)