Skip to content

Commit

Permalink
back to conda, now with mkl
Browse files Browse the repository at this point in the history
  • Loading branch information
bottler committed Oct 29, 2024
1 parent b3533d7 commit 0c56a1a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
JUST_TESTRUN: 1
steps:
- uses: actions/checkout@v4
- name: Setup & build
uses: ./.github/actions/setup-env-build
with:
arch: 7.5
# - name: Setup & build
# uses: ./.github/actions/setup-env-build
# with:
# arch: 7.5
- name: Build and run tests
run: |-
python3 -m unittest discover -v -s tests -t .
# python3 -m unittest discover -v -s tests -t .
#conda create --name env --yes --quiet conda-build
#conda run --no-capture-output --name env python3 ./packaging/build_conda.py
conda create --name env --yes --quiet conda-build
conda run --no-capture-output --name env python3 ./packaging/build_conda.py
12 changes: 6 additions & 6 deletions packaging/build_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os.path
import runpy
import subprocess
from typing import List
from typing import List, Tuple

# required env vars:
# CU_VERSION: E.g. cu112
Expand All @@ -23,7 +23,7 @@
source_root_dir = os.environ["PWD"]


def version_constraint(version):
def version_constraint(version) -> str:
"""
Given version "11.3" returns " >=11.3,<11.4"
"""
Expand All @@ -32,7 +32,7 @@ def version_constraint(version):
return f" >={version},<{upper}"


def get_cuda_major_minor():
def get_cuda_major_minor() -> Tuple[str, str]:
if CU_VERSION == "cpu":
raise ValueError("fn only for cuda builds")
if len(CU_VERSION) != 5 or CU_VERSION[:2] != "cu":
Expand All @@ -42,7 +42,7 @@ def get_cuda_major_minor():
return major, minor


def setup_cuda():
def setup_cuda() -> None:
if CU_VERSION == "cpu":
return
major, minor = get_cuda_major_minor()
Expand Down Expand Up @@ -95,7 +95,7 @@ def setup_conda_pytorch_constraint() -> List[str]:
return ["-c", "pytorch", "-c", "nvidia"]


def setup_conda_cudatoolkit_constraint():
def setup_conda_cudatoolkit_constraint() -> None:
if CU_VERSION == "cpu":
os.environ["CONDA_CPUONLY_FEATURE"] = "- cpuonly"
os.environ["CONDA_CUDATOOLKIT_CONSTRAINT"] = ""
Expand All @@ -116,7 +116,7 @@ def setup_conda_cudatoolkit_constraint():
os.environ["CONDA_CUDATOOLKIT_CONSTRAINT"] = toolkit


def do_build(start_args: List[str]):
def do_build(start_args: List[str]) -> None:
args = start_args.copy()

test_flag = os.environ.get("TEST_FLAG")
Expand Down
2 changes: 2 additions & 0 deletions packaging/pytorch3d/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ requirements:

host:
- python
- mkl =2023 # [x86_64]
{{ environ.get('SETUPTOOLS_CONSTRAINT') }}
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }}
{{ environ.get('CONDA_PYTORCH_MKL_CONSTRAINT') }}
Expand All @@ -22,6 +23,7 @@ requirements:
- python
- numpy >=1.11
- torchvision >=0.5
- mkl =2023 # [x86_64]
- iopath
{{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}
Expand Down

0 comments on commit 0c56a1a

Please sign in to comment.