Repository navigation
test(cuda.core): run the driver (cuLink) linker tests by forcing the backend - #3649
Conversation
…backend test_linker_link_ptx_culink, test_driver_linker_lifetime_no_heap_corruption and test_driver_linker_preserves_error_log_after_close only ran when the linker fell back to the driver backend, which needs a missing or pre-12.3 nvJitLink. Every CI row has a current nvJitLink, so they never ran. Add a culink_backend fixture that forces the driver backend for one test by patching the backend globals in _linker (restored by monkeypatch). Only the selection is faked: the tests still call the real cuLink* APIs. The fixture also skips when the driver cannot load NVRTC's PTX, which every cuLink test needs; test_linker_link_ptx_culink lacked that guard. Remove the "not currently run in any CI job" markers. Closes NVIDIA#3572. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Summary
Change: Other Merge Risk:
|
|
jpascucci-nv
left a comment
There was a problem hiding this comment.
Sol 6.1 high finds no actionable findings. LGTM.
Closes #3572. Part of #2077.
Summary
Three driver-linker (cuLink) tests ran only when
cuda.corefalls back to the driver backend, which needs a missing or pre-12.3 nvJitLink. Every CI row has a current nvJitLink, so the driver backend, a supported fallback, was never tested:test_linker_link_ptx_culinktest_driver_linker_lifetime_no_heap_corruptiontest_driver_linker_preserves_error_log_after_closeA new
culink_backendfixture forces the driver backend for one test:cuLink*APIs.monkeypatchrestores the module state on teardown. EachLinkerrecords its backend at construction, so nothing created under the other backend is affected.test_linker_link_ptx_culinkdid not, and would have failed instead of skipping on CTK 13.5 rows.Evidence
CI coverage: the three tests should now run in the 35 CI configurations where the existing PTX-loading tests (for example
test_object_code_load_ptx) pass onmain. Those are every CTK 12.9.1 and 13.0.2 row: Linux x86-64 and aarch64, WSL, and Windows, on T4, V100, L4, A100, H100, RTX 4090 and RTX PRO 6000. On CTK 13.5 rows, NVRTC 13.5 PTX is too new for the installed driver, so they skip until #3579 is fixed.Locally: with the CUDA 13.0 toolkit's NVRTC (matching the CTK 13.0.2 rows), all three pass on the forced cuLink backend. The whole file passes in random order (125 passed, 7 skipped), so the backend state does not leak between tests.
Confirming in CI: in this PR's CI run, the CTK 12.9.1 and 13.0.2 cuda.core jobs should report all three tests PASSED, where
mainreports them SKIPPED. For example:Merge Danger
Door: two-way. Test-only change.
Blast Radius: three tests in
cuda_core/tests/test_linker.py. They now exercise the cuLink path on CTK 12.9/13.0 rows, so a real driver-backend regression would fail there, which is the point.Reviewers: please feel free to push commits directly to this PR to improve it.
🤖 Generated with Claude Code