Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pytorch/vision into please_dont_mod…
Browse files Browse the repository at this point in the history
…ify_this_branch_unless_you_are_just_merging_with_main
  • Loading branch information
NicolasHug committed Jan 9, 2023
2 parents dbf60be + 35f68a0 commit a76d1c2
Show file tree
Hide file tree
Showing 409 changed files with 30,626 additions and 10,240 deletions.
1,721 changes: 363 additions & 1,358 deletions .circleci/config.yml

Large diffs are not rendered by default.

59 changes: 31 additions & 28 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@ commands:
args: --no-build-isolation <<# parameters.editable >> --editable <</ parameters.editable >> .
descr: Install torchvision <<# parameters.editable >> in editable mode <</ parameters.editable >>

install_prototype_dependencies:
steps:
- pip_install:
args: iopath
descr: Install third-party dependencies
- pip_install:
args: --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu
descr: Install torchdata from nightly releases

# Most of the test suite is handled by the `unittest` jobs, with completely different workflow and setup.
# This command can be used if only a selection of tests need to be run, for ad-hoc files.
run_tests_selective:
Expand Down Expand Up @@ -223,7 +214,7 @@ binary_common: &binary_common
wheel_docker_image:
description: "Wheel only: what docker image to use"
type: string
default: "pytorch/manylinux-cuda102"
default: ""
conda_docker_image:
description: "Conda only: what docker image to use"
type: string
Expand All @@ -233,6 +224,7 @@ binary_common: &binary_common
PYTORCH_VERSION: << parameters.pytorch_version >>
UNICODE_ABI: << parameters.unicode_abi >>
CU_VERSION: << parameters.cu_version >>
MACOSX_DEPLOYMENT_TARGET: 10.9

torchvision_ios_params: &torchvision_ios_params
parameters:
Expand Down Expand Up @@ -325,7 +317,6 @@ jobs:
- checkout
- install_torchvision:
editable: true
- install_prototype_dependencies
- pip_install:
args: mypy
descr: Install Python type check utilities
Expand Down Expand Up @@ -376,7 +367,12 @@ jobs:
steps:
- checkout_merge
- designate_upload_channel
- run: packaging/build_wheel.sh
- run:
name: Build conda packages
no_output_timeout: 30m
command: |
set -ex
packaging/build_wheel.sh
- store_artifacts:
path: dist
- persist_to_workspace:
Expand All @@ -392,7 +388,12 @@ jobs:
steps:
- checkout_merge
- designate_upload_channel
- run: packaging/build_conda.sh
- run:
name: Build conda packages
no_output_timeout: 30m
command: |
set -ex
packaging/build_conda.sh
- store_artifacts:
path: /opt/conda/conda-bld/linux-64
- persist_to_workspace:
Expand All @@ -410,18 +411,14 @@ jobs:
- designate_upload_channel
- run:
name: Build conda packages
no_output_timeout: 20m
no_output_timeout: 30m
command: |
set -ex
source packaging/windows/internal/vc_install_helper.sh
packaging/windows/internal/cuda_install.bat
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate base
conda install -yq conda-build "conda-package-handling!=1.5.0"
# cudatoolkit >= 11 isn't available for windows in the nvidia channel
if [[ "${CU_VERSION}" =~ cu11.* ]]; then
export CONDA_CHANNEL_FLAGS="-c conda-forge"
fi
packaging/build_conda.sh
rm /C/tools/miniconda3/conda-bld/win-64/vs${VC_YEAR}*.tar.bz2
- store_artifacts:
Expand All @@ -441,6 +438,7 @@ jobs:
- designate_upload_channel
- run:
name: Build wheel packages
no_output_timeout: 30m
command: |
set -ex
source packaging/windows/internal/vc_install_helper.sh
Expand All @@ -458,7 +456,7 @@ jobs:
binary_macos_wheel:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "14.0"
steps:
- checkout_merge
- designate_upload_channel
Expand All @@ -481,7 +479,7 @@ jobs:
binary_ios_build:
<<: *torchvision_ios_params
macos:
xcode: "12.0"
xcode: "14.0"
steps:
- attach_workspace:
at: ~/workspace
Expand All @@ -501,7 +499,7 @@ jobs:
binary_ios_upload:
<<: *torchvision_ios_params
macos:
xcode: "12.0"
xcode: "14.0"
steps:
- attach_workspace:
at: ~/workspace
Expand Down Expand Up @@ -554,7 +552,7 @@ jobs:
binary_macos_conda:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "14.0"
steps:
- checkout_merge
- designate_upload_channel
Expand Down Expand Up @@ -727,7 +725,7 @@ jobs:
unittest_linux_cpu:
<<: *binary_common
docker:
- image: "pytorch/manylinux-cuda102"
- image: "pytorch/manylinux-cpu"
resource_class: 2xlarge+
steps:
- checkout
Expand Down Expand Up @@ -769,7 +767,8 @@ jobs:
image: ubuntu-2004-cuda-11.4:202110-01
resource_class: gpu.nvidia.medium
environment:
image_name: "pytorch/manylinux-cuda102"
image_name: "pytorch/manylinux-cuda116"
CU_VERSION: << parameters.cu_version >>
PYTHON_VERSION: << parameters.python_version >>
steps:
- checkout
Expand Down Expand Up @@ -856,7 +855,7 @@ jobs:
executor:
name: windows-gpu
environment:
CUDA_VERSION: "11.3"
CUDA_VERSION: "11.6"
PYTHON_VERSION: << parameters.python_version >>
steps:
- checkout
Expand Down Expand Up @@ -901,7 +900,7 @@ jobs:
unittest_macos_cpu:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "14.0"
resource_class: large
steps:
- checkout
Expand Down Expand Up @@ -944,7 +943,7 @@ jobs:
cmake_linux_cpu:
<<: *binary_common
docker:
- image: "pytorch/manylinux-cuda102"
- image: "pytorch/manylinux-cpu"
resource_class: 2xlarge+
steps:
- checkout_merge
Expand Down Expand Up @@ -972,12 +971,13 @@ jobs:
command: docker run -e CU_VERSION -e PYTHON_VERSION -e UNICODE_ABI -e PYTORCH_VERSION -t --gpus all -v $PWD:$PWD -w $PWD << parameters.wheel_docker_image >> .circleci/unittest/linux/scripts/setup_env.sh
- run:
name: Build torchvision C++ distribution and test
no_output_timeout: 30m
command: docker run -e CU_VERSION -e PYTHON_VERSION -e UNICODE_ABI -e PYTORCH_VERSION -e UPLOAD_CHANNEL -t --gpus all -v $PWD:$PWD -w $PWD << parameters.wheel_docker_image >> packaging/build_cmake.sh

cmake_macos_cpu:
<<: *binary_common
macos:
xcode: "12.0"
xcode: "14.0"
steps:
- checkout_merge
- designate_upload_channel
Expand Down Expand Up @@ -1009,6 +1009,9 @@ jobs:
steps:
- checkout_merge
- designate_upload_channel
- run:
name: Update CUDA driver
command: packaging/windows/internal/driver_update.bat
- run:
command: |
set -ex
Expand Down
39 changes: 31 additions & 8 deletions .circleci/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
for os_type in ["linux", "macos", "win"]:
python_versions = PYTHON_VERSIONS
cu_versions_dict = {
"linux": ["cpu", "cu102", "cu113", "cu116", "rocm5.0", "rocm5.1.1"],
"win": ["cpu", "cu113", "cu116"],
"linux": ["cpu", "cu116", "cu117", "cu118", "rocm5.2", "rocm5.3"],
"win": ["cpu", "cu116", "cu117", "cu118"],
"macos": ["cpu"],
}
cu_versions = cu_versions_dict[os_type]
Expand All @@ -59,6 +59,22 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
):
# the fields must match the build_docs "requires" dependency
fb = "/.*/"

# Disable all Linux Wheels Workflows from CircleCI
# since those will now be done through Nova. We'll keep
# around the py3.7 Linux Wheels build since the docs
# job depends on it.
if os_type == "linux" and btype == "wheel" and python_version != "3.7":
continue

# Disable all Macos Wheels Workflows from CircleCI.
if os_type == "macos" and btype == "wheel":
continue

# Disable all non-Windows Conda workflows
if os_type != "win" and btype == "conda":
continue

w += workflow_pair(
btype, os_type, python_version, cu_version, unicode, prefix, upload, filter_branch=fb
)
Expand All @@ -82,6 +98,11 @@ def workflow_pair(btype, os_type, python_version, cu_version, unicode, prefix=""
)
)

# For the remaining py3.7 Linux Wheels job left around for the docs build,
# we'll disable uploads.
if os_type == "linux" and btype == "wheel":
upload = False

if upload:
w.append(generate_upload_workflow(base_workflow_name, os_type, btype, cu_version, filter_branch=filter_branch))
# disable smoke tests, they are broken and needs to be fixed
Expand Down Expand Up @@ -122,15 +143,15 @@ def upload_doc_job(filter_branch):


manylinux_images = {
"cu102": "pytorch/manylinux-cuda102",
"cu113": "pytorch/manylinux-cuda113",
"cu116": "pytorch/manylinux-cuda116",
"cu117": "pytorch/manylinux-cuda117",
"cu118": "pytorch/manylinux-cuda118",
}


def get_manylinux_image(cu_version):
if cu_version == "cpu":
return "pytorch/manylinux-cuda102"
return "pytorch/manylinux-cpu"
elif cu_version.startswith("cu"):
cu_suffix = cu_version[len("cu") :]
return f"pytorch/manylinux-cuda{cu_suffix}"
Expand Down Expand Up @@ -238,6 +259,8 @@ def unittest_workflows(indentation=6):
for device_type in ["cpu", "gpu"]:
if os_type == "macos" and device_type == "gpu":
continue
if os_type == "linux" and device_type == "cpu":
continue
for i, python_version in enumerate(PYTHON_VERSIONS):
job = {
"name": f"unittest_{os_type}_{device_type}_py{python_version}",
Expand All @@ -247,7 +270,7 @@ def unittest_workflows(indentation=6):
if device_type == "gpu":
if python_version != "3.8":
job["filters"] = gen_filter_branch_tree("main", "nightly")
job["cu_version"] = "cu102"
job["cu_version"] = "cu116"
else:
job["cu_version"] = "cpu"

Expand All @@ -265,9 +288,9 @@ def cmake_workflows(indentation=6):
for device in device_types:
job = {"name": f"cmake_{os_type}_{device}", "python_version": python_version}

job["cu_version"] = "cu113" if device == "gpu" else "cpu"
job["cu_version"] = "cu116" if device == "gpu" else "cpu"
if device == "gpu" and os_type == "linux":
job["wheel_docker_image"] = "pytorch/manylinux-cuda113"
job["wheel_docker_image"] = "pytorch/manylinux-cuda116"
jobs.append({f"cmake_{os_type}_{device}": job})
return indent(indentation, jobs)

Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/linux/scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencies:
- pip:
- future
- scipy
- av
- av < 10
4 changes: 2 additions & 2 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ else
elif [[ ${#CU_VERSION} -eq 5 ]]; then
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION: ${CU_VERSION} "
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="nvidia::cudatoolkit=${version}"
cudatoolkit="pytorch-cuda=${version}"
fi

case "$(uname -s)" in
Expand Down
2 changes: 2 additions & 0 deletions .circleci/unittest/linux/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
set -e

this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Avoid error: "fatal: unsafe repository"
git config --global --add safe.directory '*'
root_dir="$(git rev-parse --show-toplevel)"
conda_dir="${root_dir}/conda"
env_dir="${root_dir}/env"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/windows/scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ dependencies:
- pip:
- future
- scipy
- av != 9.1.1
- av !=9.1.1, <10
- dataclasses
- h5py
8 changes: 7 additions & 1 deletion .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ else
elif [[ ${#CU_VERSION} -eq 5 ]]; then
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi

cuda_toolkit_pckg="cudatoolkit"
if [[ $CUDA_VERSION == 11.6 || $CUDA_VERSION == 11.7 ]]; then
cuda_toolkit_pckg="pytorch-cuda"
fi

echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="cudatoolkit=${version}"
cudatoolkit="${cuda_toolkit_pckg}=${version}"
fi

printf "Installing PyTorch with %s\n" "${cudatoolkit}"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/windows/scripts/set_cuda_envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex
echo CU_VERSION is "${CU_VERSION}"
echo CUDA_VERSION is "${CUDA_VERSION}"

# Currenly, CU_VERSION and CUDA_VERSION are not consistent.
# Currenly, CU_VERSION and CUDA_VERSION are not consistent.
# to understand this code, see https://github.com/pytorch/vision/issues/4443
version="cpu"
if [[ ! -z "${CUDA_VERSION}" ]] ; then
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
5f0edb97b46e5bff71dc19dedef05c5396eeaea2
# update python syntax >=3.6 (#4585)
d367a01a18a3ae6bee13d8be3b63fd6a581ea46f
# Upgrade usort to 1.0.2 and black to 22.3.0 (#5106)
6ca9c76adb6daf2695d603ad623a9cf1c4f4806f
Loading

0 comments on commit a76d1c2

Please sign in to comment.