@@ -179,10 +179,21 @@ setup_pip_pytorch_version() {
179
179
#
180
180
# You MUST have populated PYTORCH_VERSION_SUFFIX before hand.
181
181
setup_conda_pytorch_constraint () {
182
- CONDA_CHANNEL_FLAGS=${CONDA_CHANNEL_FLAGS:- }
183
182
if [[ -z " $PYTORCH_VERSION " ]]; then
184
- export CONDA_CHANNEL_FLAGS=" ${CONDA_CHANNEL_FLAGS} -c pytorch-nightly"
185
- export PYTORCH_VERSION=" $( conda search --json ' pytorch[channel=pytorch-nightly]' | python -c " import sys, json, re; print(re.sub(r'\\ +.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))" ) "
183
+ export CONDA_CHANNEL_FLAGS=" ${CONDA_CHANNEL_FLAGS} -c pytorch-nightly -c pytorch"
184
+ export PYTORCH_VERSION=" $( conda search --json ' pytorch[channel=pytorch-nightly]' | \
185
+ python -c " import os, sys, json, re; cuver = os.environ.get('CU_VERSION'); \
186
+ cuver_1 = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
187
+ cuver_2 = (cuver[:-1] + '.' + cuver[-1]).replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
188
+ print(re.sub(r'\\ +.*$', '', \
189
+ [x['version'] for x in json.load(sys.stdin)['pytorch'] \
190
+ if (x['platform'] == 'darwin' or cuver_1 in x['fn'] or cuver_2 in x['fn']) \
191
+ and 'py' + os.environ['PYTHON_VERSION'] in x['fn']][-1]))" ) "
192
+ if [[ -z " $PYTORCH_VERSION " ]]; then
193
+ echo " PyTorch version auto detection failed"
194
+ echo " No package found for CU_VERSION=$CU_VERSION and PYTHON_VERSION=$PYTHON_VERSION "
195
+ exit 1
196
+ fi
186
197
else
187
198
export CONDA_CHANNEL_FLAGS=" ${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-${UPLOAD_CHANNEL} "
188
199
fi
@@ -193,15 +204,39 @@ setup_conda_pytorch_constraint() {
193
204
export CONDA_PYTORCH_BUILD_CONSTRAINT=" - pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX} "
194
205
export CONDA_PYTORCH_CONSTRAINT=" - pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX} "
195
206
fi
207
+ if [[ " $OSTYPE " == msys && " $CU_VERSION " == cu92 ]]; then
208
+ export CONDA_CHANNEL_FLAGS=" ${CONDA_CHANNEL_FLAGS} -c defaults -c numba/label/dev"
209
+ fi
196
210
}
197
211
198
212
# Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT
199
213
setup_conda_cudatoolkit_constraint () {
200
- export CONDA_CPUONLY_FEATURE= " "
214
+ export CONDA_BUILD_VARIANT= " cuda "
201
215
if [[ " $( uname) " == Darwin ]]; then
202
- export CONDA_CUDATOOLKIT_CONSTRAINT= " "
216
+ export CONDA_BUILD_VARIANT= " cpu "
203
217
else
204
218
case " $CU_VERSION " in
219
+ cu115)
220
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=11.5,<11.6 # [not osx]"
221
+ ;;
222
+ cu113)
223
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=11.3,<11.4 # [not osx]"
224
+ ;;
225
+ cu112)
226
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=11.2,<11.3 # [not osx]"
227
+ ;;
228
+ cu111)
229
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=11.1,<11.2 # [not osx]"
230
+ ;;
231
+ cu110)
232
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=11.0,<11.1 # [not osx]"
233
+ ;;
234
+ cu102)
235
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=10.2,<10.3 # [not osx]"
236
+ ;;
237
+ cu101)
238
+ export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=10.1,<10.2 # [not osx]"
239
+ ;;
205
240
cu100)
206
241
export CONDA_CUDATOOLKIT_CONSTRAINT=" - cudatoolkit >=10.0,<10.1 # [not osx]"
207
242
;;
@@ -210,7 +245,7 @@ setup_conda_cudatoolkit_constraint() {
210
245
;;
211
246
cpu)
212
247
export CONDA_CUDATOOLKIT_CONSTRAINT=" "
213
- export CONDA_CPUONLY_FEATURE= " - cpuonly "
248
+ export CONDA_BUILD_VARIANT= " cpu "
214
249
;;
215
250
* )
216
251
echo " Unrecognized CU_VERSION=$CU_VERSION "
0 commit comments