Skip to content

Commit

Permalink
Remove temp channel for python 3.11, simplify logic around cuda (#3250)…
Browse files Browse the repository at this point in the history
… (#3274)

Summary:
Remove temp channel for python 3.11, simplify logic around cuda

Pull Request resolved: #3250

Reviewed By: mthrok

Differential Revision: D44788219

Pulled By: atalman

fbshipit-source-id: 421ff9e0bf1818b41e395708cc4589d4a9c865bd
  • Loading branch information
atalman authored Apr 19, 2023
1 parent b114e52 commit f5a3a3d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 56 deletions.
25 changes: 3 additions & 22 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 3 additions & 22 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,7 @@ jobs:
command: |
set -x
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
if [[ "$CU_VERSION" == cu116 || "$CU_VERSION" == cu117 || "$CU_VERSION" == cu118 ]]; then
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
else
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4}
fi
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio
- checkout
- run:
Expand Down Expand Up @@ -532,9 +528,6 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
if [[ "${PYTHON_VERSION}" == "3.11" ]]; then
export CONDA_CHANNEL_FLAGS=" -c malfet"
fi
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} pytorch cpuonly
conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2)
- checkout
Expand Down Expand Up @@ -574,16 +567,8 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
# Include numpy and cudatoolkit in the install conda-forge chanell is used for cudatoolkit
if [[ "${PYTHON_VERSION}" == "3.11" ]]; then
export CONDA_CHANNEL_FLAGS=" -c malfet"
fi
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}

if [[ "$CU_VERSION" == cu116 || "$CU_VERSION" == cu117 || "$CU_VERSION" == cu118 ]]; then
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
else
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4}
fi
# Install from torchaudio file
conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2)
- run:
Expand Down Expand Up @@ -852,11 +837,7 @@ jobs:
command: |
set -x
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
if [[ "$CU_VERSION" == cu116 || "$CU_VERSION" == cu117 || "$CU_VERSION" == cu118 ]]; then
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
else
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4}
fi
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio
# gxx_linux-64 is for installing pesq library that depends on cython
conda install -y pandoc 'ffmpeg<5' gxx_linux-64 git make
Expand Down
8 changes: 1 addition & 7 deletions .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ if [ -z "${CUDA_VERSION:-}" ] ; then
version="cpu"
else
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"

cuda_toolkit_pckg="cudatoolkit"
if [[ "$CU_VERSION" == cu116 || "$CU_VERSION" == cu117 || "$CU_VERSION" == cu118 ]]; then
cuda_toolkit_pckg="pytorch-cuda"
fi

cudatoolkit="${cuda_toolkit_pckg}=${version}"
cudatoolkit="pytorch-cuda=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia pytorch "${cudatoolkit}" pytest
Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/windows/scripts/set_cuda_envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex
echo CU_VERSION is "${CU_VERSION}"
echo CUDA_VERSION is "${CUDA_VERSION}"

# Currenly, CU_VERSION and CUDA_VERSION are not consistent.
# Currenly, CU_VERSION and CUDA_VERSION are not consistent.
# to understand this code, please checck out https://github.com/pytorch/vision/issues/4443
version="cpu"
if [[ ! -z "${CUDA_VERSION}" ]] ; then
Expand Down
4 changes: 0 additions & 4 deletions packaging/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ if [[ ${OSTYPE} =~ darwin* ]] && [[ ${PYTHON_VERSION} = "3.10" ]]; then
CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c conda-forge"
fi

if [[ "$PYTHON_VERSION" == "3.11" ]]; then
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c malfet"
fi

conda build -c defaults -c $CUDATOOLKIT_CHANNEL ${CONDA_CHANNEL_FLAGS:-} --no-anaconda-upload --no-test --python "$PYTHON_VERSION" packaging/torchaudio

0 comments on commit f5a3a3d

Please sign in to comment.