Skip to content

Commit 0371a37

Browse files
committed
test(cuda.core): rename PDL overlap tests to emphasize same-stream
Both direct and graph-capture paths are same-stream; update names and docs accordingly.
1 parent daa6d49 commit 0371a37

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

cuda_core/tests/graph/test_graph_builder.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,7 @@ def _assert_programmatic_dependency_edge(graph_definition):
776776

777777
@skipif_need_cuda_headers
778778
@requires_module(np, "2.2.5", reason="need numpy 2.2.5+ (numpy GH #28632)")
779-
def test_pdl_primary_secondary_overlap_graph_capture(init_cuda):
780-
"""Primary + secondary PDL via GraphBuilder stream capture can overlap on Hopper+.
781-
782-
Same kernels / overlap protocol as test_pdl_primary_secondary_overlap_same_stream,
783-
but launches are captured into a CUDA graph (see CUDA Programming Guide,
784-
Programmatic Dependent Launch). Overlap is opportunistic → miss is xfail.
779+
def test_pdl_same_stream_primary_secondary_overlap_via_graph(init_cuda):
780+
"""Same-stream PDL overlap via GraphBuilder stream capture on Hopper+.
785781
"""
786782
run_pdl_overlap_check(Device(), via_graph=True)

cuda_core/tests/helpers/pdl_kernels.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ def compile_pdl_overlap_kernels(device):
5353

5454

5555
def run_pdl_overlap_check(device, *, via_graph: bool = False):
56-
"""Run the shared primary/secondary PDL overlap protocol.
56+
"""Run the shared same-stream primary/secondary PDL overlap protocol.
5757
58-
Asserts no overlap without ``programmatic_stream_serialization``, then retries
59-
a few times with it enabled. Overlap is opportunistic → miss is xfail.
58+
Both paths launch primary then secondary on one stream. Asserts no overlap
59+
without ``programmatic_stream_serialization``, then retries a few times with
60+
it enabled. Overlap is opportunistic → miss is xfail.
6061
6162
Args:
6263
device: Current CUDA device (compute capability >= 9.0 required).
63-
via_graph: If True, capture launches into a CUDA graph and launch the
64-
graph; otherwise launch kernels directly on the stream.
64+
via_graph: If True, stream-capture the same-stream launches into a CUDA
65+
graph and launch that graph; otherwise launch kernels directly.
6566
"""
6667
if device.compute_capability < (9, 0):
6768
pytest.skip("Programmatic Dependent Launch requires compute capability >= 9.0")
@@ -97,7 +98,7 @@ def _run(secondary_launch_cfg: LaunchConfig) -> int:
9798
stream.sync()
9899
return int(overlapped[0])
99100

100-
path = "graph-capture" if via_graph else "same-stream"
101+
path = "same-stream (graph)" if via_graph else "same-stream"
101102
assert _run(secondary_serial_cfg) == 0, (
102103
f"Expected no overlap when programmatic_stream_serialization is False ({path})"
103104
)

cuda_core/tests/test_launcher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ def test_to_native_launch_config_pdl():
205205

206206
@skipif_need_cuda_headers
207207
@requires_module(np, "2.2.5", reason="need numpy 2.2.5+ (numpy GH #28632)")
208-
def test_pdl_primary_secondary_overlap_same_stream(init_cuda):
209-
"""Primary + secondary PDL launch on one stream can overlap on Hopper+.
208+
def test_pdl_same_stream_primary_secondary_overlap(init_cuda):
209+
"""Same-stream primary + secondary PDL launch can overlap on Hopper+.
210210
211211
Secondary is launched with ``programmatic_stream_serialization=True``. After
212212
the primary triggers completion, it spins until it observes a flag written by
213213
the secondary's independent preamble — proving both grids were resident at
214-
once. Without PDL, the secondary cannot start until the primary exits.
214+
once. Without PDL, same-stream kernels stay serialized.
215215
216216
Note concurrency is opportunistic, so a missing overlap execution is reported as
217217
an expected failure.

0 commit comments

Comments
 (0)