Skip to content

Commit 6ef364f

Browse files
committed
add assert for 4 gpu when running distributed job
1 parent 73b522c commit 6ef364f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ jobs:
7272
if: contains(matrix.alias, 'distributed')
7373
run: |
7474
set -euxo pipefail
75+
GPU_COUNT=$(nvidia-smi -L | wc -l)
76+
if [ "$GPU_COUNT" -ne 4 ]; then
77+
echo "Error: Expected 4 GPUs but found $GPU_COUNT"
78+
exit 1
79+
fi
7580
curl -L https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cuda.sh -o install_cuda.sh
7681
chmod +x install_cuda.sh
7782
source install_cuda.sh

0 commit comments

Comments
 (0)