@@ -26,7 +26,7 @@ windows-cpu: &windows_cpu
26
26
# resource_class: windows.gpu.nvidia.medium
27
27
# image: windows-server-2019-nvidia:stable
28
28
29
- pytorch_parameters : &pytorch_parameters
29
+ version_parameters : &version_parameters
30
30
parameters :
31
31
pytorch_version :
32
32
type : string
@@ -37,11 +37,15 @@ pytorch_parameters: &pytorch_parameters
37
37
# use test wheels index to have access to RC wheels
38
38
# https://download.pytorch.org/whl/test/torch_test.html
39
39
default : " https://download.pytorch.org/whl/torch_stable.html"
40
+ python_version : # NOTE: only affect linux
41
+ type : string
42
+ default : ' 3.6.8'
40
43
41
44
environment :
42
45
PYTORCH_VERSION : << parameters.pytorch_version >>
43
46
TORCHVISION_VERSION : << parameters.torchvision_version >>
44
47
PYTORCH_INDEX : << parameters.pytorch_index >>
48
+ PYTHON_VERSION : << parameters.python_version>>
45
49
46
50
# -------------------------------------------------------------------------------------
47
51
# Re-usable commands
@@ -66,8 +70,10 @@ install_python: &install_python
66
70
name : Install Python
67
71
working_directory : ~/
68
72
command : |
69
- pyenv install -s 3.6.8
70
- pyenv global 3.6.8
73
+ # upgrade pyenv
74
+ cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
75
+ pyenv install -s $PYTHON_VERSION
76
+ pyenv global $PYTHON_VERSION
71
77
python --version
72
78
which python
73
79
pip install --upgrade pip
@@ -118,6 +124,8 @@ install_detectron2: &install_detectron2
118
124
- run :
119
125
name : Install Detectron2
120
126
command : |
127
+ # Remove if it's in cache
128
+ pip uninstall -y detectron2
121
129
pip install --progress-bar off -e .[all]
122
130
python -m detectron2.utils.collect_env
123
131
@@ -133,58 +141,58 @@ run_unittests: &run_unittests
133
141
jobs :
134
142
linux_cpu_tests :
135
143
<< : *cpu
136
- << : *pytorch_parameters
144
+ << : *version_parameters
137
145
138
146
working_directory : ~/detectron2
139
147
140
148
steps :
141
149
- checkout
142
150
143
- # Cache the venv directory that contains dependencies
151
+ # Cache the venv directory that contains python, dependencies, and checkpoints
144
152
# Refresh the key when dependencies should be updated (e.g. when pytorch releases)
145
153
- restore_cache :
146
154
keys :
147
- - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210802
155
+ - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
148
156
149
157
- << : *install_python
150
158
- << : *install_linux_dep
159
+ - << : *install_detectron2
160
+ - << : *run_unittests
151
161
152
162
- save_cache :
153
163
paths :
154
164
- /opt/circleci/.pyenv
155
- key : cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210802
165
+ - ~/.torch
166
+ key : cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
156
167
157
- - << : *install_detectron2
158
- - << : *run_unittests
159
168
160
169
linux_gpu_tests :
161
170
<< : *gpu
162
- << : *pytorch_parameters
171
+ << : *version_parameters
163
172
164
173
working_directory : ~/detectron2
165
174
166
175
steps :
167
176
- checkout
168
177
169
- # Cache the directory that contains python and dependencies
170
178
- restore_cache :
171
179
keys :
172
- - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210404
180
+ - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
173
181
174
182
- << : *install_python
175
183
- << : *install_linux_dep
184
+ - << : *install_detectron2
185
+ - << : *run_unittests
176
186
177
187
- save_cache :
178
188
paths :
179
189
- /opt/circleci/.pyenv
180
- key : cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210404
181
-
182
- - << : *install_detectron2
183
- - << : *run_unittests
190
+ - ~/.torch
191
+ key : cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
184
192
185
193
windows_cpu_build :
186
194
<< : *windows_cpu
187
- << : *pytorch_parameters
195
+ << : *version_parameters
188
196
steps :
189
197
- << : *add_ssh_keys
190
198
- checkout
@@ -221,8 +229,6 @@ workflows:
221
229
name : linux_cpu_tests_pytorch1.9
222
230
pytorch_version : ' 1.9.0+cpu'
223
231
torchvision_version : ' 0.10.0+cpu'
224
- context :
225
- - DOCKERHUB_TOKEN
226
232
- linux_gpu_tests :
227
233
name : linux_gpu_tests_pytorch1.7
228
234
pytorch_version : ' 1.7.0'
@@ -237,6 +243,11 @@ workflows:
237
243
name : linux_gpu_tests_pytorch1.9
238
244
pytorch_version : ' 1.9+cu102'
239
245
torchvision_version : ' 0.10+cu102'
246
+ - linux_gpu_tests :
247
+ name : linux_gpu_tests_pytorch1.9_python39
248
+ pytorch_version : ' 1.9+cu102'
249
+ torchvision_version : ' 0.10+cu102'
250
+ python_version : ' 3.9.6'
240
251
- windows_cpu_build :
241
252
pytorch_version : ' 1.9+cpu'
242
253
torchvision_version : ' 0.10+cpu'
0 commit comments