From fd63612e1339319783deca7475a7792a5168ee92 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 4 Aug 2022 11:14:25 -0700 Subject: [PATCH 01/12] Testing conda metapackage --- .circleci/unittest/linux/scripts/install.sh | 7 +++++-- packaging/build_cmake.sh | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index ace8583e47b..7699fd6f6e1 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -23,10 +23,13 @@ else version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" cuda_toolkit_pckg="cudatoolkit" + cudatoolkit="" if [[ "$CU_VERSION" == cu116 ]]; then cuda_toolkit_pckg="cuda" + cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" + else + cudatoolkit="-c nvidia cuda=11.6 atalman::pytorch-cuda=1.0=cuda11.6" fi - cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" fi case "$(uname -s)" in @@ -38,7 +41,7 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" if [ "${os}" == "MacOSX" ]; then conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" else - conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" + conda install -y -c "pytorch-${UPLOAD_CHANNEL} pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" fi printf "* Installing torchvision\n" diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index 35dfbc4a697..30bdd5ff546 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -42,7 +42,12 @@ else PYTORCH_MUTEX_CONSTRAINT='' fi -conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" +if [[ $CU_VERSION == "cu116" ]]; then + conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia cuda=11.6 atalman::pytorch-cuda=1.0=cuda11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" +else + conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" +fi + TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)")) if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then From 87ee6a42b8243de30bc055368169ed6237d82022 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 4 Aug 2022 11:58:24 -0700 Subject: [PATCH 02/12] Testing --- .circleci/unittest/linux/scripts/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 7699fd6f6e1..dd2a9d6ccc4 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -26,9 +26,9 @@ else cudatoolkit="" if [[ "$CU_VERSION" == cu116 ]]; then cuda_toolkit_pckg="cuda" - cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" - else cudatoolkit="-c nvidia cuda=11.6 atalman::pytorch-cuda=1.0=cuda11.6" + else + cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" fi fi @@ -41,7 +41,7 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" if [ "${os}" == "MacOSX" ]; then conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" else - conda install -y -c "pytorch-${UPLOAD_CHANNEL} pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" + conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" fi printf "* Installing torchvision\n" From 7f4256c5115a33d3d02d51b6593b57983811c78b Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 06:19:59 -0700 Subject: [PATCH 03/12] Testing pytorch-cuda --- packaging/pkg_helpers.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 88b3d910270..67748d24624 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -257,12 +257,14 @@ setup_conda_pytorch_constraint() { # Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT setup_conda_cudatoolkit_constraint() { export CONDA_BUILD_VARIANT="cuda" + export CONDA_PYTORCH_CUDA_CONSTRAINT="" if [[ "$(uname)" == Darwin ]]; then export CONDA_BUILD_VARIANT="cpu" else case "$CU_VERSION" in cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="- cuda >=11.6,<11.7 # [not osx]" + export CONDA_PYTORCH_CUDA_CONSTRAINT="- atalman::pytorch-cuda=1.0=cuda11.6" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.3,<11.4 # [not osx]" From eba49af3cfd82318d009d476ebebb3352eff8836 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 06:29:37 -0700 Subject: [PATCH 04/12] Testing --- packaging/pkg_helpers.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 67748d24624..63f34d2e59b 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -294,6 +294,7 @@ setup_conda_cudatoolkit_plain_constraint() { case "$CU_VERSION" in cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="cuda=11.6" + export CONDA_PYTORCH_CUDA_CONSTRAINT="atalman::pytorch-cuda=1.0=cuda11.6" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=11.3" From 03553576536e0b933a0caad307e1175d2adf579b Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 06:34:20 -0700 Subject: [PATCH 05/12] Testing --- packaging/torchvision/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 105e28c453e..a918e19fc29 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -32,6 +32,7 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} + {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '')}} {% if build_variant == 'cpu' %} run_constrained: From e5d6e93212967b4ba52141b692b2f33f6a72e768 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 06:59:52 -0700 Subject: [PATCH 06/12] Testing --- packaging/pkg_helpers.bash | 5 +++++ packaging/torchvision/meta.yaml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 63f34d2e59b..b03232d9df7 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -249,6 +249,11 @@ 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 + + if [[ "$CU_VERSION" == cu116 ]]; then + export CONDA_PYTORCH_BUILD_CONSTRAINT="${CONDA_PYTORCH_BUILD_CONSTRAINT} atalman::pytorch-cuda=1.0=cuda11.6" + fi + if [[ "$OSTYPE" == msys && "$CU_VERSION" == cu92 ]]; then export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c defaults -c numba/label/dev" fi diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index a918e19fc29..105e28c453e 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -32,7 +32,6 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} - {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '')}} {% if build_variant == 'cpu' %} run_constrained: From 4138d091bdb90a4da113081b32edb93db95f45ac Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 07:44:06 -0700 Subject: [PATCH 07/12] Testing --- packaging/build_cmake.sh | 2 +- packaging/pkg_helpers.bash | 6 +++--- packaging/torchvision/meta.yaml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index 30bdd5ff546..6b83e5d3aca 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -43,7 +43,7 @@ else fi if [[ $CU_VERSION == "cu116" ]]; then - conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia cuda=11.6 atalman::pytorch-cuda=1.0=cuda11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" + conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia -c pytorch-nightly cuda=11.6 pytorch-cuda=1.0=cuda11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" else conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" fi diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index b03232d9df7..c7133d61e12 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -251,7 +251,7 @@ setup_conda_pytorch_constraint() { fi if [[ "$CU_VERSION" == cu116 ]]; then - export CONDA_PYTORCH_BUILD_CONSTRAINT="${CONDA_PYTORCH_BUILD_CONSTRAINT} atalman::pytorch-cuda=1.0=cuda11.6" + export CONDA_PYTORCH_BUILD_CONSTRAINT="${CONDA_PYTORCH_BUILD_CONSTRAINT} pytorch-cuda=1.0=cuda11.6" fi if [[ "$OSTYPE" == msys && "$CU_VERSION" == cu92 ]]; then @@ -269,7 +269,7 @@ setup_conda_cudatoolkit_constraint() { case "$CU_VERSION" in cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="- cuda >=11.6,<11.7 # [not osx]" - export CONDA_PYTORCH_CUDA_CONSTRAINT="- atalman::pytorch-cuda=1.0=cuda11.6" + export CONDA_PYTORCH_CUDA_CONSTRAINT="- pytorch-cuda=1.0=cuda11.6" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.3,<11.4 # [not osx]" @@ -299,7 +299,7 @@ setup_conda_cudatoolkit_plain_constraint() { case "$CU_VERSION" in cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="cuda=11.6" - export CONDA_PYTORCH_CUDA_CONSTRAINT="atalman::pytorch-cuda=1.0=cuda11.6" + export CONDA_PYTORCH_CUDA_CONSTRAINT="pytorch-cuda=1.0=cuda11.6" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=11.3" diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 105e28c453e..3df8cd12779 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -20,6 +20,7 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} + {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '') }} run: - python @@ -32,6 +33,7 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} + {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '') }} {% if build_variant == 'cpu' %} run_constrained: From 1aace1eea9e7f99aae6113d106b6ad48cddc5bd1 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 5 Aug 2022 07:50:12 -0700 Subject: [PATCH 08/12] Testing --- packaging/pkg_helpers.bash | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index c7133d61e12..3867cd11c9f 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -250,10 +250,6 @@ setup_conda_pytorch_constraint() { export CONDA_PYTORCH_CONSTRAINT="- pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX}" fi - if [[ "$CU_VERSION" == cu116 ]]; then - export CONDA_PYTORCH_BUILD_CONSTRAINT="${CONDA_PYTORCH_BUILD_CONSTRAINT} pytorch-cuda=1.0=cuda11.6" - fi - if [[ "$OSTYPE" == msys && "$CU_VERSION" == cu92 ]]; then export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c defaults -c numba/label/dev" fi From fecd2165ae265ffa559d2f91fb212197d7dcc419 Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 9 Aug 2022 07:21:20 -0700 Subject: [PATCH 09/12] Using new metapackage --- packaging/build_cmake.sh | 2 +- packaging/pkg_helpers.bash | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index 6b83e5d3aca..aec61f2d9d9 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -43,7 +43,7 @@ else fi if [[ $CU_VERSION == "cu116" ]]; then - conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia -c pytorch-nightly cuda=11.6 pytorch-cuda=1.0=cuda11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" + conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia -c pytorch-nightly pytorch-cuda=11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" else conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" fi diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 3867cd11c9f..f3c19434180 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -258,14 +258,12 @@ setup_conda_pytorch_constraint() { # Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT setup_conda_cudatoolkit_constraint() { export CONDA_BUILD_VARIANT="cuda" - export CONDA_PYTORCH_CUDA_CONSTRAINT="" if [[ "$(uname)" == Darwin ]]; then export CONDA_BUILD_VARIANT="cpu" else case "$CU_VERSION" in cu116) - export CONDA_CUDATOOLKIT_CONSTRAINT="- cuda >=11.6,<11.7 # [not osx]" - export CONDA_PYTORCH_CUDA_CONSTRAINT="- pytorch-cuda=1.0=cuda11.6" + export CONDA_CUDATOOLKIT_CONSTRAINT="- pytorch-cuda=11.6 # [not osx]" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.3,<11.4 # [not osx]" From 9775675958e9c383e7474795a36ea3ae4a2fd88e Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 9 Aug 2022 07:25:03 -0700 Subject: [PATCH 10/12] Testing --- .circleci/unittest/linux/scripts/install.sh | 2 +- packaging/torchvision/meta.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index dd2a9d6ccc4..a6e659df4fb 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -26,7 +26,7 @@ else cudatoolkit="" if [[ "$CU_VERSION" == cu116 ]]; then cuda_toolkit_pckg="cuda" - cudatoolkit="-c nvidia cuda=11.6 atalman::pytorch-cuda=1.0=cuda11.6" + cudatoolkit=" -c nvidia -c pytorch-nightly pytorch-cuda=11.6" else cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" fi diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 3df8cd12779..105e28c453e 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -20,7 +20,6 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} - {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '') }} run: - python @@ -33,7 +32,6 @@ requirements: - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT', '') }} - {{ environ.get('CONDA_PYTORCH_CUDA_CONSTRAINT', '') }} {% if build_variant == 'cpu' %} run_constrained: From 567822caa122b2be7c3fece0a1e450dedc03364a Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 9 Aug 2022 07:33:25 -0700 Subject: [PATCH 11/12] Simplifing logic --- .circleci/unittest/linux/scripts/install.sh | 7 ++----- packaging/build_cmake.sh | 6 +----- packaging/pkg_helpers.bash | 3 +-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index a6e659df4fb..aab479b330e 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -22,13 +22,10 @@ else echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION" version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" - cuda_toolkit_pckg="cudatoolkit" - cudatoolkit="" + cudatoolkit="nvidia::cudatoolkit=${version}" + if [[ "$CU_VERSION" == cu116 ]]; then - cuda_toolkit_pckg="cuda" cudatoolkit=" -c nvidia -c pytorch-nightly pytorch-cuda=11.6" - else - cudatoolkit="nvidia::${cuda_toolkit_pckg}=${version}" fi fi diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index aec61f2d9d9..c183d4e80c1 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -42,11 +42,7 @@ else PYTORCH_MUTEX_CONSTRAINT='' fi -if [[ $CU_VERSION == "cu116" ]]; then - conda install -yq \pytorch=$PYTORCH_VERSION -c nvidia -c pytorch-nightly pytorch-cuda=11.6 $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" -else - conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" -fi +conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)")) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index f3c19434180..1962f2d6196 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -292,8 +292,7 @@ setup_conda_cudatoolkit_plain_constraint() { else case "$CU_VERSION" in cu116) - export CONDA_CUDATOOLKIT_CONSTRAINT="cuda=11.6" - export CONDA_PYTORCH_CUDA_CONSTRAINT="pytorch-cuda=1.0=cuda11.6" + export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda=11.6" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=11.3" From 147263497f57b8162843cecd16374f61cfcf3e8f Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 9 Aug 2022 08:01:40 -0700 Subject: [PATCH 12/12] Further simplifying --- .circleci/unittest/linux/scripts/install.sh | 7 +++---- packaging/build_cmake.sh | 1 - packaging/pkg_helpers.bash | 7 ++++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index aab479b330e..c9c85bdd88a 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -23,9 +23,8 @@ else version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" cudatoolkit="nvidia::cudatoolkit=${version}" - - if [[ "$CU_VERSION" == cu116 ]]; then - cudatoolkit=" -c nvidia -c pytorch-nightly pytorch-cuda=11.6" + if [[ "$version" == "11.6" || "$version" == "11.7" ]]; then + cudatoolkit=" pytorch-cuda=${version}" fi fi @@ -38,7 +37,7 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" if [ "${os}" == "MacOSX" ]; then conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" else - conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" + conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" fi printf "* Installing torchvision\n" diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index c183d4e80c1..35dfbc4a697 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -43,7 +43,6 @@ else fi conda install -yq \pytorch=$PYTORCH_VERSION $CONDA_CUDATOOLKIT_CONSTRAINT $PYTORCH_MUTEX_CONSTRAINT $MKL_CONSTRAINT numpy -c nvidia -c "pytorch-${UPLOAD_CHANNEL}" - TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)")) if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 1962f2d6196..ad0f4f94d2f 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -249,7 +249,6 @@ 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 - if [[ "$OSTYPE" == msys && "$CU_VERSION" == cu92 ]]; then export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c defaults -c numba/label/dev" fi @@ -262,6 +261,9 @@ setup_conda_cudatoolkit_constraint() { export CONDA_BUILD_VARIANT="cpu" else case "$CU_VERSION" in + cu117) + export CONDA_CUDATOOLKIT_CONSTRAINT="- pytorch-cuda=11.7 # [not osx]" + ;; cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="- pytorch-cuda=11.6 # [not osx]" ;; @@ -291,6 +293,9 @@ setup_conda_cudatoolkit_plain_constraint() { export CMAKE_USE_CUDA=0 else case "$CU_VERSION" in + cu117) + export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda=11.7" + ;; cu116) export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda=11.6" ;;