Skip to content

Commit

Permalink
add torch1.10 to CI
Browse files Browse the repository at this point in the history
Reviewed By: zhanghang1989

Differential Revision: D31853130

fbshipit-source-id: 749767cb24e88018ec3a613295d56f5c9d4b1899
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Oct 22, 2021
1 parent e98998d commit a24729a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
33 changes: 18 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ cpu: &cpu

gpu: &gpu
machine:
#image: ubuntu-1604-cuda-10.1:201909-23
# NOTE: use a cuda vesion that's supported by all our pytorch versions
image: ubuntu-1604-cuda-10.2:202012-01
resource_class: gpu.small
image: ubuntu-1604-cuda-11.1:202012-01
resource_class: gpu.nvidia.small

windows-cpu: &windows_cpu
machine:
Expand Down Expand Up @@ -226,22 +225,26 @@ workflows:
regular_test:
jobs:
- linux_cpu_tests:
name: linux_cpu_tests_pytorch1.9
pytorch_version: '1.9.0+cpu'
torchvision_version: '0.10.0+cpu'
name: linux_cpu_tests_pytorch1.10
pytorch_version: '1.10.0+cpu'
torchvision_version: '0.11.1+cpu'
- linux_gpu_tests:
name: linux_gpu_tests_pytorch1.8
pytorch_version: '1.8.1+cu102'
torchvision_version: '0.9.1+cu102'
pytorch_version: '1.8.1+cu111'
torchvision_version: '0.9.1+cu111'
- linux_gpu_tests:
name: linux_gpu_tests_pytorch1.9
pytorch_version: '1.9+cu102'
torchvision_version: '0.10+cu102'
pytorch_version: '1.9+cu111'
torchvision_version: '0.10+cu111'
- linux_gpu_tests:
name: linux_gpu_tests_pytorch1.9_python39
pytorch_version: '1.9+cu102'
torchvision_version: '0.10+cu102'
name: linux_gpu_tests_pytorch1.10
pytorch_version: '1.10+cu111'
torchvision_version: '0.11.1+cu111'
- linux_gpu_tests:
name: linux_gpu_tests_pytorch1.10_python39
pytorch_version: '1.10+cu111'
torchvision_version: '0.11.1+cu111'
python_version: '3.9.6'
- windows_cpu_build:
pytorch_version: '1.9+cpu'
torchvision_version: '0.10+cpu'
pytorch_version: '1.10+cpu'
torchvision_version: '0.11.1+cpu'
11 changes: 7 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
with:
python-version: 3.6
- name: Install dependencies
# flake8-bugbear flake8-comprehensions are useful but not available internally
run: |
python -m pip install --upgrade pip
python -m pip install flake8==3.8.1 flake8-bugbear flake8-comprehensions isort==4.3.21
python -m pip install flake8==3.8.1 isort==4.3.21
python -m pip install black==21.4b2
flake8 --version
- name: Lint
Expand All @@ -36,12 +37,14 @@ jobs:
strategy:
fail-fast: false
matrix:
torch: [1.8, 1.9]
torch: ["1.8", "1.9", "1.10"]
include:
- torch: 1.8
- torch: "1.8"
torchvision: 0.9
- torch: 1.9
- torch: "1.9"
torchvision: "0.10"
- torch: "1.10"
torchvision: "0.11.1"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM nvidia/cuda:11.1.1-cudnn8-devel
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04
# use an older system (18.04) to avoid opencv incompatibility (issue#3524)

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
Expand All @@ -20,7 +21,7 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && \
# install dependencies
# See https://pytorch.org/ for other options if you use a different version of CUDA
RUN pip install --user tensorboard cmake # cmake from apt-get is too old
RUN pip install --user torch==1.9 torchvision==0.10 -f https://download.pytorch.org/whl/cu111/torch_stable.html
RUN pip install --user torch==1.10 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html

RUN pip install --user 'git+https://github.com/facebookresearch/fvcore'
# install detectron2
Expand Down
15 changes: 8 additions & 7 deletions docker/deploy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ USER appuser
ENV HOME=/home/appuser
WORKDIR $HOME

ENV CMAKE_PREFIX_PATH=$HOME/.local/lib/python3.8/site-packages/torch/
# Let torchvision find libtorch
ENV CMAKE_PREFIX_PATH=$HOME/.local/lib/python3.6/site-packages/torch/

RUN sudo apt-get update && sudo apt-get install libgflags-dev libgoogle-glog-dev libopencv-dev --yes
RUN pip install mkl-include

# Install the correct version of protobuf:
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protobuf-cpp-3.11.4.tar.gz && tar xf protobuf-cpp-3.11.4.tar.gz
# Install the correct version of protobuf (find it at torch/caffe2/proto/caffe2.pb.h after installing pytorch):
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.13.0/protobuf-cpp-3.13.0.tar.gz && tar xf protobuf-cpp-3.13.0.tar.gz
RUN export CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=$(python3 -c 'import torch; print(int(torch.compiled_with_cxx11_abi()))'); \
cd protobuf-3.11.4 && \
./configure --prefix=$HOME/.local && make && make install
cd protobuf-3.13.0 && \
./configure --prefix=$HOME/.local && make -j && make install

# install libtorchvision
RUN git clone --branch v0.10.0 https://github.com/pytorch/vision/
RUN git clone --branch v0.11.1 https://github.com/pytorch/vision/
RUN mkdir vision/build && cd vision/build && \
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=on -DTORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST && \
make && make install
make -j && make install

# make our installation take effect
ENV CPATH=$HOME/.local/include \
Expand Down

0 comments on commit a24729a

Please sign in to comment.