From 0fecb2ddb9830b03e69bb8fe77a4596a8b7edf66 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Tue, 7 Apr 2020 09:40:31 -0700 Subject: [PATCH] pytorch version in package name Summary: Pytorch 1.5 is coming soon. I imagine we will want the ability to upload conda packages for pytorch3d to anaconda cloud for each of pytorch 1.4 and pytorch 1.5. This change adds the dependent pytorch version to the name of the conda package to make that feasible. As an example, a built package after this change will have a name like `linux-64/pytorch3d-0.1.1-py38_cu100_pyt14.tar.bz2`, instead of simply `linux-64/pytorch3d-0.1.1-py38_cu100.tar.bz2`. Also some tiny cleanup of circleci config. Other alternatives: (1) forcing users to update pytorch and pytorch3d together, (2) trying to get away with one build for multiple pytorch versions. Reviewed By: nikhilaravi Differential Revision: D20599039 fbshipit-source-id: 20164eda4a5141afed47b3596e559950d796ffc9 --- .circleci/config.in.yml | 6 +++--- .circleci/config.yml | 6 +++--- .circleci/regenerate.py | 2 -- packaging/conda/build_pytorch3d.sh | 2 ++ packaging/pkg_helpers.bash | 1 + packaging/pytorch3d/meta.yaml | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.in.yml b/.circleci/config.in.yml index 139f6cbb..b6baeeb9 100644 --- a/.circleci/config.in.yml +++ b/.circleci/config.in.yml @@ -213,16 +213,16 @@ workflows: cu_version: "cu100" - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.6_cpu + name: macos_wheel_py3.6_cpu python_version: '3.6' pytorch_version: '1.4' - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.7_cpu + name: macos_wheel_py3.7_cpu python_version: '3.7' pytorch_version: '1.4' - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.8_cpu + name: macos_wheel_py3.8_cpu python_version: '3.8' pytorch_version: '1.4' diff --git a/.circleci/config.yml b/.circleci/config.yml index 676f67dd..2e9c2c30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -278,16 +278,16 @@ workflows: cu_version: "cu100" - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.6_cpu + name: macos_wheel_py3.6_cpu python_version: '3.6' pytorch_version: '1.4' - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.7_cpu + name: macos_wheel_py3.7_cpu python_version: '3.7' pytorch_version: '1.4' - binary_macos_wheel: cu_version: cpu - name: binary_linux_wheel_py3.8_cpu + name: macos_wheel_py3.8_cpu python_version: '3.8' pytorch_version: '1.4' diff --git a/.circleci/regenerate.py b/.circleci/regenerate.py index 71440518..3cb534e6 100755 --- a/.circleci/regenerate.py +++ b/.circleci/regenerate.py @@ -3,8 +3,6 @@ """ This script is adapted from the torchvision one. -There is no python2.7 nor macos. -TODO: python 3.8 when pytorch 1.4. """ import os.path diff --git a/packaging/conda/build_pytorch3d.sh b/packaging/conda/build_pytorch3d.sh index 1a4a0f04..e0dcf2e9 100755 --- a/packaging/conda/build_pytorch3d.sh +++ b/packaging/conda/build_pytorch3d.sh @@ -139,6 +139,8 @@ else export CONDA_PYTORCH_CONSTRAINT="- pytorch==${PYTORCH_VERSION}" fi +export PYTORCH_VERSION_NODOT=${PYTORCH_VERSION//./} + # Loop through all Python versions to build a package for each for py_ver in "${DESIRED_PYTHON[@]}"; do build_string="py${py_ver}_${build_string_suffix}" diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 9d8201c7..cd4fd6f0 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -223,6 +223,7 @@ setup_conda_pytorch_constraint() { export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX}" export CONDA_PYTORCH_CONSTRAINT="- pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX}" fi + export PYTORCH_VERSION_NODOT=${PYTORCH_VERSION//./} } # Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT diff --git a/packaging/pytorch3d/meta.yaml b/packaging/pytorch3d/meta.yaml index f2b83d6e..173fae0c 100644 --- a/packaging/pytorch3d/meta.yaml +++ b/packaging/pytorch3d/meta.yaml @@ -26,7 +26,7 @@ requirements: {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} build: - string: py{{py}}_{{ environ['CU_VERSION'] }} + string: py{{py}}_{{ environ['CU_VERSION'] }}_pyt{{ environ['PYTORCH_VERSION_NODOT']}} script: python setup.py install --single-version-externally-managed --record=record.txt # [not win] script_env: - CUDA_HOME