From 369e8b283083a3440c59431a9438ca17afb73e4e Mon Sep 17 00:00:00 2001 From: driazati <9407960+driazati@users.noreply.github.com> Date: Fri, 12 Aug 2022 09:04:43 -0700 Subject: [PATCH] [ci] Default to n=2 for test parallelism (#12376) This decreases the test times for most of the tests except a few that did not run under pytest-xdist with 2 worker nodes. This also doesn't decrease overall runtime since CI is still bottlenecked on other jobs. However, this could lead to savings in compute which makes CI more sustainable so this is still worthwhile, though we should revert this if we start seeing "weird" errors like OOMs more often. --- Jenkinsfile | 59 +++++++++++++++++++++++++++++-- ci/jenkins/Jenkinsfile.j2 | 2 +- ci/jenkins/macros.j2 | 3 ++ tests/scripts/setup-pytest-env.sh | 8 ++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec6793c80a8c..fb8b31e2882d 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ // 'python3 jenkins/generate.py' // Note: This timestamp is here to ensure that updates to the Jenkinsfile are // always rebased on main before merging: -// Generated at 2022-08-11T13:17:04.679404 +// Generated at 2022-08-11T15:56:40.509448 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. --> @@ -94,7 +94,7 @@ properties([ upstream_revision = null // command to start a docker container -docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM --env SKIP_SLOW_TESTS' +docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM --env SKIP_SLOW_TESTS --env TEST_STEP_NAME' docker_build = 'docker/build.sh' // timeout in minutes max_time = 180 @@ -589,6 +589,7 @@ def lint() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'TVM_NUM_SHARDS=2', + 'TEST_STEP_NAME=Lint', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh ( @@ -608,6 +609,7 @@ def lint() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'TVM_NUM_SHARDS=2', + 'TEST_STEP_NAME=Lint', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh ( @@ -1153,6 +1155,7 @@ def shard_run_unittest_GPU_1_of_3() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=unittest: GPU', 'TVM_NUM_SHARDS=3', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1268,6 +1271,7 @@ def shard_run_unittest_GPU_2_of_3() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=unittest: GPU', 'TVM_NUM_SHARDS=3', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1349,6 +1353,7 @@ def shard_run_unittest_GPU_3_of_3() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=unittest: GPU', 'TVM_NUM_SHARDS=3', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1427,6 +1432,7 @@ def shard_run_integration_CPU_1_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1502,6 +1508,7 @@ def shard_run_integration_CPU_2_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1577,6 +1584,7 @@ def shard_run_integration_CPU_3_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1652,6 +1660,7 @@ def shard_run_integration_CPU_4_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1727,6 +1736,7 @@ def shard_run_integration_CPU_5_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1802,6 +1812,7 @@ def shard_run_integration_CPU_6_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1877,6 +1888,7 @@ def shard_run_integration_CPU_7_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=6', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -1952,6 +1964,7 @@ def shard_run_integration_CPU_8_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=7', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2027,6 +2040,7 @@ def shard_run_integration_CPU_9_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=8', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2102,6 +2116,7 @@ def shard_run_integration_CPU_10_of_10() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cpu', + 'TEST_STEP_NAME=integration: CPU', 'TVM_NUM_SHARDS=10', 'TVM_SHARD_INDEX=9', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2178,6 +2193,7 @@ def shard_run_python_i386_1_of_5() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=i386', + 'TEST_STEP_NAME=python: i386', 'TVM_NUM_SHARDS=5', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2253,6 +2269,7 @@ def shard_run_python_i386_2_of_5() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=i386', + 'TEST_STEP_NAME=python: i386', 'TVM_NUM_SHARDS=5', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2328,6 +2345,7 @@ def shard_run_python_i386_3_of_5() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=i386', + 'TEST_STEP_NAME=python: i386', 'TVM_NUM_SHARDS=5', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2402,6 +2420,7 @@ def shard_run_python_i386_4_of_5() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=i386', + 'TEST_STEP_NAME=python: i386', 'TVM_NUM_SHARDS=5', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2476,6 +2495,7 @@ def shard_run_python_i386_5_of_5() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=i386', + 'TEST_STEP_NAME=python: i386', 'TVM_NUM_SHARDS=5', 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2551,6 +2571,7 @@ def shard_run_test_Hexagon_1_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2625,6 +2646,7 @@ def shard_run_test_Hexagon_2_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2698,6 +2720,7 @@ def shard_run_test_Hexagon_3_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2771,6 +2794,7 @@ def shard_run_test_Hexagon_4_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2844,6 +2868,7 @@ def shard_run_test_Hexagon_5_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2917,6 +2942,7 @@ def shard_run_test_Hexagon_6_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -2990,6 +3016,7 @@ def shard_run_test_Hexagon_7_of_7() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=hexagon', + 'TEST_STEP_NAME=test: Hexagon', 'TVM_NUM_SHARDS=7', 'TVM_SHARD_INDEX=6', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3064,6 +3091,7 @@ def shard_run_integration_aarch64_1_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=integration: aarch64', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3138,6 +3166,7 @@ def shard_run_integration_aarch64_2_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=integration: aarch64', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3212,6 +3241,7 @@ def shard_run_integration_aarch64_3_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=integration: aarch64', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3286,6 +3316,7 @@ def shard_run_integration_aarch64_4_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=integration: aarch64', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3361,6 +3392,7 @@ def shard_run_topi_GPU_1_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=topi: GPU', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3434,6 +3466,7 @@ def shard_run_topi_GPU_2_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=topi: GPU', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3507,6 +3540,7 @@ def shard_run_topi_GPU_3_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=topi: GPU', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3580,6 +3614,7 @@ def shard_run_topi_GPU_4_of_4() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=topi: GPU', 'TVM_NUM_SHARDS=4', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3654,6 +3689,7 @@ def shard_run_frontend_GPU_1_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3727,6 +3763,7 @@ def shard_run_frontend_GPU_2_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3800,6 +3837,7 @@ def shard_run_frontend_GPU_3_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3873,6 +3911,7 @@ def shard_run_frontend_GPU_4_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -3946,6 +3985,7 @@ def shard_run_frontend_GPU_5_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4019,6 +4059,7 @@ def shard_run_frontend_GPU_6_of_6() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=gpu', + 'TEST_STEP_NAME=frontend: GPU', 'TVM_NUM_SHARDS=6', 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4093,6 +4134,7 @@ def shard_run_topi_aarch64_1_of_2() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=topi: aarch64', 'TVM_NUM_SHARDS=2', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4171,6 +4213,7 @@ def shard_run_topi_aarch64_2_of_2() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=topi: aarch64', 'TVM_NUM_SHARDS=2', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4249,6 +4292,7 @@ def shard_run_frontend_aarch64_1_of_2() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=frontend: aarch64', 'TVM_NUM_SHARDS=2', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4322,6 +4366,7 @@ def shard_run_frontend_aarch64_2_of_2() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=arm', + 'TEST_STEP_NAME=frontend: aarch64', 'TVM_NUM_SHARDS=2', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4396,6 +4441,7 @@ def shard_run_test_Cortex_M_1_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4474,6 +4520,7 @@ def shard_run_test_Cortex_M_2_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4547,6 +4594,7 @@ def shard_run_test_Cortex_M_3_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4620,6 +4668,7 @@ def shard_run_test_Cortex_M_4_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4693,6 +4742,7 @@ def shard_run_test_Cortex_M_5_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4766,6 +4816,7 @@ def shard_run_test_Cortex_M_6_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4839,6 +4890,7 @@ def shard_run_test_Cortex_M_7_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=6', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -4912,6 +4964,7 @@ def shard_run_test_Cortex_M_8_of_8() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM=cortexm', + 'TEST_STEP_NAME=test: Cortex-M', 'TVM_NUM_SHARDS=8', 'TVM_SHARD_INDEX=7', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -5211,6 +5264,7 @@ stage('Test') { docker_init(ci_cpu) init_git() withEnv(['PLATFORM=cpu', + 'TEST_STEP_NAME=unittest: CPU', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( script: """ @@ -5285,6 +5339,7 @@ stage('Test') { docker_init(ci_cpu) init_git() withEnv(['PLATFORM=cpu', + 'TEST_STEP_NAME=frontend: CPU', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( script: """ diff --git a/ci/jenkins/Jenkinsfile.j2 b/ci/jenkins/Jenkinsfile.j2 index 28ce2c8e1cfb..a0c637ef90d5 100644 --- a/ci/jenkins/Jenkinsfile.j2 +++ b/ci/jenkins/Jenkinsfile.j2 @@ -84,7 +84,7 @@ properties([ upstream_revision = null // command to start a docker container -docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM --env SKIP_SLOW_TESTS' +docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM --env SKIP_SLOW_TESTS --env TEST_STEP_NAME' docker_build = 'docker/build.sh' // timeout in minutes max_time = 180 diff --git a/ci/jenkins/macros.j2 b/ci/jenkins/macros.j2 index dbd6ac551db4..9d02ad68d6da 100644 --- a/ci/jenkins/macros.j2 +++ b/ci/jenkins/macros.j2 @@ -44,6 +44,7 @@ def {{ method_name }}() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'PLATFORM={{ platform }}', + 'TEST_STEP_NAME={{ name }}', 'TVM_NUM_SHARDS={{ num_shards }}', 'TVM_SHARD_INDEX={{ shard_index - 1 }}', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { @@ -75,6 +76,7 @@ def {{ method_name }}() { timeout(time: max_time, unit: 'MINUTES') { withEnv([ 'TVM_NUM_SHARDS={{ num_shards }}', + 'TEST_STEP_NAME={{ name }}', 'TVM_SHARD_INDEX={{ shard_index - 1 }}', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { {{ caller() | trim | indent(width=6) }} @@ -121,6 +123,7 @@ def {{ method_name }}() { docker_init({{ docker_image }}) init_git() withEnv(['PLATFORM={{ platform }}', + 'TEST_STEP_NAME={{ name }}', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { {{ caller() | indent(width=12) | trim }} }) diff --git a/tests/scripts/setup-pytest-env.sh b/tests/scripts/setup-pytest-env.sh index d27f008093e0..76a1cafafd4a 100755 --- a/tests/scripts/setup-pytest-env.sh +++ b/tests/scripts/setup-pytest-env.sh @@ -74,8 +74,14 @@ function run_pytest() { suite_name="${test_suite_name}-${current_shard}-${ffi_type}" + # Some test environments don't play well with parallelism + DEFAULT_PARALLELISM=2 + if [[ "${TEST_STEP_NAME:-default}" == "frontend: GPU"* ]] || [[ "${TEST_STEP_NAME:-default}" == "test: Hexagon"* ]]; then + DEFAULT_PARALLELISM=1 + fi + if [[ ! "${extra_args[@]}" == *" -n"* ]]; then - extra_args+=("-n=1") + extra_args+=("-n=$DEFAULT_PARALLELISM") fi exit_code=0