Skip to content

Commit

Permalink
Make test-maxtext.sh understand CUDA_VISIBLE_DEVICES (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
nouiz authored Dec 17, 2024
1 parent c7e1bb0 commit 185f664
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/container/test-maxtext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ if [ $DTYPE == "fp8" ]; then
fi

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

# Heuristic to figure out ici and dcn of DP
Expand Down

0 comments on commit 185f664

Please sign in to comment.