Commit ffeba11a authored by mayp777's avatar mayp777
Browse files

UPDATE

parent 29deb085
#!/usr/bin/env bash
unset PYTORCH_VERSION
# For unittest, nightly PyTorch is used as the following section,
# so no need to set PYTORCH_VERSION.
# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config.
set -ex
root_dir="$(git rev-parse --show-toplevel)"
conda_dir="${root_dir}/conda"
env_dir="${root_dir}/env"
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${root_dir}"
# 0. Activate conda env
eval "$("${conda_dir}/Scripts/conda.exe" 'shell.bash' 'hook')"
conda activate "${env_dir}"
source "$this_dir/set_cuda_envs.sh"
# 1. Install PyTorch
if [ -z "${CUDA_VERSION:-}" ] ; then
cudatoolkit="cpuonly"
version="cpu"
else
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cuda_toolkit_pckg="cudatoolkit"
if [[ "$CU_VERSION" == cu116 || "$CU_VERSION" == cu117 ]]; then
cuda_toolkit_pckg="pytorch-cuda"
fi
cudatoolkit="${cuda_toolkit_pckg}=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia pytorch "${cudatoolkit}" pytest
conda install -y -c conda-forge mkl=2020.4
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
echo torch.cuda.is_available is $torch_cuda
if [ ! -z "${CUDA_VERSION:-}" ] ; then
if [ "$torch_cuda" == "False" ]; then
echo "torch with cuda installed but torch.cuda.is_available() is False"
exit 1
fi
fi
# 2. Install torchaudio
printf "* Installing torchaudio\n"
"$root_dir/packaging/vc_env_helper.bat" python setup.py install
# 3. Install Test tools
printf "* Installing test tools\n"
NUMBA_DEV_CHANNEL=""
SENTENCEPIECE_DEPENDENCY="sentencepiece"
case "$(python --version)" in
*3.9*)
# Numba isn't available for Python 3.9 except on the numba dev channel and building from source fails
# See https://github.com/librosa/librosa/issues/1270#issuecomment-759065048
NUMBA_DEV_CHANNEL="-c numba/label/dev"
;;
*3.10*)
# Don't install sentencepiece, no python 3.10 dependencies available for windows yet
SENTENCEPIECE_DEPENDENCY=""
NUMBA_DEV_CHANNEL="-c numba/label/dev"
;;
esac
# Note: installing librosa via pip fail because it will try to compile numba.
(
set -x
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa>=0.8.0' parameterized 'requests>=2.20'
# Need to disable shell check since this'll fail out if SENTENCEPIECE_DEPENDENCY is empty
# shellcheck disable=SC2086
pip install \
${SENTENCEPIECE_DEPENDENCY} \
Pillow \
SoundFile \
coverage \
expecttest \
inflect \
kaldi-io \
pytest \
pytest-cov \
pytorch-lightning \
'scipy==1.7.3' \
transformers \
unidecode \
'protobuf<4.21.0' \
demucs \
tinytag
)
# Install fairseq
git clone https://github.com/pytorch/fairseq
cd fairseq
git checkout e47a4c8
pip install .
start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda%
#!/usr/bin/env bash
set -ex
eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$this_dir/set_cuda_envs.sh"
python -m torch.utils.collect_env
env | grep TORCHAUDIO || true
cd test
pytest --cov=torchaudio --junitxml=../test-results/junit.xml -v --durations 20 torchaudio_unittest
coverage html
#!/usr/bin/env bash
set -ex
echo CU_VERSION is "${CU_VERSION}"
echo CUDA_VERSION is "${CUDA_VERSION}"
# 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
version="$CUDA_VERSION"
else
if [[ ${#CU_VERSION} -eq 5 ]]; then
version="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi
fi
# Don't use if [[ "$version" == "cpu" ]]; then exit 0 fi.
# It would exit the shell. One result is cpu tests would not run if the shell exit.
# Unless there's an error, Don't exit.
if [[ "$version" != "cpu" ]]; then
# set cuda envs
export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/libnvvp:$PATH"
export CUDA_PATH_V${version/./_}="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}"
export CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}"
if [ ! -d "$CUDA_PATH" ]
then
echo "$CUDA_PATH" does not exist
exit 1
fi
# check cuda driver version
for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do
if [[ -x "$path" ]]; then
"$path" || echo "true";
break
fi
done
which nvcc
nvcc --version
env | grep CUDA
fi
This diff is collapsed.
This diff is collapsed.
...@@ -69,6 +69,7 @@ instance/ ...@@ -69,6 +69,7 @@ instance/
# Sphinx documentation # Sphinx documentation
docs/_build/ docs/_build/
docs/src/ docs/src/
docs/source/cpp
docs/source/tutorials docs/source/tutorials
docs/source/gen_images docs/source/gen_images
docs/source/gen_modules docs/source/gen_modules
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment