This repository was archived by the owner on Aug 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +50
-5
lines changed Expand file tree Collapse file tree 6 files changed +50
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ docker run --rm -it \
2424 -e DESIRED_PYTHON=3.8 \
2525 -e PYTORCH_BUILD_VERSION=1.5.0 \
2626 -e PYTORCH_BUILD_NUMBER=1 \
27- -e OVERRIDE_PACKAGE_VERSION=1.5.0
2827 -e TORCH_CONDA_BUILD_FOLDER=pytorch-nightly \
2928 -v /path/to/pytorch:/pytorch \
3029 -v /path/to/builder:/builder \
Original file line number Diff line number Diff line change @@ -254,13 +254,12 @@ if [[ -n "$cpu_only" ]]; then
254254 if [[ " $OSTYPE " != " darwin" * ]]; then
255255 build_string_suffix=" cpu_${build_string_suffix} "
256256 fi
257- # on Linux, advertise that the package sets the cpuonly feature
258- export CONDA_CPU_ONLY_FEATURE=" - cpuonly # [not osx]"
257+ export PYTORCH_BUILD_VARIANT=" cpu"
259258else
260259 # Switch the CUDA version that /usr/local/cuda points to. This script also
261260 # sets CUDA_VERSION and CUDNN_VERSION
262261 echo " Switching to CUDA version $desired_cuda "
263- export CONDA_CPU_ONLY_FEATURE= " "
262+ export PYTORCH_BUILD_VARIANT= " cuda "
264263 . ./switch_cuda_version.sh " $desired_cuda "
265264 # TODO, simplify after anaconda fixes their cudatoolkit versioning inconsistency.
266265 # see: https://github.com/conda-forge/conda-forge.github.io/issues/687#issuecomment-460086164
Original file line number Diff line number Diff line change 11package :
22 name : cpuonly
3- version : 1 .0
3+ version : 2 .0
44
55build :
66 track_features :
77 - cpuonly
88 noarch : generic
9+
10+ requirements :
11+ run :
12+ - pytorch-mutex 1.0 cpu
Original file line number Diff line number Diff line change 1+ build_variant :
2+ - cpu
3+ - cuda
Original file line number Diff line number Diff line change 1+ {% set version = "1.0" %}
2+ {% set build = 0 %}
3+
4+ {% if build_variant == 'cuda' %}
5+ # prefer cuda builds via a build number offset
6+ {% set build = build + 100 %}
7+ {% endif %}
8+
9+ package :
10+ name : pytorch-mutex
11+ version : {{ version }}
12+ build :
13+ number : {{ build }}
14+ string : {{ build_variant }}
15+ noarch : generic
16+ # also lower cpu priority with track_features
17+ {% if build_variant == 'cpu' %}
18+ track_features :
19+ - pytorch-mutex
20+ {% endif %}
21+ run_exports :
22+ - {{ pin_subpackage('pytorch-mutex', exact=True) }}
23+ requirements : {}
24+ # None, pytorch should depend on pytorch-mutex
25+ test :
26+ commands :
27+ - echo "pytorch-mutex metapackage is created."
28+ about :
29+ summary : Metapackage to select the PyTorch variant. Use conda's pinning mechanism in your environment to control which variant you want.
Original file line number Diff line number Diff line change 1+ {% set build_variant = environ.get('PYTORCH_BUILD_VARIANT', 'cuda') %}
2+
13package :
24 name : pytorch
35 version : " {{ environ.get('PYTORCH_BUILD_VERSION') }}"
@@ -36,8 +38,17 @@ requirements:
3638 - intel-openmp # [win]
3739 - typing_extensions
3840 - blas * mkl
41+ - pytorch-mutex 1.0 {{ build_variant }}
3942{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }}
4043
44+ {% if build_variant == 'cpu' %}
45+ run_constrained :
46+ - cpuonly
47+ {% else %}
48+ run_constrained :
49+ - cpuonly <0
50+ {% endif %}
51+
4152build :
4253 number : {{ environ.get('PYTORCH_BUILD_NUMBER', '1') }}
4354 detect_binary_files_with_prefix : False
You can’t perform that action at this time.
0 commit comments