Skip to content

Commit

Permalink
Use regular env setup (#7926)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrey Talman <atalman@fb.com>
  • Loading branch information
pmeier and atalman committed Sep 1, 2023
1 parent fb115c2 commit a3ba01a
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 a3ba01a

Please sign in to comment.