diff --git a/.github/workflows/scripts/unix_test.sh b/.github/workflows/scripts/unix_test.sh index b53bbf89b..fca398ae6 100755 --- a/.github/workflows/scripts/unix_test.sh +++ b/.github/workflows/scripts/unix_test.sh @@ -35,9 +35,18 @@ TI_PATH=$(python3 -c "import taichi;print(taichi.__path__[0])" | tail -1) TI_LIB_DIR="$TI_PATH/_lib/runtime" ./build/taichi_cpp_tests if [ -z "$GPU_TEST" ]; then - python3 tests/run_tests.py -vr2 -t4 -a "$TI_WANTED_ARCHS" + if [[ $PLATFORM == *"m1"* ]]; then + # Split per arch to avoid flaky test + python3 tests/run_tests.py -vr2 -t4 -k "not torch" -a cpu + # Run metal and vulkan separately so that they don't use M1 chip simultaneously. + python3 tests/run_tests.py -vr2 -t4 -k "not torch" -a vulkan + python3 tests/run_tests.py -vr2 -t2 -k "not torch" -a metal + python3 tests/run_tests.py -vr2 -t1 -k "torch" -a "$TI_WANTED_ARCHS" + else + python3 tests/run_tests.py -vr2 -t4 -a "$TI_WANTED_ARCHS" + fi else - # only split per arch for self_hosted GPU tests + # Split per arch to increase parallelism for linux GPU tests if [[ $TI_WANTED_ARCHS == *"cuda"* ]]; then python3 tests/run_tests.py -vr2 -t4 -k "not torch" -a cuda fi @@ -50,9 +59,5 @@ else if [[ $TI_WANTED_ARCHS == *"opengl"* ]]; then python3 tests/run_tests.py -vr2 -t4 -k "not torch" -a opengl fi - # Run metal and vulkan separately so that they don't use M1 chip simultaneously. - if [[ $TI_WANTED_ARCHS == *"metal"* ]]; then - python3 tests/run_tests.py -vr2 -t4 -k "not torch" -a metal - fi python3 tests/run_tests.py -vr2 -t1 -k "torch" -a "$TI_WANTED_ARCHS" fi diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5540b4e37..2cc28bf6a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -466,4 +466,4 @@ jobs: env: TI_WANTED_ARCHS: "metal,vulkan,cpu" PY: ${{ matrix.python }} - GPU_TEST: ON + PLATFORM: "m1"