Skip to content

Commit 3bf1fe0

Browse files
authored
Merge branch 'main' into revert-7218-xfail_vit
2 parents 89b0980 + b78d98b commit 3bf1fe0

File tree

164 files changed

+11569
-8336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+11569
-8336
lines changed

.circleci/config.yml

Lines changed: 82 additions & 599 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/config.yml.in

Lines changed: 11 additions & 497 deletions
Large diffs are not rendered by default.

.circleci/regenerate.py

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
6161
fb = "/.*/"
6262

6363
# Disable all Linux Wheels Workflows from CircleCI
64-
# since those will now be done through Nova. We'll keep
65-
# around the py3.8 CPU Linux Wheels build since the docs
66-
# job depends on it.
6764
if os_type == "linux" and btype == "wheel":
68-
if not (python_version == "3.8" and cu_version == "cpu"):
69-
continue
65+
continue
7066

7167
# Disable all Macos Wheels Workflows from CircleCI.
7268
if os_type == "macos" and btype == "wheel":
@@ -76,21 +72,10 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
7672
if os_type != "win" and btype == "conda":
7773
continue
7874

79-
# Not supporting Python 3.11 conda packages at the
80-
# moment since the necessary dependencies are not
81-
# available. Windows 3.11 Wheels will be built from
82-
# CircleCI here, however.
83-
if python_version == "3.11" and btype == "conda":
84-
continue
85-
8675
w += workflow_pair(
8776
btype, os_type, python_version, cu_version, unicode, prefix, upload, filter_branch=fb
8877
)
8978

90-
if not filter_branch:
91-
# Build on every pull request, but upload only on nightly and tags
92-
w += build_doc_job("/.*/")
93-
w += upload_doc_job("nightly")
9479
return indent(indentation, w)
9580

9681

@@ -121,35 +106,6 @@ def workflow_pair(btype, os_type, python_version, cu_version, unicode, prefix=""
121106
return w
122107

123108

124-
def build_doc_job(filter_branch):
125-
job = {
126-
"name": "build_docs",
127-
"python_version": "3.8",
128-
"requires": [
129-
"binary_linux_wheel_py3.8_cpu",
130-
],
131-
}
132-
133-
if filter_branch:
134-
job["filters"] = gen_filter_branch_tree(filter_branch, tags_list=RC_PATTERN)
135-
return [{"build_docs": job}]
136-
137-
138-
def upload_doc_job(filter_branch):
139-
job = {
140-
"name": "upload_docs",
141-
"context": "org-member",
142-
"python_version": "3.8",
143-
"requires": [
144-
"build_docs",
145-
],
146-
}
147-
148-
if filter_branch:
149-
job["filters"] = gen_filter_branch_tree(filter_branch, tags_list=RC_PATTERN)
150-
return [{"upload_docs": job}]
151-
152-
153109
manylinux_images = {
154110
"cu117": "pytorch/manylinux-cuda117",
155111
"cu118": "pytorch/manylinux-cuda118",
@@ -262,13 +218,17 @@ def indent(indentation, data_list):
262218

263219
def unittest_workflows(indentation=6):
264220
jobs = []
265-
for os_type in ["linux", "windows", "macos"]:
221+
for os_type in ["windows"]:
266222
for device_type in ["cpu", "gpu"]:
267223
if os_type == "macos" and device_type == "gpu":
268224
continue
269-
if os_type == "linux" and device_type == "cpu":
270-
continue
225+
271226
for i, python_version in enumerate(PYTHON_VERSIONS):
227+
228+
# Turn off unit tests for 3.11, unit test are not setup properly
229+
if python_version == "3.11":
230+
continue
231+
272232
job = {
273233
"name": f"unittest_{os_type}_{device_type}_py{python_version}",
274234
"python_version": python_version,
@@ -297,7 +257,7 @@ def cmake_workflows(indentation=6):
297257

298258
job["cu_version"] = "cu117" if device == "gpu" else "cpu"
299259
if device == "gpu" and os_type == "linux":
300-
job["wheel_docker_image"] = "pytorch/manylinux-cuda116"
260+
job["wheel_docker_image"] = "pytorch/manylinux-cuda117"
301261
jobs.append({f"cmake_{os_type}_{device}": job})
302262
return indent(indentation, jobs)
303263

.circleci/unittest/linux/scripts/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ unset PYTORCH_VERSION
55
# so no need to set PYTORCH_VERSION.
66
# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config.
77

8-
set -e
8+
set -ex
99

1010
eval "$(./conda/bin/conda shell.bash hook)"
1111
conda activate ./env
@@ -22,6 +22,10 @@ else
2222
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION: ${CU_VERSION} "
2323
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
2424
cudatoolkit="pytorch-cuda=${version}"
25+
26+
# make sure local cuda is set to required cuda version and not CUDA version by default
27+
rm -f /usr/local/cuda
28+
ln -s /usr/local/cuda-${version} /usr/local/cuda
2529
fi
2630

2731
case "$(uname -s)" in
@@ -36,5 +40,6 @@ else
3640
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}"
3741
fi
3842

43+
3944
printf "* Installing torchvision\n"
4045
python setup.py develop

.circleci/unittest/linux/scripts/run_test.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,17 @@ eval "$(./conda/bin/conda shell.bash hook)"
66
conda activate ./env
77

88
python -m torch.utils.collect_env
9-
pytest --junitxml=test-results/junit.xml -v --durations 20
9+
10+
case "$(uname -s)" in
11+
Darwin*)
12+
# The largest macOS runner is not able to handle the regular test suite plus the transforms v2 tests at the same
13+
# time due to insufficient resources. Thus, we ignore the transforms v2 tests at first and run them in a separate
14+
# step afterwards.
15+
GLOB='test/test_transforms_v2*'
16+
pytest --junitxml=test-results/junit.xml -v --durations 20 --ignore-glob="${GLOB}"
17+
eval "pytest --junitxml=test-results/junit-transforms-v2.xml -v --durations 20 ${GLOB}"
18+
;;
19+
*)
20+
pytest --junitxml=test-results/junit.xml -v --durations 20
21+
;;
22+
esac

.circleci/unittest/linux/scripts/setup_env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Do not install PyTorch and torchvision here, otherwise they also get cached.
77

8-
set -e
8+
set -ex
99

1010
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1111
# Avoid error: "fatal: unsafe repository"
@@ -39,7 +39,7 @@ conda activate "${env_dir}"
3939
# 3. Install Conda dependencies
4040
printf "* Installing dependencies (except PyTorch)\n"
4141
FFMPEG_PIN="=4.2"
42-
if [[ "${PYTHON_VERSION}" = "3.9" ]]; then
42+
if [[ "${PYTHON_VERSION}" == "3.9" ]]; then
4343
FFMPEG_PIN=">=4.2"
4444
fi
4545

.circleci/unittest/windows/scripts/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Do not install PyTorch and torchvision here, otherwise they also get cached.
77

8-
set -e
8+
set -ex
99

1010
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1111
root_dir="$(git rev-parse --show-toplevel)"

.github/pytorch-probot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
tracking_issue: 2447
2+
3+
# List of workflows that will be re-run in case of failures
4+
# https://github.com/pytorch/test-infra/blob/main/torchci/lib/bot/retryBot.ts
5+
retryable_workflows:
6+
- Build Linux
7+
- Build Macos
8+
- Build M1
9+
- Tests on Linux
10+
- Tests on macOS

.github/scripts/setup-env.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# Prepare conda
6+
CONDA_PATH=$(which conda)
7+
eval "$(${CONDA_PATH} shell.bash hook)"
8+
9+
# Setup the OS_TYPE environment variable that should be used for conditions involving the OS below.
10+
case $(uname) in
11+
Linux)
12+
OS_TYPE=linux
13+
;;
14+
Darwin)
15+
OS_TYPE=macos
16+
;;
17+
MSYS*)
18+
OS_TYPE=windows
19+
;;
20+
*)
21+
echo "Unknown OS type:" $(uname)
22+
exit 1
23+
;;
24+
esac
25+
26+
if [[ "${OS_TYPE}" == "macos" && $(uname -m) == x86_64 ]]; then
27+
echo '::group::Uninstall system JPEG libraries on macOS'
28+
# The x86 macOS runners, e.g. the GitHub Actions native "macos-12" runner, has some JPEG libraries installed by
29+
# default that interfere with our build. We uninstall them here and use the one from conda below.
30+
JPEG_LIBS=$(brew list | grep jpeg)
31+
echo $JPEG_LIBS
32+
for lib in $JPEG_LIBS; do
33+
brew uninstall --ignore-dependencies --force $lib || true
34+
done
35+
echo '::endgroup::'
36+
fi
37+
38+
echo '::group::Create build environment'
39+
# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
40+
conda create \
41+
--name ci \
42+
--quiet --yes \
43+
python="${PYTHON_VERSION}" pip \
44+
ninja \
45+
libpng jpeg \
46+
'ffmpeg<4.3'
47+
conda activate ci
48+
pip install --progress-bar=off --upgrade setuptools
49+
50+
# See https://github.com/pytorch/vision/issues/6790
51+
if [[ "${PYTHON_VERSION}" != "3.11" ]]; then
52+
pip install --progress-bar=off av!=10.0.0
53+
fi
54+
55+
echo '::endgroup::'
56+
57+
echo '::group::Install PyTorch'
58+
# TODO: Can we maybe have this as environment variable in the job template? For example, `IS_RELEASE`.
59+
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
60+
CHANNEL=test
61+
else
62+
CHANNEL=nightly
63+
fi
64+
65+
pip install --progress-bar=off light-the-torch
66+
ltt install --progress-bar=off \
67+
--pytorch-computation-backend="${GPU_ARCH_TYPE}${GPU_ARCH_VERSION}" \
68+
--pytorch-channel="${CHANNEL}" \
69+
torch
70+
71+
if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
72+
python -c "import torch; exit(not torch.cuda.is_available())"
73+
fi
74+
echo '::endgroup::'
75+
76+
if [[ "${OS_TYPE}" == "windows" ]]; then
77+
echo '::group::Install third party dependencies prior to TorchVision install on Windows'
78+
# `easy_install`, i.e. `python setup.py` has problems downloading the dependencies due to SSL.
79+
# Thus, we install them upfront with `pip` to avoid that.
80+
# Instead of fixing the SSL error, we can probably maintain this special case until we switch away from the deprecated
81+
# `easy_install` anyway.
82+
python setup.py egg_info
83+
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
84+
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
85+
sed -e '/^$/,$d' *.egg-info/requires.txt > requirements.txt
86+
pip install --progress-bar=off -r requirements.txt
87+
echo '::endgroup::'
88+
fi
89+
90+
echo '::group::Install TorchVision'
91+
python setup.py develop
92+
echo '::endgroup::'
93+
94+
echo '::group::Collect PyTorch environment information'
95+
python -m torch.utils.collect_env
96+
echo '::endgroup::'

.github/scripts/unittest.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
./.github/scripts/setup-env.sh
6+
7+
# Activate conda environment
8+
eval "$($(which conda) shell.bash hook)" && conda deactivate && conda activate ci
9+
10+
echo '::group::Install testing utilities'
11+
pip install --progress-bar=off pytest pytest-mock pytest-cov
12+
echo '::endgroup::'
13+
14+
pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25

.github/workflows/build-conda-linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

.github/workflows/build-conda-m1.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

.github/workflows/build-conda-macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

.github/workflows/build-wheels-linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

.github/workflows/build-wheels-m1.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

.github/workflows/build-wheels-macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
814
workflow_dispatch:
915

1016
jobs:

0 commit comments

Comments
 (0)