Skip to content

Commit 950b793

Browse files
committed
Merge branch 'main' of github.com:pytorch/vision into update-usort
2 parents aa4b864 + 9e78871 commit 950b793

File tree

476 files changed

+31562
-17086
lines changed

Some content is hidden

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

476 files changed

+31562
-17086
lines changed

.circleci/config.yml

Lines changed: 591 additions & 1749 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: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ commands:
146146
default: true
147147
steps:
148148
- pip_install:
149-
args: --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
149+
args: --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
150150
descr: Install PyTorch from nightly releases
151151
- pip_install:
152152
args: --no-build-isolation <<# parameters.editable >> --editable <</ parameters.editable >> .
@@ -155,8 +155,11 @@ commands:
155155
install_prototype_dependencies:
156156
steps:
157157
- pip_install:
158-
args: iopath git+https://github.com/pytorch/data
159-
descr: Install prototype dependencies
158+
args: iopath
159+
descr: Install third-party dependencies
160+
- pip_install:
161+
args: --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu
162+
descr: Install torchdata from nightly releases
160163

161164
# Most of the test suite is handled by the `unittest` jobs, with completely different workflow and setup.
162165
# This command can be used if only a selection of tests need to be run, for ad-hoc files.
@@ -174,6 +177,26 @@ commands:
174177
- store_test_results:
175178
path: test-results
176179

180+
download_model_weights:
181+
parameters:
182+
extract_roots:
183+
type: string
184+
default: "torchvision/models"
185+
background:
186+
type: boolean
187+
default: true
188+
steps:
189+
- apt_install:
190+
args: parallel wget
191+
descr: Install download utilitites
192+
- run:
193+
name: Download model weights
194+
background: << parameters.background >>
195+
command: |
196+
mkdir -p ~/.cache/torch/hub/checkpoints
197+
python scripts/collect_model_urls.py << parameters.extract_roots >> \
198+
| parallel -j0 'wget --no-verbose -O ~/.cache/torch/hub/checkpoints/`basename {}` {}\?source=ci'
199+
177200
binary_common: &binary_common
178201
parameters:
179202
# Edit these defaults to do a release
@@ -243,7 +266,7 @@ smoke_test_common: &smoke_test_common
243266
jobs:
244267
circleci_consistency:
245268
docker:
246-
- image: circleci/python:3.7
269+
- image: cimg/python:3.7
247270
steps:
248271
- checkout
249272
- pip_install:
@@ -256,7 +279,7 @@ jobs:
256279

257280
lint_python_and_config:
258281
docker:
259-
- image: circleci/python:3.7
282+
- image: cimg/python:3.7
260283
steps:
261284
- checkout
262285
- pip_install:
@@ -275,7 +298,7 @@ jobs:
275298

276299
lint_c:
277300
docker:
278-
- image: circleci/python:3.7
301+
- image: cimg/python:3.7
279302
steps:
280303
- apt_install:
281304
args: libtinfo5
@@ -297,11 +320,8 @@ jobs:
297320

298321
type_check_python:
299322
docker:
300-
- image: circleci/python:3.7
323+
- image: cimg/python:3.7
301324
steps:
302-
- apt_install:
303-
args: libturbojpeg-dev
304-
descr: Install additional system libraries
305325
- checkout
306326
- install_torchvision:
307327
editable: true
@@ -315,7 +335,7 @@ jobs:
315335

316336
unittest_torchhub:
317337
docker:
318-
- image: circleci/python:3.7
338+
- image: cimg/python:3.7
319339
steps:
320340
- checkout
321341
- install_torchvision
@@ -324,7 +344,7 @@ jobs:
324344

325345
unittest_onnx:
326346
docker:
327-
- image: circleci/python:3.7
347+
- image: cimg/python:3.7
328348
steps:
329349
- checkout
330350
- install_torchvision
@@ -334,30 +354,19 @@ jobs:
334354
- run_tests_selective:
335355
file_or_dir: test/test_onnx.py
336356

337-
unittest_prototype:
357+
unittest_extended:
338358
docker:
339-
- image: circleci/python:3.7
359+
- image: cimg/python:3.7
340360
resource_class: xlarge
341361
steps:
342362
- checkout
343-
- run:
344-
name: Download model weights
345-
background: true
346-
command: |
347-
sudo apt update -qy && sudo apt install -qy parallel wget
348-
mkdir -p ~/.cache/torch/hub/checkpoints
349-
python scripts/collect_model_urls.py torchvision/prototype/models \
350-
| parallel -j0 'wget --no-verbose -O ~/.cache/torch/hub/checkpoints/`basename {}` {}\?source=ci'
363+
- download_model_weights
351364
- install_torchvision
352-
- install_prototype_dependencies
353-
- pip_install:
354-
args: scipy pycocotools
355-
descr: Install optional dependencies
356365
- run:
357-
name: Enable prototype tests
358-
command: echo 'export PYTORCH_TEST_WITH_PROTOTYPE=1' >> $BASH_ENV
366+
name: Enable extended tests
367+
command: echo 'export PYTORCH_TEST_WITH_EXTENDED=1' >> $BASH_ENV
359368
- run_tests_selective:
360-
file_or_dir: test/test_prototype_*.py
369+
file_or_dir: test/test_extended_*.py
361370

362371
binary_linux_wheel:
363372
<<: *binary_common
@@ -509,7 +518,7 @@ jobs:
509518
binary_android_build:
510519
<<: *torchvision_android_params
511520
docker:
512-
- image: circleci/android:api-29-ndk
521+
- image: cimg/android:2021.08-ndk
513522
resource_class: xlarge
514523
steps:
515524
- attach_workspace:
@@ -528,7 +537,7 @@ jobs:
528537
binary_android_upload:
529538
<<: *torchvision_android_params
530539
docker:
531-
- image: circleci/android:api-29-ndk
540+
- image: cimg/android:2021.08-ndk
532541
resource_class: xlarge
533542
steps:
534543
- attach_workspace:
@@ -587,7 +596,7 @@ jobs:
587596
description: "What whl subfolder to upload to, e.g., blank or cu100/ (trailing slash is important)"
588597
type: string
589598
docker:
590-
- image: circleci/python:3.7
599+
- image: cimg/python:3.7
591600
steps:
592601
- attach_workspace:
593602
at: ~/workspace
@@ -647,7 +656,7 @@ jobs:
647656

648657
smoke_test_docker_image_build:
649658
machine:
650-
image: ubuntu-1604:201903-01
659+
image: ubuntu-2004:202104-01
651660
resource_class: large
652661
environment:
653662
image_name: torchvision/smoke_test
@@ -682,7 +691,6 @@ jobs:
682691
conda env remove -n python${PYTHON_VERSION} || true
683692
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
684693
conda activate python${PYTHON_VERSION}
685-
conda install "Pillow>=5.3.0,!=8.3.*"
686694
conda install -v -y -c pytorch-nightly pytorch
687695
conda install -v -y $(ls ~/workspace/torchvision*.tar.bz2)
688696
- run:
@@ -758,7 +766,7 @@ jobs:
758766
unittest_linux_gpu:
759767
<<: *binary_common
760768
machine:
761-
image: ubuntu-1604-cuda-10.2:202012-01
769+
image: ubuntu-2004-cuda-11.4:202110-01
762770
resource_class: gpu.nvidia.medium
763771
environment:
764772
image_name: "pytorch/manylinux-cuda102"
@@ -848,7 +856,7 @@ jobs:
848856
executor:
849857
name: windows-gpu
850858
environment:
851-
CUDA_VERSION: "11.1"
859+
CUDA_VERSION: "11.3"
852860
PYTHON_VERSION: << parameters.python_version >>
853861
steps:
854862
- checkout
@@ -949,7 +957,7 @@ jobs:
949957
cmake_linux_gpu:
950958
<<: *binary_common
951959
machine:
952-
image: ubuntu-1604-cuda-10.2:202012-01
960+
image: ubuntu-2004-cuda-11.4:202110-01
953961
resource_class: gpu.nvidia.small
954962
environment:
955963
PYTHON_VERSION: << parameters.python_version >>
@@ -1011,12 +1019,13 @@ jobs:
10111019
build_docs:
10121020
<<: *binary_common
10131021
docker:
1014-
- image: "pytorch/manylinux-cuda100"
1022+
- image: cimg/python:3.7
10151023
resource_class: 2xlarge+
10161024
steps:
10171025
- attach_workspace:
10181026
at: ~/workspace
10191027
- checkout
1028+
- download_model_weights
10201029
- run:
10211030
name: Setup
10221031
command: .circleci/unittest/linux/scripts/setup_env.sh
@@ -1069,7 +1078,8 @@ jobs:
10691078
# Don't use "checkout" step since it uses ssh, which cannot git push
10701079
# https://circleci.com/docs/2.0/configuration-reference/#checkout
10711080
set -ex
1072-
tag=${CIRCLE_TAG:1:5}
1081+
# Change v1.12.1rc1 into 1.12 (only major.minor)
1082+
tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9]*\.[0-9]*\).*/\1/')
10731083
target=${tag:-main}
10741084
~/workspace/.circleci/build_docs/commit_docs.sh ~/workspace $target
10751085

@@ -1092,7 +1102,7 @@ workflows:
10921102
jobs:
10931103
- unittest_torchhub
10941104
- unittest_onnx
1095-
- unittest_prototype
1105+
- unittest_extended
10961106
{{ unittest_workflows() }}
10971107

10981108
cmake:

.circleci/regenerate.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from jinja2 import select_autoescape
2222

2323

24-
PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
24+
PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
2525

2626
RC_PATTERN = r"/v[0-9]+(\.[0-9]+)*-rc[0-9]+/"
2727

@@ -32,8 +32,8 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
3232
for os_type in ["linux", "macos", "win"]:
3333
python_versions = PYTHON_VERSIONS
3434
cu_versions_dict = {
35-
"linux": ["cpu", "cu102", "cu111", "cu113", "cu115", "rocm4.2", "rocm4.3.1"],
36-
"win": ["cpu", "cu111", "cu113", "cu115"],
35+
"linux": ["cpu", "cu102", "cu113", "cu116", "rocm5.0", "rocm5.1.1"],
36+
"win": ["cpu", "cu113", "cu116"],
3737
"macos": ["cpu"],
3838
}
3939
cu_versions = cu_versions_dict[os_type]
@@ -84,9 +84,10 @@ def workflow_pair(btype, os_type, python_version, cu_version, unicode, prefix=""
8484

8585
if upload:
8686
w.append(generate_upload_workflow(base_workflow_name, os_type, btype, cu_version, filter_branch=filter_branch))
87-
if filter_branch == "nightly" and os_type in ["linux", "win"]:
88-
pydistro = "pip" if btype == "wheel" else "conda"
89-
w.append(generate_smoketest_workflow(pydistro, base_workflow_name, filter_branch, python_version, os_type))
87+
# disable smoke tests, they are broken and needs to be fixed
88+
# if filter_branch == "nightly" and os_type in ["linux", "win"]:
89+
# pydistro = "pip" if btype == "wheel" else "conda"
90+
# w.append(generate_smoketest_workflow(pydistro, base_workflow_name, filter_branch, python_version, os_type))
9091

9192
return w
9293

@@ -121,14 +122,9 @@ def upload_doc_job(filter_branch):
121122

122123

123124
manylinux_images = {
124-
"cu92": "pytorch/manylinux-cuda92",
125-
"cu101": "pytorch/manylinux-cuda101",
126125
"cu102": "pytorch/manylinux-cuda102",
127-
"cu110": "pytorch/manylinux-cuda110",
128-
"cu111": "pytorch/manylinux-cuda111",
129-
"cu112": "pytorch/manylinux-cuda112",
130126
"cu113": "pytorch/manylinux-cuda113",
131-
"cu115": "pytorch/manylinux-cuda115",
127+
"cu116": "pytorch/manylinux-cuda116",
132128
}
133129

134130

.circleci/smoke_test/docker/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ RUN apt-get -qq update && apt-get -qq -y install curl bzip2 libsox-fmt-all \
2525

2626
ENV PATH /opt/conda/bin:$PATH
2727

28-
RUN conda create -y --name python3.6 python=3.6
2928
RUN conda create -y --name python3.7 python=3.7
3029
RUN conda create -y --name python3.8 python=3.8
30+
RUN conda create -y --name python3.9 python=3.9
31+
RUN conda create -y --name python3.10 python=3.10
3132
SHELL [ "/bin/bash", "-c" ]
3233
RUN echo "source /usr/local/etc/profile.d/conda.sh" >> ~/.bashrc
33-
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.6 && conda install -y "Pillow>=5.3.0,!=8.3.*"
34-
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.7 && conda install -y "Pillow>=5.3.0,!=8.3.*"
35-
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.8 && conda install -y "Pillow>=5.3.0,!=8.3.*"
3634
CMD [ "/bin/bash"]

.circleci/unittest/linux/scripts/environment.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ dependencies:
99
- libpng
1010
- jpeg
1111
- ca-certificates
12-
# TODO: remove this after https://github.com/pytorch/pytorch/issues/69905 is resolved
13-
- pyyaml
12+
- h5py
1413
- pip:
1514
- future
16-
- pillow >=5.3.0, !=8.3.*
1715
- scipy
1816
- av

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else
2121
fi
2222
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
2323
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
24-
cudatoolkit="cudatoolkit=${version}"
24+
cudatoolkit="nvidia::cudatoolkit=${version}"
2525
fi
2626

2727
case "$(uname -s)" in
@@ -31,15 +31,9 @@ esac
3131

3232
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
3333
if [ "${os}" == "MacOSX" ]; then
34-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
34+
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}"
3535
else
36-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
37-
fi
38-
39-
if [ $PYTHON_VERSION == "3.6" ]; then
40-
printf "Installing minimal PILLOW version\n"
41-
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest
42-
pip install "pillow>=5.3.0,!=8.3.*"
36+
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}"
4337
fi
4438

4539
printf "* Installing torchvision\n"

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ set -e
55
eval "$(./conda/bin/conda shell.bash hook)"
66
conda activate ./env
77

8-
export PYTORCH_TEST_WITH_SLOW='1'
98
python -m torch.utils.collect_env
10-
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20
9+
pytest --junitxml=test-results/junit.xml -v --durations 20

.circleci/unittest/windows/scripts/environment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ dependencies:
99
- libpng
1010
- jpeg
1111
- ca-certificates
12-
# TODO: remove this after https://github.com/pytorch/pytorch/issues/69905 is resolved
13-
- pyyaml
12+
- hdf5
13+
- setuptools
1414
- pip:
1515
- future
16-
- pillow >=5.3.0, !=8.3.*
1716
- scipy
18-
- av
17+
- av != 9.1.1
1918
- dataclasses
19+
- h5py

.circleci/unittest/windows/scripts/install.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ else
2828
fi
2929

3030
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
31-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
32-
33-
if [ $PYTHON_VERSION == "3.6" ]; then
34-
printf "Installing minimal PILLOW version\n"
35-
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest
36-
pip install "pillow>=5.3.0,!=8.3.*"
37-
fi
31+
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}"
3832

3933
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
4034
echo torch.cuda.is_available is $torch_cuda

0 commit comments

Comments
 (0)