@@ -5,7 +5,6 @@ set -euo pipefail
55# Prepare conda
66CONDA_PATH=$( which conda)
77eval " $( ${CONDA_PATH} shell.bash hook) "
8- conda config --set channel_priority strict
98
109# Setup the OS_TYPE environment variable that should be used for conditions involving the OS below.
1110case $( uname) in
@@ -33,43 +32,15 @@ if [[ "${OS_TYPE}" == "macos" && $(uname -m) == x86_64 ]]; then
3332fi
3433echo ' ::endgroup::'
3534
36- echo ' ::group::Set PyTorch conda channel and wheel index'
37- # TODO: Can we maybe have this as environment variable in the job template? For example, `IS_RELEASE`.
38- if [[ (${GITHUB_EVENT_NAME} = ' pull_request' && (${GITHUB_BASE_REF} = ' release' * )) || (${GITHUB_REF} = ' refs/heads/release' * ) ]]; then
39- CHANNEL_ID=test
40- else
41- CHANNEL_ID=nightly
42- fi
43- PYTORCH_CONDA_CHANNEL=pytorch-" ${CHANNEL_ID} "
44- echo " PYTORCH_CONDA_CHANNEL=${PYTORCH_CONDA_CHANNEL} "
45-
46- case $GPU_ARCH_TYPE in
47- cpu)
48- GPU_ARCH_ID=" cpu"
49- ;;
50- cuda)
51- VERSION_WITHOUT_DOT=$( echo " ${GPU_ARCH_VERSION} " | sed ' s/\.//' )
52- GPU_ARCH_ID=" cu${VERSION_WITHOUT_DOT} "
53- ;;
54- * )
55- echo " Unknown GPU_ARCH_TYPE=${GPU_ARCH_TYPE} "
56- exit 1
57- ;;
58- esac
59- PYTORCH_WHEEL_INDEX=" https://download.pytorch.org/whl/${CHANNEL_ID} /${GPU_ARCH_ID} "
60- echo " PYTORCH_WHEEL_INDEX=${PYTORCH_WHEEL_INDEX} "
61- echo ' ::endgroup::'
62-
6335echo ' ::group::Create build environment'
6436# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
6537conda create \
6638 --name ci \
6739 --quiet --yes \
6840 python=" ${PYTHON_VERSION} " pip \
69- ninja libpng jpeg \
70- ' ffmpeg<4.3' \
71- -c " ${PYTORCH_CONDA_CHANNEL} " \
72- -c defaults
41+ ninja \
42+ libpng jpeg \
43+ ' ffmpeg<4.3'
7344conda activate ci
7445pip install --progress-bar=off --upgrade setuptools
7546
8152echo ' ::endgroup::'
8253
8354echo ' ::group::Install PyTorch'
84- pip install --progress-bar=off --pre torch --index-url=" ${PYTORCH_WHEEL_INDEX} "
55+ # TODO: Can we maybe have this as environment variable in the job template? For example, `IS_RELEASE`.
56+ if [[ (${GITHUB_EVENT_NAME} = ' pull_request' && (${GITHUB_BASE_REF} = ' release' * )) || (${GITHUB_REF} = ' refs/heads/release' * ) ]]; then
57+ CHANNEL=test
58+ else
59+ CHANNEL=nightly
60+ fi
61+
62+ pip install --progress-bar=off light-the-torch
63+ ltt install --progress-bar=off \
64+ --pytorch-computation-backend=" ${GPU_ARCH_TYPE}${GPU_ARCH_VERSION} " \
65+ --pytorch-channel=" ${CHANNEL} " \
66+ torch
8567
8668if [[ $GPU_ARCH_TYPE == ' cuda' ]]; then
8769 python3 -c " import torch; exit(not torch.cuda.is_available())"
0 commit comments