Skip to content

Commit d38b8e3

Browse files
authored
[None][ci] set TORCHINDUCTOR_COMPILE_THREADS for thop/parallel tests (#7489)
Signed-off-by: junq <[email protected]>
1 parent 4e3dded commit d38b8e3

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

tests/integration/defs/agg_unit_mem_df.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ unittest/trt/model/test_mamba.py,NVIDIA H100,10,
104104
unittest/_torch/attention,NVIDIA Graphics Device,4,B200 Bring Up Board
105105
unittest/_torch/misc,NVIDIA Graphics Device,4,B200 Bring Up Board
106106
unittest/_torch/speculative,NVIDIA Graphics Device,4,B200 Bring Up Board
107-
unittest/_torch/thop/parallel,NVIDIA Graphics Device,4,B200 Bring Up Board
107+
unittest/_torch/thop/parallel,NVIDIA Graphics Device,16,B200 Bring Up Board
108108
"unittest/_torch/auto_deploy/unit/singlegpu -k ""not test_trtllm_bench_backend_comparison""",NVIDIA Graphics Device,4,B200 Bring Up Board
109109
unittest/_torch/attention,NVIDIA B200,4,
110110
unittest/_torch/misc,NVIDIA B200,4,
111111
unittest/_torch/speculative,NVIDIA B200,4,
112-
unittest/_torch/thop/parallel,NVIDIA B200,4,
112+
unittest/_torch/thop/parallel,NVIDIA B200,16,
113113
"unittest/_torch/auto_deploy/unit/singlegpu -k ""not test_trtllm_bench_backend_comparison""",NVIDIA B200,4,
114114
unittest/_torch/attention,NVIDIA H100,4,
115115
unittest/_torch/misc,NVIDIA H100,4,
116116
unittest/_torch/speculative,NVIDIA H100,2,
117-
unittest/_torch/thop/parallel,NVIDIA H100,4,
117+
unittest/_torch/thop/parallel,NVIDIA H100,16,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
3+
import pytest
4+
5+
6+
@pytest.fixture(autouse=True, scope='function')
7+
def set_torchinductor_compile_threads():
8+
"""
9+
Fixture to set TORCHINDUCTOR_COMPILE_THREADS=1 for tests in this directory.
10+
"""
11+
# --- Setup Phase ---
12+
# Save the original value if it exists
13+
original_value = os.environ.get('TORCHINDUCTOR_COMPILE_THREADS')
14+
15+
# Set the desired value for the test
16+
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'
17+
18+
# Let the test run with the new environment variable
19+
yield
20+
21+
# --- Teardown Phase ---
22+
# Restore the original environment state after the test is done
23+
if original_value is None:
24+
# If the variable didn't exist before, remove it
25+
del os.environ['TORCHINDUCTOR_COMPILE_THREADS']
26+
else:
27+
# Otherwise, restore its original value
28+
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = original_value

tests/unittest/pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[pytest]
2+
xdist_start_method = spawn
23
asyncio_default_fixture_loop_scope = module
34
threadleak = True
45
threadleak_exclude = asyncio_\d+

0 commit comments

Comments
 (0)