Skip to content

Commit 320e2c5

Browse files
authored
Use PYTEST_MAX_PROCESSES to limit (#2316)
This environment variable can be set in a specific runner to limit the number of pytest processes. Also remove --reruns for regression tests. Fixes #2275.
1 parent ea16cdc commit 320e2c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/test-triton.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ run_core_tests() {
177177
ensure_spirv_dis
178178

179179
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=language \
180-
pytest -vvv -n 8 --device xpu language/ --ignore=language/test_line_info.py --ignore=language/test_subprocess.py
180+
pytest -vvv -n ${PYTEST_MAX_PROCESSES:-8} --device xpu language/ --ignore=language/test_line_info.py --ignore=language/test_subprocess.py
181181

182182
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=subprocess \
183-
pytest -vvv -n 8 --device xpu language/test_subprocess.py
183+
pytest -vvv -n ${PYTEST_MAX_PROCESSES:-8} --device xpu language/test_subprocess.py
184184

185185
# run runtime tests serially to avoid race condition with cache handling.
186186
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=runtime \
@@ -198,7 +198,7 @@ run_regression_tests() {
198198
cd $TRITON_PROJ/python/test/regression
199199

200200
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=regression \
201-
pytest -vvv -s --device xpu . --reruns 10 --ignore=test_performance.py
201+
pytest -vvv -s --device xpu . --ignore=test_performance.py
202202
}
203203

204204
run_interpreter_tests() {
@@ -208,11 +208,11 @@ run_interpreter_tests() {
208208
cd $TRITON_PROJ/python/test/unit
209209

210210
TRITON_INTERPRET=1 TRITON_TEST_SUITE=interpreter \
211-
pytest -vvv -n 16 -m interpreter language/test_core.py language/test_standard.py \
211+
pytest -vvv -n ${PYTEST_MAX_PROCESSES:-16} -m interpreter language/test_core.py language/test_standard.py \
212212
language/test_random.py --device cpu
213213

214214
TRITON_DISABLE_LINE_INFO=0 TRITON_INTERPRET=1 TRITON_TEST_SUITE=interpreter_line_info \
215-
pytest -vvv -n 4 -m interpreter language/test_line_info.py --device cpu
215+
pytest -vvv -n ${PYTEST_MAX_PROCESSES:-4} -m interpreter language/test_line_info.py --device cpu
216216
}
217217

218218
run_tutorial_tests() {

0 commit comments

Comments
 (0)