Skip to content

Commit

Permalink
Use regular env setup (pytorch#7924)
Browse files Browse the repository at this point in the history
  • Loading branch information
atalman authored Sep 1, 2023
1 parent 1044d0f commit 704f831
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/scripts/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,21 @@ else
CHANNEL=nightly
fi

pip install --progress-bar=off light-the-torch
ltt install --progress-bar=off \
--pytorch-computation-backend="${GPU_ARCH_TYPE}${GPU_ARCH_VERSION}" \
--pytorch-channel="${CHANNEL}" \
torch
case $GPU_ARCH_TYPE in
cpu)
GPU_ARCH_ID="cpu"
;;
cuda)
VERSION_WITHOUT_DOT=$(echo "${GPU_ARCH_VERSION}" | sed 's/\.//')
GPU_ARCH_ID="cu${VERSION_WITHOUT_DOT}"
;;
*)
echo "Unknown GPU_ARCH_TYPE=${GPU_ARCH_TYPE}"
exit 1
;;
esac
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/${GPU_ARCH_ID}"
pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"

if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
python -c "import torch; exit(not torch.cuda.is_available())"
Expand Down

0 comments on commit 704f831

Please sign in to comment.