|
15 | 15 | # - build-smoke (PRs): CPU-only. Source-builds bindings + core, imports them, |
16 | 16 | # builds the cython test extensions and checks placement. Catches the |
17 | 17 | # 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. |
18 | 23 | # - full-test (nightly + manual): GPU runner, full `pixi run test`. |
19 | 24 |
|
20 | 25 | name: "CI: pixi run test (source build)" |
|
62 | 67 | # ── PR guard: CPU-only build + import + placement smoke ── |
63 | 68 | build-smoke: |
64 | 69 | 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') |
66 | 73 | runs-on: ubuntu-latest |
67 | 74 | timeout-minutes: 45 |
68 | 75 | steps: |
@@ -108,6 +115,63 @@ jobs: |
108 | 115 | done |
109 | 116 | echo "cython test extensions placed correctly" |
110 | 117 |
|
| 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 | +
|
111 | 175 | # ── Nightly: full `pixi run test` on a GPU runner ── |
112 | 176 | full-test: |
113 | 177 | name: "pixi run test (${{ inputs.cuda-env || 'cu13' }}, linux-64, GPU)" |
|
0 commit comments