Skip to content

Commit

Permalink
torch1.10 + 0.6 release
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #3606

Reviewed By: wat3rBro

Differential Revision: D31884438

Pulled By: ppwwyyxx

fbshipit-source-id: 015da5b4e612a6eeaee9a92be7878770c7836156
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Oct 26, 2021
1 parent a24729a commit d1e0456
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 32 deletions.
25 changes: 11 additions & 14 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,32 @@ 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.5 (Jul 2021)](https://github.com/facebookresearch/detectron2/releases):
Choose from this table to install [v0.6 (Oct 2021)](https://github.com/facebookresearch/detectron2/releases):

<table class="docutils"><tbody><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.9</th><th valign="bottom" align="left" width="100">torch 1.8</th><th valign="bottom" align="left" width="100">torch 1.7</th> <tr><td align="left">11.1</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
<table class="docutils"><tbody><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.10</th><th valign="bottom" align="left" width="100">torch 1.9</th><th valign="bottom" align="left" width="100">torch 1.8</th> <tr><td align="left">11.3</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
</code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr><td align="left">11.1</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
</code></pre> </details> </td> <td align="left"> </td> </tr> <tr><td align="left">11.0</td><td align="left"> </td> <td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.10/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.8/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.7/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">10.1</td><td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
</code></pre> </details> </td> </tr> <tr><td align="left">10.1</td><td align="left"> </td> <td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.7/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">9.2</td><td align="left"> </td> <td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/torch1.7/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">cpu</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.8/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.7/index.html
</code></pre> </details> </td> </tr></tbody></table>


Note that:
1. The pre-built packages have to be used with corresponding version of CUDA and the official package of PyTorch.
Otherwise, please build detectron2 from source.
Expand Down
2 changes: 1 addition & 1 deletion detectron2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.5"
__version__ = "0.6"
16 changes: 6 additions & 10 deletions dev/packaging/build_all_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ build_one() {
echo "Launching container $container_name ..."
container_id="$container_name"_"$cu"_"$pytorch_ver"

py_versions=(3.6 3.7 3.8)
if [[ $pytorch_ver != "1.7" ]]; then
py_versions+=(3.9)
fi
py_versions=(3.6 3.7 3.8 3.9)

for py in "${py_versions[@]}"; do
docker run -itd \
Expand All @@ -52,6 +49,11 @@ EOF
if [[ -n "$1" ]] && [[ -n "$2" ]]; then
build_one "$1" "$2"
else
build_one cu113 1.10
build_one cu111 1.10
build_one cu102 1.10
build_one cpu 1.10

build_one cu111 1.9
build_one cu102 1.9
build_one cpu 1.9
Expand All @@ -60,10 +62,4 @@ else
build_one cu102 1.8
build_one cu101 1.8
build_one cpu 1.8

build_one cu110 1.7
build_one cu102 1.7
build_one cu101 1.7
build_one cu92 1.7
build_one cpu 1.7
fi
9 changes: 6 additions & 3 deletions dev/packaging/gen_install_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
https://dl.fbaipublicfiles.com/detectron2/wheels/{cuda}/torch{torch}/index.html
</code></pre> </details>"""
CUDA_SUFFIX = {
"11.3": "cu113",
"11.1": "cu111",
"11.0": "cu110",
"10.2": "cu102",
Expand All @@ -35,12 +36,14 @@ def gen_header(torch_versions):
d2_version = f"=={args.d2_version}" if args.d2_version else ""

all_versions = (
[("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"]]
[("1.8", k) for k in ["11.1", "10.2", "10.1", "cpu"]]
+ [("1.9", k) for k in ["11.1", "10.2", "cpu"]]
+ [("1.10", k) for k in ["11.3", "11.1", "10.2", "cpu"]]
)

torch_versions = sorted({k[0] for k in all_versions}, key=float, reverse=True)
torch_versions = sorted(
{k[0] for k in all_versions}, key=lambda x: int(x.split(".")[1]), reverse=True
)
cuda_versions = sorted(
{k[1] for k in all_versions}, key=lambda x: float(x) if x != "cpu" else 0, reverse=True
)
Expand Down
7 changes: 4 additions & 3 deletions dev/packaging/gen_wheel_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Copyright (c) Facebook, Inc. and its affiliates.


root=$1
root=$(readlink -f $1)
if [[ -z "$root" ]]; then
echo "Usage: ./gen_wheel_index.sh /path/to/wheels"
echo "Usage: ./gen_wheel_index.sh /absolute/path/to/wheels"
exit
fi

Expand All @@ -14,7 +14,8 @@ export LC_ALL=C # reproducible sort
index=$root/index.html

cd "$root"
for cu in cpu cu92 cu100 cu101 cu102 cu110 cu111; do
for cu in cpu cu92 cu100 cu101 cu102 cu110 cu111 cu113; do
mkdir -p "$root/$cu"
cd "$root/$cu"
echo "Creating $PWD/index.html ..."
# First sort by torch version, then stable sort by d2 version with unique.
Expand Down
7 changes: 6 additions & 1 deletion dev/packaging/pkg_helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ pip_install() {
setup_cuda() {
# Now work out the CUDA settings
# Like other torch domain libraries, we choose common GPU architectures only.
# See more details at https://github.com/pytorch/pytorch/blob/master/torch/utils/cpp_extension.py#L1363
# See https://github.com/pytorch/pytorch/blob/master/torch/utils/cpp_extension.py
# and https://github.com/pytorch/vision/blob/main/packaging/pkg_helpers.bash for reference.
export FORCE_CUDA=1
case "$CU_VERSION" in
cu113)
export CUDA_HOME=/usr/local/cuda-11.3/
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"
;;
cu112)
export CUDA_HOME=/usr/local/cuda-11.2/
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"
Expand Down
5 changes: 5 additions & 0 deletions tests/layers/test_deformable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
import torch

from detectron2.layers import DeformConv, ModulatedDeformConv
from detectron2.utils.env import TORCH_VERSION


@unittest.skipIf(
TORCH_VERSION == (1, 8) and torch.cuda.is_available(),
"This test fails under cuda11 + torch1.8.",
)
class DeformableTest(unittest.TestCase):
@unittest.skipIf(not torch.cuda.is_available(), "Deformable not supported for cpu")
def test_forward_output(self):
Expand Down

0 comments on commit d1e0456

Please sign in to comment.