Skip to content

Commit 8d15ca7

Browse files
author
chronos_secgrp_pytorch_oss_ci_oncall
committed
2023-03-13 nightly release (98c5815)
1 parent 0cb4c92 commit 8d15ca7

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

.github/scripts/setup-env.sh

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set -euo pipefail
55
# Prepare conda
66
CONDA_PATH=$(which conda)
77
eval "$(${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.
1110
case $(uname) in
@@ -33,43 +32,15 @@ if [[ "${OS_TYPE}" == "macos" && $(uname -m) == x86_64 ]]; then
3332
fi
3433
echo '::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-
6335
echo '::group::Create build environment'
6436
# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
6537
conda 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'
7344
conda activate ci
7445
pip install --progress-bar=off --upgrade setuptools
7546

@@ -81,7 +52,18 @@ fi
8152
echo '::endgroup::'
8253

8354
echo '::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

8668
if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
8769
python3 -c "import torch; exit(not torch.cuda.is_available())"

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ jobs:
8181
8282
export PYTHON_VERSION=3.8
8383
export GPU_ARCH_TYPE=cpu
84+
export GPU_ARCH_VERSION=''
85+
8486
./.github/scripts/setup-env.sh
8587
8688
CONDA_PATH=$(which conda)

.github/workflows/test-linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
5252
export PYTHON_VERSION=3.8
5353
export GPU_ARCH_TYPE=cpu
54+
export GPU_ARCH_VERSION=''
5455
5556
./.github/scripts/setup-env.sh
5657
@@ -80,6 +81,7 @@ jobs:
8081
8182
export PYTHON_VERSION=3.8
8283
export GPU_ARCH_TYPE=cpu
84+
export GPU_ARCH_VERSION=''
8385
8486
./.github/scripts/setup-env.sh
8587

.github/workflows/test-macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ jobs:
3535
3636
export PYTHON_VERSION=${{ matrix.python-version }}
3737
export GPU_ARCH_TYPE=cpu
38+
export GPU_ARCH_VERSION=''
3839
3940
./.github/scripts/unittest.sh

0 commit comments

Comments
 (0)