Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup jinja syntax #28100

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 15 additions & 32 deletions recipes/sam-2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
# They claim version 1.0 but they don't really release anything on pypi
{% set version = "1.0.0." + git_hash_date + "." + git_hash %}

{% if cuda_compiler_version in (None, "None", True, False) %}
{% set cuda_major = 0 %}
{% else %}
{% set cuda_major = environ.get("cuda_compiler_version", "11.2").split(".")[0] | int %}
{% endif %}

package:
# Their package name is "SAM 2" pip claims it is "SAM-2"
# the lower case is thus "sam-2"
Expand All @@ -23,9 +17,7 @@ source:
- remove_torchvision_minimum_requirement.patch

{% set build = 1 %}
{% if cuda_major != 0 %}
{% set build = build + 300 %}
{% endif %}
{% set build = build + 300 %} # [cuda_compiler_version != "None"]

build:
string: cpu_pyh{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
Expand All @@ -35,48 +27,39 @@ build:
- export TORCH_CUDA_ARCH_LIST="5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX" # [cuda_compiler_version != "None"]
- export CUDA_TOOLKIT_ROOT_DIR="${PREFIX}" # [cuda_compiler_version != "None"]
- export FORCE_CUDA=1 # [cuda_compiler_version != "None"]
- {{ PYTHON }} -m pip install . -vv
- python -m pip install . -vv
number: {{ build }}
skip: true # [win]
# A contributor can come and help build out 11.8 correctly
skip: true # [cuda_compiler_version == "11.8"]
{% if cuda_major != 0 %}
skip: true # [py<310]
{% else %}
noarch: python
{% endif %}
skip: true # [cuda_compiler_version == "11.8"]
skip: true # [py<310]
# noarch: python # [cuda_compiler_version == "None"]

requirements:
build:
- {{ stdlib('c') }} # [cuda_compiler_version != "None"]
- {{ compiler('c') }} # [cuda_compiler_version != "None"]
- {{ compiler('cxx') }} # [cuda_compiler_version != "None"]
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
{% if cuda_major >= 12 %}
- libcublas-dev # [build_platform != target_platform]
- libcusolver-dev # [build_platform != target_platform]
- libcusparse-dev # [build_platform != target_platform]
- cuda-cudart-dev # [build_platform != target_platform]
{% endif %}
- libcublas-dev # [build_platform != target_platform and cuda_compiler_version != "None"]
- libcusolver-dev # [build_platform != target_platform and cuda_compiler_version != "None"]
- libcusparse-dev # [build_platform != target_platform and cuda_compiler_version != "None"]
- cuda-cudart-dev # [build_platform != target_platform and cuda_compiler_version != "None"]
host:
- python # [cuda_compiler_version != "None"]
- python >=3.10 # [cuda_compiler_version == "None"]
- python
- pip
- setuptools
# For now pin to pytorch 2.4.1 to avoid 2.3.X builds that
# don't have the correct run exports
- pytorch 2.4.1
- libtorch *=cuda* # [cuda_compiler_version != "None"]
{% if cuda_major >= 12 %}
- libcublas-dev
- libcusolver-dev
- libcusparse-dev
- cuda-cudart-dev
{% endif %}
- libcublas-dev # [cuda_compiler_version != "None"]
- libcusolver-dev # [cuda_compiler_version != "None"]
- libcusparse-dev # [cuda_compiler_version != "None"]
- cuda-cudart-dev # [cuda_compiler_version != "None"]
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
run:
- python # [cuda_compiler_version != "None"]
- python >=3.10 # [cuda_compiler_version == "None"]
- python
- hydra-core
- pytorch
- torchvision >=0.18.1
Expand Down