@@ -405,11 +405,37 @@ def test_discovery_mode(self, sm_resource):
405405 assert len (groups ) == 1
406406 assert groups [0 ].sm_count >= sm_resource .min_partition_size
407407
408- def test_discovery_respects_alignment (self , sm_resource ):
408+ @pytest .mark .agent_authored (model = "gpt-5.6-sol" )
409+ def test_by_count_discovery_respects_alignment (self , sm_resource ):
410+ """CUDA 12 SplitByCount discovery returns an aligned SM count."""
411+ if binding_version ()[0 ] != 12 :
412+ pytest .skip ("test covers the CUDA 12 SplitByCount path" )
413+
409414 groups , _ = sm_resource .split (SMResourceOptions (count = None ))
410415
411- if sm_resource .coscheduled_alignment > 0 :
412- assert groups [0 ].sm_count % sm_resource .coscheduled_alignment == 0
416+ assert groups [0 ].sm_count % sm_resource .coscheduled_alignment == 0
417+
418+ def test_discovery_respects_explicit_coscheduled_sm_count (self , sm_resource ):
419+ """Constrain discovery explicitly because unconstrained discovery may use all SMs."""
420+ if driver_version () < (13 , 1 , 0 ):
421+ pytest .skip ("explicit co-scheduled SM discovery requires CUDA 13.1+" )
422+
423+ alignment = sm_resource .coscheduled_alignment
424+ try :
425+ groups , _ = sm_resource .split (
426+ SMResourceOptions (
427+ count = None ,
428+ coscheduled_sm_count = alignment ,
429+ )
430+ )
431+ except RuntimeError as exc :
432+ pytest .skip (str (exc ))
433+ except CUDAError as exc :
434+ if _is_invalid_resource_configuration (exc ):
435+ pytest .skip (str (exc ))
436+ raise
437+
438+ assert groups [0 ].sm_count % alignment == 0
413439
414440 def test_two_groups (self , sm_resource ):
415441 """Two-group split succeeds for a supported explicit request."""
0 commit comments