Skip to content

Commit 8f5a1e3

Browse files
committed
build for pytorch 1.6.0
1 parent aba2c71 commit 8f5a1e3

File tree

2 files changed

+89
-39
lines changed

2 files changed

+89
-39
lines changed

.travis.yml

Lines changed: 81 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,90 @@ os:
88
env:
99
global:
1010
- CUDA_HOME=/usr/local/cuda
11-
1211
jobs:
13-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cpu
14-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
15-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
16-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
17-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cpu
18-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
19-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
20-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
21-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cpu
22-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
23-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
24-
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
12+
# Python 3.6
13+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cpu
14+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu92
15+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu101
16+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu102
17+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cpu
18+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu92
19+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu101
20+
- PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu102
21+
# Python 3.7
22+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cpu
23+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu92
24+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu101
25+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu102
26+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cpu
27+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu92
28+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu101
29+
- PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu102
30+
# Python 3.8
31+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cpu
32+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu92
33+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu101
34+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu102
35+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cpu
36+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu92
37+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu101
38+
- PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu102
2539

2640
jobs:
27-
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2 jobs.
28-
- os: osx
29-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
30-
- os: osx
31-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
32-
- os: osx
33-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
34-
- os: osx
35-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
36-
- os: osx
37-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
38-
- os: osx
39-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
40-
- os: osx
41-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
42-
- os: osx
43-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
44-
- os: osx
45-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
46-
- os: windows
47-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
48-
- os: windows
49-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
50-
- os: windows
51-
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
41+
# For daily builds, we only test on *Python 3.6* and *CUDA 10.2*.
42+
# For deployment, we exclude *all* macOS CUDA and Windows CUDA 9.2 jobs.
43+
exclude:
44+
# Python 3.6
45+
- if: not (tag is present or commit_message =~ ci-deploy) and os != osx
46+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cpu
47+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
48+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu92
49+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
50+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu101
51+
- if: os = osx
52+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.6.0 IDX=cu102
53+
- if: not (tag is present or commit_message =~ ci-deploy) and os != osx
54+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cpu
55+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
56+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu92
57+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
58+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu101
59+
- if: os = osx
60+
env: PYTHON_VERSION=3.6 TORCH_VERSION=1.5.0 IDX=cu102
61+
# Python 3.7
62+
- if: not (tag is present or commit_message =~ ci-deploy)
63+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cpu
64+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
65+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu92
66+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
67+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu101
68+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
69+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.6.0 IDX=cu102
70+
- if: not (tag is present or commit_message =~ ci-deploy)
71+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cpu
72+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
73+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu92
74+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
75+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu101
76+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
77+
env: PYTHON_VERSION=3.7 TORCH_VERSION=1.5.0 IDX=cu102
78+
# Python 3.8
79+
- if: not (tag is present or commit_message =~ ci-deploy)
80+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cpu
81+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
82+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu92
83+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
84+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu101
85+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
86+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.6.0 IDX=cu102
87+
- if: not (tag is present or commit_message =~ ci-deploy)
88+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cpu
89+
- if: not (tag is present or commit_message =~ ci-deploy) or os != linux
90+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu92
91+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
92+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu101
93+
- if: not (tag is present or commit_message =~ ci-deploy) or os = osx
94+
env: PYTHON_VERSION=3.8 TORCH_VERSION=1.5.0 IDX=cu102
5295

5396
install:
5497
- source script/gcc.sh

script/torch.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
#!/bin/bash
22

33
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
4-
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
4+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${TORCH_VERSION}" = "1.5.0" ]; then
5+
echo "Fix nvcc for PyTorch 1.5.0"
56
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/api/module.h
67
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/runtime/argument_spec.h
78
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
89
fi
910

11+
# https://github.com/pytorch/pytorch/commit/d2e16dd888a9b5fd55bd475d4fcffb70f388d4f0
12+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${TORCH_VERSION}" = "1.6.0" ]; then
13+
echo "Fix nvcc for PyTorch 1.6.0"
14+
sed -i.bak -e 's/CONSTEXPR_EXCEPT_WIN_CUDA/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/api/module.h
15+
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
16+
fi

0 commit comments

Comments
 (0)