Skip to content

Commit 69c7ecc

Browse files
committed
Merge branch 'main' into no_lfilter_generic_loop
2 parents a86774c + 3f90600 commit 69c7ecc

File tree

948 files changed

+937
-25735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

948 files changed

+937
-25735
lines changed

.github/scripts/unittest-linux/install.sh

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,7 @@ esac
2424
conda create -n ci -y python="${PYTHON_VERSION}"
2525
conda activate ci
2626

27-
# 1. Install PyTorch
28-
# if [ -z "${CUDA_VERSION:-}" ] ; then
29-
# if [ "${os}" == MacOSX ] ; then
30-
# cudatoolkit=''
31-
# else
32-
# cudatoolkit="cpuonly"
33-
# fi
34-
# version="cpu"
35-
# else
36-
# version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
37-
# export CUDATOOLKIT_CHANNEL="nvidia"
38-
# cudatoolkit="pytorch-cuda=${version}"
39-
# fi
40-
41-
# printf "Installing PyTorch with %s\n" "${cudatoolkit}"
42-
# (
43-
# if [ "${os}" == MacOSX ] ; then
44-
# # TODO: this can be removed as soon as linking issue could be resolved
45-
# # see https://github.com/pytorch/pytorch/issues/62424 from details
46-
# MKL_CONSTRAINT='mkl==2021.2.0'
47-
# pytorch_build=pytorch
48-
# else
49-
# MKL_CONSTRAINT=''
50-
# pytorch_build="pytorch[build="*${version}*"]"
51-
# fi
52-
# set -x
53-
54-
# if [[ -z "$cudatoolkit" ]]; then
55-
# conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" $MKL_CONSTRAINT "pytorch-${UPLOAD_CHANNEL}::${pytorch_build}"
56-
# else
57-
# conda install pytorch ${cudatoolkit} ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia $MKL_CONSTRAINT
58-
# fi
59-
# )
60-
61-
export GPU_ARCH_TYPE="cpu" # TODO change this
27+
export GPU_ARCH_TYPE="cpu"
6228

6329
case $GPU_ARCH_TYPE in
6430
cpu)
@@ -74,7 +40,7 @@ case $GPU_ARCH_TYPE in
7440
;;
7541
esac
7642
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${GPU_ARCH_ID}"
77-
pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
43+
pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
7844

7945

8046
# 2. Install torchaudio
@@ -88,24 +54,5 @@ pip install . -v --no-build-isolation
8854
printf "* Installing test tools\n"
8955
# On this CI, for whatever reason, we're only able to install ffmpeg 4.
9056
conda install -y "ffmpeg<5"
91-
python -c "import torch; import torchaudio; import torchcodec; print(torch.__version__, torchaudio.__version__, torchcodec.__version__)"
92-
93-
NUMBA_DEV_CHANNEL=""
94-
if [[ "$(python --version)" = *3.9* || "$(python --version)" = *3.10* ]]; then
95-
# Numba isn't available for Python 3.9 and 3.10 except on the numba dev channel and building from source fails
96-
# See https://github.com/librosa/librosa/issues/1270#issuecomment-759065048
97-
NUMBA_DEV_CHANNEL="-c numba/label/dev"
98-
fi
99-
(
100-
set -x
101-
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} sox libvorbis parameterized 'requests>=2.20'
102-
pip install kaldi-io SoundFile librosa coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag pyroomacoustics flashlight-text git+https://github.com/kpu/kenlm
10357

104-
# TODO: might be better to fix the single call to `pip install` above
105-
pip install "pillow<10.0" "scipy<1.10" "numpy<2.0"
106-
)
107-
# Install fairseq
108-
git clone https://github.com/pytorch/fairseq
109-
cd fairseq
110-
git checkout e47a4c8
111-
pip install .
58+
pip3 install parameterized requests coverage pytest pytest-cov scipy numpy expecttest

.github/scripts/unittest-linux/run_test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ fi
2929
)
3030

3131
(
32+
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CTC_DECODER=true
33+
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_unidecode=true
34+
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_inflect=true
35+
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_pytorch_lightning=true
3236
cd test
33-
pytest torchaudio_unittest -k "not backend and not /io/ and not prototype and not sox and not ffmpeg and not fairseq and not hdemucs and not (torchscript and rnnt) and not torchscript_consistency"
37+
pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs ${PYTEST_K_EXTRA}"
3438
)

.github/scripts/unittest-windows/environment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ dependencies:
88
- scipy >= 1.4.1
99
- pip
1010
- pip:
11-
- kaldi-io
12-
- PySoundFile
1311
- future
1412
- parameterized
1513
- dataclasses

.github/scripts/unittest-windows/install.sh

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ conda activate "${env_dir}"
2020

2121
source "$this_dir/set_cuda_envs.sh"
2222

23+
printf "* Installing torch import-time dependencies\n"
24+
pip install numpy
25+
2326
# 1. Install PyTorch
2427
if [ -z "${CUDA_VERSION:-}" ] ; then
25-
cudatoolkit="cpuonly"
26-
version="cpu"
28+
wheel="cpu"
2729
else
28-
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
29-
cudatoolkit="pytorch-cuda=${version}"
30+
wheel="cu$(python -c "print(''.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
3031
fi
31-
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
32-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia pytorch "${cudatoolkit}" pytest pybind11
32+
printf "Installing PyTorch\n"
33+
pip install --pre torch --index-url https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${wheel}
3334

3435
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
3536
echo torch.cuda.is_available is $torch_cuda
@@ -42,31 +43,17 @@ if [ ! -z "${CUDA_VERSION:-}" ] ; then
4243
fi
4344

4445
# 2. Install torchaudio
45-
printf "* Installing fsspec\n"
46+
printf "* Installing fsspec\n" # TODO: is this required for torchaudio??
4647
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org fsspec
4748

4849
printf "* Installing torchaudio\n"
4950
"$root_dir/packaging/vc_env_helper.bat" pip install . -v --no-build-isolation
5051

5152
# 3. Install Test tools
5253
printf "* Installing test tools\n"
53-
NUMBA_DEV_CHANNEL=""
5454
SENTENCEPIECE_DEPENDENCY="sentencepiece"
55-
case "$(python --version)" in
56-
*3.9*)
57-
# Numba isn't available for Python 3.9 except on the numba dev channel and building from source fails
58-
# See https://github.com/librosa/librosa/issues/1270#issuecomment-759065048
59-
NUMBA_DEV_CHANNEL="-c numba/label/dev"
60-
;;
61-
*3.10*)
62-
# Don't install sentencepiece, no python 3.10 dependencies available for windows yet
63-
SENTENCEPIECE_DEPENDENCY=""
64-
NUMBA_DEV_CHANNEL="-c numba/label/dev"
65-
;;
66-
esac
67-
# Note: installing librosa via pip fail because it will try to compile numba.
6855
(
69-
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa==0.10.0' parameterized 'requests>=2.20'
56+
conda install -y -c conda-forge parameterized 'requests>=2.20'
7057
# Need to disable shell check since this'll fail out if SENTENCEPIECE_DEPENDENCY is empty
7158
# shellcheck disable=SC2086
7259
pip install \
@@ -76,21 +63,7 @@ esac
7663
coverage \
7764
expecttest \
7865
inflect \
79-
kaldi-io \
8066
pytest \
8167
pytest-cov \
82-
pytorch-lightning \
83-
'scipy==1.7.3' \
84-
unidecode \
85-
'protobuf<4.21.0' \
86-
demucs \
87-
tinytag \
88-
pyroomacoustics \
89-
flashlight-text \
90-
git+https://github.com/kpu/kenlm/
68+
scipy
9169
)
92-
# Install fairseq
93-
git clone https://github.com/pytorch/fairseq
94-
cd fairseq
95-
git checkout e47a4c8
96-
pip install .

.github/scripts/unittest-windows/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ python -m torch.utils.collect_env
1212
env | grep TORCHAUDIO || true
1313

1414
cd test
15-
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest
15+
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa"
1616
coverage html

.github/scripts/unittest-windows/setup_env.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ if [ ! -d "${conda_dir}" ]; then
1919
printf "* Installing conda\n"
2020
export tmp_conda="$(echo $conda_dir | tr '/' '\\')"
2121
export miniconda_exe="$(echo $root_dir | tr '/' '\\')\\miniconda.exe"
22-
curl --silent --output miniconda.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -O
22+
# not using miniconda because its installation will be incomplete
23+
# despite using `start /wait` in the install batch file
24+
curl -L --silent --output miniconda.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe -O
2325
"$this_dir/install_conda.bat"
2426
unset tmp_conda
2527
unset miniconda_exe
@@ -34,5 +36,4 @@ fi
3436
conda activate "${env_dir}"
3537

3638
# 3. Install minimal build tools
37-
pip --quiet install cmake ninja
38-
conda install --quiet -y 'ffmpeg>=4.1'
39+
conda install -y -c conda-forge cmake ninja

.github/workflows/build_docs.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,35 +59,25 @@ jobs:
5959
6060
echo "::endgroup::"
6161
echo "::group::Install PyTorch"
62-
# conda install \
63-
# --yes \
64-
# --quiet \
65-
# -c "pytorch-${CHANNEL}" \
66-
# -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${CU_VERSION}*"] \
67-
# "${CUDATOOLKIT}"
6862
6963
GPU_ARCH_ID=cu126 # This is hard-coded and must be consistent with gpu-arch-version.
7064
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/${GPU_ARCH_ID}"
71-
pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
65+
pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
7266
7367
echo "::endgroup::"
7468
echo "::group::Install TorchAudio"
7569
conda install --quiet --yes cmake>=3.18.0 ninja
7670
pip3 install --progress-bar off -v -e . --no-use-pep517
7771
72+
# TODO: Need to rely on torchcodec instead of building ffmpeg from source.
7873
echo "::endgroup::"
7974
echo "::group::Build FFmpeg"
8075
.github/scripts/ffmpeg/build_gpu.sh
8176
8277
echo "::endgroup::"
8378
echo "::group::Install other dependencies"
84-
conda install \
85-
--quiet --yes \
86-
-c conda-forge \
87-
sox libvorbis pandoc doxygen pysoundfile
88-
pip install --progress-bar off \
89-
git+https://github.com/kpu/kenlm/ flashlight-text \
90-
-r docs/requirements.txt -r docs/requirements-tutorials.txt
79+
80+
pip install --progress-bar off -r docs/requirements.txt -r docs/requirements-tutorials.txt
9181
9282
echo "::endgroup::"
9383
echo "::group::Build documentation"

.github/workflows/unittest-linux-cpu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
3232
# Set up Environment Variables
3333
export PYTHON_VERSION="${{ matrix.python_version }}"
34+
export PIP_PROGRESS_BAR=off
35+
export CONDA_QUIET=1
3436
export CUDA_TESTS_ONLY="0"
3537
unset CUDA_VERSION
3638

.github/workflows/unittest-linux-gpu.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ jobs:
3232
set -ex
3333
# Set up Environment Variables
3434
export PYTHON_VERSION="${{ matrix.python_version }}"
35+
export PIP_PROGRESS_BAR=off
36+
export CONDA_QUIET=1
3537
export CU_VERSION="${{ matrix.cuda_arch_version }}"
3638
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}"
37-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true
38-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true
39-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true
40-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true
41-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true
4239
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_CUDA_SMALL_MEMORY=true
4340
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true
4441
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true
4542
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true
4643
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true
4744
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true
45+
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_demucs=true
4846
# Avoid reproducibility errors with CUBLAS: https://docs.nvidia.com/cuda/cublas/index.html#results-reproducibility
4947
export CUBLAS_WORKSPACE_CONFIG=:4096:8
5048
@@ -78,35 +76,8 @@ jobs:
7876
7977
echo "::endgroup::"
8078
echo "::group::Install other Dependencies"
81-
# conda install \
82-
# --quiet --yes \
83-
# -c conda-forge \
84-
# -c numba/label/dev \
85-
# sox libvorbis 'librosa==0.10.0' parameterized 'requests>=2.20'
86-
# pip3 install --progress-bar off \
87-
# kaldi-io \
88-
# SoundFile \
89-
# coverage \
90-
# pytest \
91-
# pytest-cov \
92-
# scipy \
93-
# transformers \
94-
# expecttest \
95-
# unidecode \
96-
# inflect \
97-
# Pillow \
98-
# sentencepiece \
99-
# pytorch-lightning \
100-
# 'protobuf<4.21.0' \
101-
# demucs \
102-
# tinytag \
103-
# flashlight-text \
104-
# git+https://github.com/kpu/kenlm/ \
105-
# git+https://github.com/pytorch/fairseq.git@e47a4c8
10679
107-
pip3 install parameterized requests
108-
pip3 install kaldi-io SoundFile librosa coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag
109-
pip3 install "pillow<10.0" "scipy<1.10" "numpy<2.0"
80+
pip3 install parameterized requests coverage pytest pytest-cov scipy numpy expecttest
11081
11182
echo "::endgroup::"
11283
echo "::group::Run tests"

0 commit comments

Comments
 (0)