Skip to content

Commit 185f664

Browse files
authored
Make test-maxtext.sh understand CUDA_VISIBLE_DEVICES (#1203)
1 parent c7e1bb0 commit 185f664

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/container/test-maxtext.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ if [ $DTYPE == "fp8" ]; then
174174
fi
175175

176176
GPUS_PER_NODE=$(nvidia-smi -L | grep -c '^GPU')
177+
if [ "$CUDA_VISIBLE_DEVICES" != "" ]; then
178+
GPUS_PER_NODE=`python -c 'import os; x=os.environ.get("CUDA_VISIBLE_DEVICES", ""); print(len(x.split(",")))'`
179+
fi
177180
NGPUS=$((GPUS_PER_NODE * NODES))
178181

179182
# Heuristic to figure out ici and dcn of DP

0 commit comments

Comments
 (0)