From 4aca4bdaa9ad48b8e91d7520e0d0815bb8ca0fb1 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Fri, 12 Mar 2021 17:20:26 -0800 Subject: [PATCH] v0.4 release Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/517 Reviewed By: alexander-kirillov Differential Revision: D27029723 Pulled By: ppwwyyxx fbshipit-source-id: 4dccf454612e468ba88f73360aff8c7ecee2819d --- INSTALL.md | 28 +++++++++++++++------------- detectron2/__init__.py | 2 +- dev/packaging/build_all_wheels.sh | 9 +++++---- dev/packaging/gen_install_table.py | 5 +++-- dev/packaging/gen_wheel_index.sh | 2 +- dev/packaging/pkg_helpers.bash | 14 +++++++------- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1501cd6e84..53912351c8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -28,34 +28,34 @@ old build first. You often need to rebuild detectron2 after reinstalling PyTorch ### Install Pre-Built Detectron2 (Linux only) -Choose from this table to install [v0.3 (Nov 2020)](https://github.com/facebookresearch/detectron2/releases): +Choose from this table to install [v0.4 (Mar 2021)](https://github.com/facebookresearch/detectron2/releases): -
CUDA torch 1.7torch 1.6torch 1.5
11.0
install
python -m pip install detectron2 -f \
+
CUDA torch 1.8torch 1.7torch 1.6
11.1
install
python -m pip install detectron2 -f \
+  https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
+
11.0
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
-
10.2
install
python -m pip install detectron2 -f \
+
10.2
install
python -m pip install detectron2 -f \
+  https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.8/index.html
+
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.7/index.html
 
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.6/index.html
-
install
python -m pip install detectron2 -f \
-  https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.5/index.html
 
10.1
install
python -m pip install detectron2 -f \
+  https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
+
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.7/index.html
 
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.6/index.html
-
install
python -m pip install detectron2 -f \
-  https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html
-
9.2
install
python -m pip install detectron2 -f \
+
9.2
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/torch1.7/index.html
 
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/torch1.6/index.html
-
install
python -m pip install detectron2 -f \
-  https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/torch1.5/index.html
 
cpu
install
python -m pip install detectron2 -f \
+  https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.8/index.html
+
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.7/index.html
 
install
python -m pip install detectron2 -f \
   https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.6/index.html
-
install
python -m pip install detectron2 -f \
-  https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.5/index.html
 
@@ -183,6 +183,8 @@ to match your local CUDA installation, or install a different version of CUDA to C++ compilation errors from NVCC / NVRTC; "Unsupported gpu architecture" +A few possibilities: + 1. Local CUDA/NVCC version has to match the CUDA version of your PyTorch. Both can be found in `python collect_env.py`. When they are inconsistent, you need to either install a different build of PyTorch (or build by yourself) to match your local CUDA installation, or install a different version of CUDA to match PyTorch. @@ -190,7 +192,7 @@ C++ compilation errors from NVCC / NVRTC; "Unsupported gpu architecture" 2. Local CUDA/NVCC version shall support the SM architecture (a.k.a. compute capability) of your GPU. The capability of your GPU can be found at [developer.nvidia.com/cuda-gpus](https://developer.nvidia.com/cuda-gpus). The capability supported by NVCC is listed at [here](https://gist.github.com/ax3l/9489132). - If your NVCC version is too old, this can be workaround a lower capability.environment variable + If your NVCC version is too old, this can be workaround by setting environment variable `TORCH_CUDA_ARCH_LIST` to a lower, supported capability. 3. The combination of NVCC and GCC you use is incompatible. You need to change one of their versions. diff --git a/detectron2/__init__.py b/detectron2/__init__.py index 93a2bd6bfe..a951838f58 100644 --- a/detectron2/__init__.py +++ b/detectron2/__init__.py @@ -7,4 +7,4 @@ # This line will be programatically read/write by setup.py. # Leave them at the bottom of this file and don't touch them. -__version__ = "0.3" +__version__ = "0.4" diff --git a/dev/packaging/build_all_wheels.sh b/dev/packaging/build_all_wheels.sh index 407f5718a2..00bdb9e595 100755 --- a/dev/packaging/build_all_wheels.sh +++ b/dev/packaging/build_all_wheels.sh @@ -24,6 +24,7 @@ build_one() { esac echo "Launching container $container_name ..." + container_id="$container_name"_"$cu"_"$pytorch_ver" py_versions=(3.6 3.7 3.8) if [[ $pytorch_ver == "1.8" ]]; then @@ -32,18 +33,18 @@ build_one() { for py in "${py_versions[@]}"; do docker run -itd \ - --name $container_name \ + --name "$container_id" \ --mount type=bind,source="$(pwd)",target=/detectron2 \ pytorch/$container_name - cat <
""" CUDA_SUFFIX = { + "11.1": "cu111", "11.0": "cu110", "10.2": "cu102", "10.1": "cu101", @@ -34,9 +35,9 @@ def gen_header(torch_versions): d2_version = f"=={args.d2_version}" if args.d2_version else "" all_versions = ( - [("1.5", k) for k in ["10.2", "10.1", "9.2", "cpu"]] - + [("1.6", k) for k in ["10.2", "10.1", "9.2", "cpu"]] + [("1.6", k) for k in ["10.2", "10.1", "9.2", "cpu"]] + [("1.7", k) for k in ["11.0", "10.2", "10.1", "9.2", "cpu"]] + + [("1.8", k) for k in ["11.1", "10.2", "10.1", "cpu"]] ) torch_versions = sorted({k[0] for k in all_versions}, key=float, reverse=True) diff --git a/dev/packaging/gen_wheel_index.sh b/dev/packaging/gen_wheel_index.sh index 7413bace10..a5bb0dd990 100755 --- a/dev/packaging/gen_wheel_index.sh +++ b/dev/packaging/gen_wheel_index.sh @@ -14,7 +14,7 @@ export LC_ALL=C # reproducible sort index=$root/index.html cd "$root" -for cu in cpu cu92 cu100 cu101 cu102 cu110; do +for cu in cpu cu92 cu100 cu101 cu102 cu110 cu111; do cd "$root/$cu" echo "Creating $PWD/index.html ..." # First sort by torch version, then stable sort by d2 version with unique. diff --git a/dev/packaging/pkg_helpers.bash b/dev/packaging/pkg_helpers.bash index cbbb06e457..65c6114ae6 100755 --- a/dev/packaging/pkg_helpers.bash +++ b/dev/packaging/pkg_helpers.bash @@ -19,31 +19,31 @@ setup_cuda() { case "$CU_VERSION" in cu112) export CUDA_HOME=/usr/local/cuda-11.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX;8.0+PTX;8.6+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0;8.6+PTX" ;; cu111) export CUDA_HOME=/usr/local/cuda-11.1/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX;8.0+PTX;8.6+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0;8.6+PTX" ;; cu110) export CUDA_HOME=/usr/local/cuda-11.0/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX;8.0+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0+PTX" ;; cu102) export CUDA_HOME=/usr/local/cuda-10.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" ;; cu101) export CUDA_HOME=/usr/local/cuda-10.1/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" ;; cu100) export CUDA_HOME=/usr/local/cuda-10.0/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX;7.5+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" ;; cu92) export CUDA_HOME=/usr/local/cuda-9.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0+PTX;6.1+PTX;7.0+PTX" + export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0+PTX" ;; cpu) unset FORCE_CUDA