Skip to content

Commit 60ef3d0

Browse files
Andy-Jostclaude
andcommitted
test(cuda.core): run the IPC modules and two slow modules single-threaded under pytest-run-parallel
On the free-threaded CI rows, `ci/tools/run-tests` runs the cuda.core suite with `--parallel-threads=4`. By CI step timestamps of runs 35686532745 and 37506247862, the free-threaded core step costs 1.8x to 2.2x the GIL row of the same GPU. Part of that extra sits in modules where four threads do no useful work: Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 5078fe6 commit 60ef3d0

11 files changed

Lines changed: 30 additions & 19 deletions

‎cuda_core/tests/memory_ipc/test_errors.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
NBYTES = 64
2727

2828

29-
# these tests spawn new processes and files which fails for very many threads
30-
pytestmark = pytest.mark.parallel_threads_limit(4)
29+
# these tests spawn new processes and files which fails for very many threads;
30+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
31+
pytestmark = pytest.mark.parallel_threads_limit(1)
3132

3233

3334
def test_outer_timeout_marker_is_applied(request):

‎cuda_core/tests/memory_ipc/test_event_ipc.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
NBYTES = 64
1717

1818

19-
# these tetss spawn new processes and files which fails for very many threads
20-
pytestmark = pytest.mark.parallel_threads_limit(4)
19+
# these tests spawn new processes and files which fails for very many threads;
20+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
21+
pytestmark = pytest.mark.parallel_threads_limit(1)
2122

2223

2324
@pytest.mark.skipif(Device().compute_capability.major < 7, reason="__nanosleep is only available starting Volta (sm70)")

‎cuda_core/tests/memory_ipc/test_ipc_concurrent_import.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
NBYTES = 64
2929
THREADS = 4
3030

31-
# these tests spawn new processes and files which fails for very many threads
32-
pytestmark = pytest.mark.parallel_threads_limit(4)
31+
# these tests spawn new processes and files which fails for very many threads;
32+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
33+
pytestmark = pytest.mark.parallel_threads_limit(1)
3334

3435

3536
def child_main(queue):

‎cuda_core/tests/memory_ipc/test_ipc_duplicate_import.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323

2424
ENABLE_LOGGING = False # Set True for test debugging and development
2525

26-
# these tests spawn new processes and files which fails for very many threads
27-
pytestmark = pytest.mark.parallel_threads_limit(4)
26+
# these tests spawn new processes and files which fails for very many threads;
27+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
28+
pytestmark = pytest.mark.parallel_threads_limit(1)
2829

2930

3031
def child_main(log, queue):

‎cuda_core/tests/memory_ipc/test_memory_ipc.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
NWORKERS = 2
1515
NTASKS = 2
1616

17-
# these tests spawn new processes and files which fails for very many threads
18-
pytestmark = pytest.mark.parallel_threads_limit(4)
17+
# these tests spawn new processes and files which fails for very many threads;
18+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
19+
pytestmark = pytest.mark.parallel_threads_limit(1)
1920

2021

2122
class TestIpcMempool:

‎cuda_core/tests/memory_ipc/test_peer_access.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
CHILD_TIMEOUT_SEC = child_timeout_sec()
1515
NBYTES = 64
1616

17-
# these tests spawn new processes and files which fails for very many threads
18-
pytestmark = pytest.mark.parallel_threads_limit(4)
17+
# these tests spawn new processes and files which fails for very many threads;
18+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
19+
pytestmark = pytest.mark.parallel_threads_limit(1)
1920

2021

2122
class TestPeerAccessNotPreservedOnImport:

‎cuda_core/tests/memory_ipc/test_send_buffers.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
NMRS = 3
1717
NTASKS = 7
1818

19-
# these tests spawn new processes and files which fails for very many threads
20-
pytestmark = pytest.mark.parallel_threads_limit(4)
19+
# these tests spawn new processes and files which fails for very many threads;
20+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
21+
pytestmark = pytest.mark.parallel_threads_limit(1)
2122

2223

2324
class TestIpcSendBuffers:

‎cuda_core/tests/memory_ipc/test_serialize.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
CHILD_TIMEOUT_SEC = child_timeout_sec()
1515
NBYTES = 64
1616

17-
# these tests spawn new processes and files which fails for very many threads
18-
pytestmark = pytest.mark.parallel_threads_limit(4)
17+
# these tests spawn new processes and files which fails for very many threads;
18+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
19+
pytestmark = pytest.mark.parallel_threads_limit(1)
1920

2021

2122
class TestObjectSerializationDirect:

‎cuda_core/tests/memory_ipc/test_workerpool.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
NMRS = 3
1717
NTASKS = 20
1818

19-
# these tests spawn new processes and files which fails for very many threads
20-
pytestmark = pytest.mark.parallel_threads_limit(4)
19+
# these tests spawn new processes and files which fails for very many threads;
20+
# child processes and IPC fixtures are shared across workers (#2784); run single-threaded
21+
pytestmark = pytest.mark.parallel_threads_limit(1)
2122

2223

2324
class TestIpcWorkerPool:

‎cuda_core/tests/system/test_system_device.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def test_unpack_bitmask_single_value():
286286
_device._unpack_bitmask(1)
287287

288288

289-
@pytest.mark.parallel_threads_limit(4) # timeouts are slow
289+
@pytest.mark.parallel_threads_limit(1) # timeouts are slow
290290
@pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Events not supported on WSL or Windows")
291291
@skip_if_nvml_device_apis_unsupported
292292
def test_register_events():

0 commit comments

Comments
 (0)