Weigh down cpu build via track_features
{% set name = "theseus-ai" %}
{% set version = "0.1.3" %}
-{% set build = 0 %}
-
-{% set processor = "cpu" if cuda_compiler_version == "None" else "gpu" %} # [not osx]
-{% set processor = "cpu" %} # [osx]
-
-# Prioritize gpu build if cudatoolkit can be installed (through __cuda virtual package)
-{% set build = build + 100 if processor == "gpu" else build %}
package:
name: {{ name|lower }}
@@ -17,8 +10,8 @@ source:
sha256: 150702236782c76815ad349d2089ef801469a9a8073610da77fe4b89a11ad5d1
build:
- number: {{ build }}
- skip: true # [(osx and cuda_compiler_version != "None") or win]
+ number: 0
+ skip: true # [win]
missing_dso_whitelist:
# pytorch builds put the libs in the wrong place, but hard to unbundle, see
# https://github.com/conda-forge/staged-recipes/pull/17082#issuecomment-1189149813
@@ -28,11 +21,16 @@ build:
- "*/libtorch_cpu{{ SHLIB_EXT }}"
- "*/libtorch_cuda{{ SHLIB_EXT }}"
- "*/libtorch_python{{ SHLIB_EXT }}"
+ string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
+ string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
+ # weigh down cpu implementation and give cuda preference
+ track_features:
+ - theseus-ai-cpu # [cuda_compiler_version == "None"]
requirements:
build:
- {{ compiler('cxx') }}
- - {{ compiler('cuda') }} # [not osx and cuda_compiler_version != "None"]
+ - {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
host:
- python
- pytorch
@@ -44,7 +42,7 @@ requirements:
- scikit-sparse >=0.4.5
- pybind11 >=2.7.1
- functorch
- - __cuda >={{ cuda_compiler_version }} # [not osx and cuda_compiler_version != "None"]
+ - __cuda >={{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
test:
imports:
