Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 247 additions & 2 deletions .circleci/config.yml

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ commands:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config wget
# Disable brew auto update which is very slow
load_conda_channel_flags:
description: "Determines whether we need extra conda channels"
steps:
- run:
name: Adding CONDA_CHANNEL_FLAGS to BASH_ENV
command: |
CONDA_CHANNEL_FLAGS=""
if [[ "${PYTHON_VERSION}" = *3.9* ]]; then
echo "export CONDA_CHANNEL_FLAGS=-c=conda-forge" >> ${BASH_ENV}
fi

binary_common: &binary_common
parameters:
Expand Down Expand Up @@ -117,7 +127,7 @@ jobs:
binary_linux_wheel:
<<: *binary_common
docker:
- image: "pytorch/manylinux-cuda100"
- image: "pytorch/manylinux-cuda102"
resource_class: 2xlarge+
steps:
- checkout
Expand All @@ -138,6 +148,7 @@ jobs:
resource_class: 2xlarge+
steps:
- checkout
- load_conda_channel_flags
- attach_workspace:
at: third_party
- run: packaging/build_conda.sh
Expand All @@ -155,6 +166,7 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- run:
Expand All @@ -180,6 +192,7 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- run:
Expand All @@ -202,6 +215,7 @@ jobs:
name: windows-cpu
steps:
- checkout
- load_conda_channel_flags
- run:
name: build
command: |
Expand All @@ -221,6 +235,7 @@ jobs:
name: windows-cpu
steps:
- checkout
- load_conda_channel_flags
- run:
name: build
command: |
Expand Down Expand Up @@ -278,6 +293,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -297,6 +313,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -317,6 +334,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -342,6 +360,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand Down Expand Up @@ -395,6 +414,7 @@ jobs:
- attach_workspace:
at: third_party
- designate_upload_channel
- load_conda_channel_flags
- run:
name: Setup
command: .circleci/unittest/linux/scripts/setup_env.sh
Expand Down Expand Up @@ -423,6 +443,7 @@ jobs:
- attach_workspace:
at: third_party
- designate_upload_channel
- load_conda_channel_flags
- run:
name: Pull Docker image
command: docker pull --quiet "${image_name}"
Expand All @@ -431,7 +452,7 @@ jobs:
command: docker run -t --gpus all -e PYTHON_VERSION -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/setup_env.sh
- run:
name: Install torchaudio
command: docker run -t --gpus all -e UPLOAD_CHANNEL -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh
command: docker run -t --gpus all -e UPLOAD_CHANNEL -e CONDA_CHANNEL_FLAGS -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh
- run:
name: Run tests
command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh
Expand All @@ -448,6 +469,7 @@ jobs:
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- run:
name: Setup
command: .circleci/unittest/windows/scripts/setup_env.sh
Expand All @@ -473,6 +495,7 @@ jobs:
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- run:
name: Setup
command: .circleci/unittest/windows/scripts/setup_env.sh
Expand All @@ -496,6 +519,7 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- designate_upload_channel
Expand All @@ -522,6 +546,7 @@ jobs:
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- run:
name: Setup
command: .circleci/unittest/linux/scripts/setup_env.sh
Expand All @@ -538,6 +563,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- checkout
- load_conda_channel_flags
- run:
name: Install pytorch-audio
command: .circleci/build_docs/install_wheels.sh
Expand Down
2 changes: 1 addition & 1 deletion .circleci/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os.path


PYTHON_VERSIONS = ["3.6", "3.7", "3.8"]
PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

DOC_VERSION = ('linux', '3.8')

Expand Down
24 changes: 16 additions & 8 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ else
cudatoolkit="cudatoolkit=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" pytorch ${cudatoolkit}
(
set -x
conda install ${CONDA_CHANNEL_FLAGS:-} -y defaults::numpy
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}::pytorch" ${cudatoolkit}
)

# 2. Install torchaudio
printf "* Installing torchaudio\n"
Expand All @@ -43,11 +47,15 @@ BUILD_TRANSDUCER=1 BUILD_SOX=1 python setup.py install

# 3. Install Test tools
printf "* Installing test tools\n"
if [ "${os}" == Linux ] ; then
conda install -y -c conda-forge codecov pytest pytest-cov
pip install kaldi-io 'librosa>=0.8.0' parameterized SoundFile scipy 'requests>=2.20'
else
# Note: installing librosa via pip fail because it will try to compile numba.
conda install -y -c conda-forge codecov pytest pytest-cov 'librosa>=0.8.0' parameterized scipy
pip install kaldi-io SoundFile 'requests>=2.20'
NUMBA_DEV_CHANNEL=""
if [[ "$(python --version)" = *3.9* ]]; then
# 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"
fi
# 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'
pip install kaldi-io SoundFile codecov pytest pytest-cov scipy
)
16 changes: 16 additions & 0 deletions .circleci/unittest/windows/scripts/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
channels:
- conda-forge
- defaults
dependencies:
- flake8
- pytest
- pytest-cov
- codecov
- scipy >= 1.4.1
- pip
- pip:
- kaldi-io
- PySoundFile
- future
- parameterized
- dataclasses
16 changes: 13 additions & 3 deletions .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@ else
cudatoolkit="cudatoolkit=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" pytorch "${cudatoolkit}"
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}::pytorch" ${cudatoolkit}

# 2. Install torchaudio
printf "* Installing torchaudio\n"
python setup.py install

# 3. Install Test tools
printf "* Installing test tools\n"
conda install -y -c conda-forge codecov pytest pytest-cov
pip install kaldi-io 'librosa>=0.8.0' parameterized PySoundFile scipy
NUMBA_DEV_CHANNEL=""
if [[ "$(python --version)" = *3.9* ]]; then
# 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"
fi
# 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'
pip install kaldi-io SoundFile codecov pytest pytest-cov scipy
)
6 changes: 6 additions & 0 deletions .circleci/unittest/windows/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ if [ ! -d "${env_dir}" ]; then
conda create --prefix "${env_dir}" -y python="${PYTHON_VERSION}"
fi
conda activate "${env_dir}"
NUMPY_PIN="1.11"
if [[ "${PYTHON_VERSION}" = "3.9" ]]; then
NUMPY_PIN="1.20"
fi
printf "* Installing numpy>=%s\n" "${NUMPY_PIN}\n"
conda install -y -c conda-forge numpy>="${NUMPY_PIN}"
10 changes: 8 additions & 2 deletions packaging/pkg_helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ setup_wheel_python() {
3.6) python_abi=cp36-cp36m ;;
3.7) python_abi=cp37-cp37m ;;
3.8) python_abi=cp38-cp38 ;;
3.9) python_abi=cp39-cp39 ;;
*)
echo "Unrecognized PYTHON_VERSION=$PYTHON_VERSION"
exit 1
Expand Down Expand Up @@ -176,11 +177,16 @@ setup_pip_pytorch_version() {
#
# You MUST have populated PYTORCH_VERSION_SUFFIX before hand.
setup_conda_pytorch_constraint() {
CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS}"
if [[ -z "$PYTORCH_VERSION" ]]; then
export CONDA_CHANNEL_FLAGS="-c pytorch-nightly"
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-nightly"
export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | python -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")"
else
export CONDA_CHANNEL_FLAGS="-c pytorch -c pytorch-${UPLOAD_CHANNEL}"
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-test -c pytorch-nightly"
fi
# Some dependencies for Python 3.9 are only on conda-forge
if [[ "${PYTHON_VERSION}" = "3.9" ]]; then
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c conda-forge"
fi
if [[ "$CU_VERSION" == cpu ]]; then
export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==$PYTORCH_VERSION${PYTORCH_VERSION_SUFFIX}"
Expand Down
2 changes: 2 additions & 0 deletions packaging/torchaudio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ requirements:
- cpuonly
- cmake
- ninja
- defaults::numpy >=1.11
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }}

run:
- python
- defaults::numpy >=1.11
{{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}

build:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def run(self):
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
Expand Down