Skip to content

Commit ef9ecb8

Browse files
committed
test(cuda.core): clarify PDL graph capture doc references
Drop fragile Programming Guide section numbers and note Driver vs Runtime enum name equivalence at the edge asserts.
1 parent 552b20a commit ef9ecb8

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

cuda_core/tests/graph/test_graph_builder.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,19 +717,19 @@ def test_graph_definition_conditional_body_during_capture_raises(init_cuda):
717717
def test_pdl_launch_graph_capture(init_cuda):
718718
"""PDL LaunchConfig is graph-compatible via GraphBuilder stream capture.
719719
720-
Captures a producer then a secondary launch with
720+
Captures a first then a secondary launch with
721721
``programmatic_stream_serialization=True``, instantiates, and launches.
722722
Asserts functional correctness and that capture maps to a programmatic
723-
dependency edge (Programming Guide §4.5.3) — not kernel overlap.
723+
dependency edge (see Programming Guide, Programmatic Dependent Launch) —
724+
not kernel overlap.
724725
"""
725726

726727
def _assert_programmatic_dependency_edge(graph_definition):
727728
"""Assert capture of ProgrammaticStreamSerialization produced a programmatic edge.
728729
729-
Programming Guide §4.5.3: stream-capturing a secondary launch with
730-
``cudaLaunchAttributeProgrammaticStreamSerialization`` maps to
731-
``CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC`` with
732-
``CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC``.
730+
Per Programming Guide (Programmatic Dependent Launch): stream-capturing a
731+
secondary launch with ``cudaLaunchAttributeProgrammaticStreamSerialization``
732+
maps to a programmatic dependency edge from the programmatic kernel port.
733733
"""
734734
from cuda.bindings import driver
735735

@@ -740,6 +740,9 @@ def _assert_programmatic_dependency_edge(graph_definition):
740740
assert err == driver.CUresult.CUDA_SUCCESS, err
741741
assert num_edges == 1, f"expected 1 edge, got {num_edges}"
742742
ed = edge_data[0]
743+
# Driver (cuda.h) ↔ Runtime / Programming Guide (driver_types.h):
744+
# CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC ↔ cudaGraphDependencyTypeProgrammatic
745+
# CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC ↔ cudaGraphKernelNodePortProgrammatic
743746
assert ed.type == driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC, ed.type
744747
assert ed.from_port == driver.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, ed.from_port
745748

@@ -777,8 +780,8 @@ def test_pdl_primary_secondary_overlap_graph_capture(init_cuda):
777780
"""Primary + secondary PDL via GraphBuilder stream capture can overlap on Hopper+.
778781
779782
Same kernels / overlap protocol as test_pdl_primary_secondary_overlap_same_stream,
780-
but launches are captured into a CUDA graph (Programming Guide §4.5.3 stream-capture
781-
path). Overlap is opportunistic → miss is xfail.
783+
but launches are captured into a CUDA graph (see CUDA Programming Guide,
784+
Programmatic Dependent Launch). Overlap is opportunistic → miss is xfail.
782785
"""
783786
dev = Device()
784787
if dev.compute_capability < (9, 0):

0 commit comments

Comments
 (0)