Reorganize graph tests and add device-side launch support
Summary
This PR reorganizes the graph tests into a new tests/graph/ subdirectory, adds a public Graph.handle property, and introduces tests for device-side graph launch.
Closes #1331
Changes
Test Reorganization
- Create new
tests/graph/subdirectory following the pattern oftests/memory_ipc/ - Break apart
test_graph.pyinto logical groupings:-
test_basic.py: basic graph construction and topology tests -
test_conditional.py: conditional node tests (if, if-else, switch, while) -
test_advanced.py: child graphs, update, stream lifetime -
test_options.py: debug print, complete options, build mode
-
- Incorporate
test_graph_mem.py(renamed totest_capture_alloc.py) - Add shared kernel compilation helpers in
tests/helpers/graph_kernels.py
API Addition
- Add
Graph.handleproperty to expose the underlyingCUgraphExechandle - Follows the existing pattern of
Stream.handleandEvent.handle - Forward-compatible with future RAII handle refactoring
Device-Side Graph Launch Tests
- Add
test_device_launch.pywith tests for device-side graph launch - Uses
cudaGraphLaunch()from device code viacudaStreamGraphTailLaunch - Requires Hopper (sm_90+) architecture
- Uses
cuda.pathfinder.find_nvidia_header_directory()to locatelibcudadevrt.a
Test Coverage
- 58 tests total in
tests/graph/ - All tests pass on Hopper (H200)
- Device launch tests skip on pre-Hopper architectures
This pull request requires additional validation before any workflows can run on NVIDIA's runners.
Pull request vetters can view their responsibilities here.
Contributors can view more details about this message here.
/ok to test 6e30c531b293c44d3d45a4e4df3f22c377efe5ec
/ok to test 5c637332f
/ok to test da6205cc2
Doc Preview CI :---: |
:rocket: View preview athttps://nvidia.github.io/cuda-python/pr-preview/pr-1512/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-1512/cuda-core/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-1512/cuda-bindings/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-1512/cuda-pathfinder/
|
Preview will be ready when the GitHub Pages deployment is complete.
/ok to test 5711044498da128582c7e8fc1794d59a93320069
/ok to test acb0c979e54e75c0ab5c32d36e8d3c187dc3e21b