Skip to content

Commit d3073ab

Browse files
committed
Move TorchAudio conda package to use pytorch-mutex
This is follow up after pytorch/builder#823 that gets rids of `feature` and migrate it to `run_constrained`
1 parent 234627f commit d3073ab

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

packaging/pkg_helpers.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ setup_conda_pytorch_constraint() {
246246

247247
# Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT
248248
setup_conda_cudatoolkit_constraint() {
249-
export CONDA_CPUONLY_FEATURE=""
249+
export CONDA_BUILD_VARIANT="cuda"
250250
if [[ "$(uname)" == Darwin ]]; then
251-
export CONDA_CUDATOOLKIT_CONSTRAINT=""
251+
export CONDA_BUILD_VARIANT="cpu"
252252
else
253253
case "$CU_VERSION" in
254254
cu113)
@@ -277,7 +277,7 @@ setup_conda_cudatoolkit_constraint() {
277277
;;
278278
cpu)
279279
export CONDA_CUDATOOLKIT_CONSTRAINT=""
280-
export CONDA_CPUONLY_FEATURE="- cpuonly"
280+
export CONDA_BUILD_VARIANT="cpu"
281281
;;
282282
*)
283283
echo "Unrecognized CU_VERSION=$CU_VERSION"

packaging/torchaudio/meta.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% set build_variant = environ.get('CONDA_BUILD_VARIANT', 'cpu') %}
12
package:
23
name: torchaudio
34
version: "{{ environ.get('BUILD_VERSION', '0.0.0') }}"
@@ -16,25 +17,32 @@ requirements:
1617
- cmake
1718
- ninja
1819
- defaults::numpy >=1.11
20+
- pytorch-mutex 1.0 {{ build_variant }} # [not osx ]
1921
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT', 'pytorch') }}
2022
{{ environ.get('CONDA_EXTRA_BUILD_CONSTRAINT', '') }}
21-
{{ environ.get('CONDA_CPUONLY_FEATURE', '') }}
2223
{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }}
2324

2425
run:
2526
- python
2627
- defaults::numpy >=1.11
28+
- pytorch-mutex 1.0 {{ build_variant }} # [not osx ]
2729
{{ environ.get('CONDA_PYTORCH_CONSTRAINT', 'pytorch') }}
2830
{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }}
2931

32+
{% if build_variant == 'cpu' %}
33+
run_constrained:
34+
- cpuonly
35+
{% elif not osx %}
36+
run_constrained:
37+
- cpuonly <0
38+
{% endif %}
39+
3040
build:
3141
string: py{{py}}_{{ environ.get('CU_VERSION', 'cpu') }}
3242
script_env:
3343
- BUILD_VERSION
3444
- USE_CUDA
3545
- TORCH_CUDA_ARCH_LIST
36-
features:
37-
{{ environ.get('CONDA_CPUONLY_FEATURE', '') }}
3846

3947
test:
4048
imports:
@@ -52,7 +60,7 @@ test:
5260
# Ideally we would test this, but conda doesn't provide librosa
5361
# - librosa >=0.4.3
5462
- scipy
55-
{{ environ.get('CONDA_CPUONLY_FEATURE', '') }}
63+
- pytorch-mutex 1.0 {{ build_variant }} # [not osx ]
5664

5765
about:
5866
home: https://github.com/pytorch/audio

0 commit comments

Comments
 (0)