Skip to content

Commit

Permalink
v0.4 release
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: fairinternal/detectron2#517

Reviewed By: alexander-kirillov

Differential Revision: D27029723

Pulled By: ppwwyyxx

fbshipit-source-id: 4dccf454612e468ba88f73360aff8c7ecee2819d
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Mar 13, 2021
1 parent 10e97e4 commit 4aca4bd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
28 changes: 15 additions & 13 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

<table class="docutils"><tbody><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.7</th><th valign="bottom" align="left" width="100">torch 1.6</th><th valign="bottom" align="left" width="100">torch 1.5</th> <tr><td align="left">11.0</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.8</th><th valign="bottom" align="left" width="100">torch 1.7</th><th valign="bottom" align="left" width="100">torch 1.6</th> <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.8/index.html
</code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr><td align="left">11.0</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> <td align="left"> </td> <td align="left"> </td> </tr> <tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
</code></pre> </details> </td> <td align="left"> </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.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> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.6/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.5/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">10.1</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> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.6/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.5/index.html
</code></pre> </details> </td> </tr> <tr><td align="left">9.2</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">9.2</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> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/torch1.6/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/cu92/torch1.5/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.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> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.6/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.5/index.html
</code></pre> </details> </td> </tr></tbody></table>


Expand Down Expand Up @@ -183,14 +183,16 @@ to match your local CUDA installation, or install a different version of CUDA to
C++ compilation errors from NVCC / NVRTC; "Unsupported gpu architecture"
</summary>

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.

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.
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.3"
__version__ = "0.4"
9 changes: 5 additions & 4 deletions dev/packaging/build_all_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF | docker exec -i $container_name sh
cat <<EOF | docker exec -i $container_id sh
export CU_VERSION=$cu D2_VERSION_SUFFIX=+$cu PYTHON_VERSION=$py
export PYTORCH_VERSION=$pytorch_ver
cd /detectron2 && ./dev/packaging/build_wheel.sh
EOF

docker container stop $container_name
docker container rm $container_name
docker container stop $container_id
docker container rm $container_id
done
}

Expand Down
5 changes: 3 additions & 2 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.1": "cu111",
"11.0": "cu110",
"10.2": "cu102",
"10.1": "cu101",
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dev/packaging/gen_wheel_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions dev/packaging/pkg_helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4aca4bd

Please sign in to comment.