Skip to content
Closed
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
304 changes: 276 additions & 28 deletions .circleci/config.yml

Large diffs are not rendered by default.

71 changes: 43 additions & 28 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,37 @@ commands:
- run:
name: adding UPLOAD_CHANNEL to BASH_ENV
command: |
our_upload_channel=nightly
# On tags upload to test instead
if [[ -n "${CIRCLE_TAG}" ]]; then
our_upload_channel=test
fi
echo "export UPLOAD_CHANNEL=${our_upload_channel}" >> ${BASH_ENV}
# Hardcoded for release branch
echo "export UPLOAD_CHANNEL=test" >> ${BASH_ENV}
install_build_tools_macos:
description: "installs tools required to build torchaudio"
steps:
- run:
name: Install cmake and pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake 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:
# Edit these defaults to do a release
build_version:
description: "version number of release binary; by default, build a nightly"
type: string
default: ""
default: "0.7.2"
pytorch_version:
description: "PyTorch version to build against; by default, use a nightly"
type: string
default: ""
default: "1.7.1"
# Don't edit these
python_version:
description: "Python version to build against (e.g., 3.8)"
Expand Down Expand Up @@ -117,7 +123,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 +144,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 +162,7 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- run:
Expand All @@ -180,6 +188,7 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- run:
Expand All @@ -202,6 +211,7 @@ jobs:
name: windows-cpu
steps:
- checkout
- load_conda_channel_flags
- run:
name: build
command: |
Expand All @@ -221,6 +231,7 @@ jobs:
name: windows-cpu
steps:
- checkout
- load_conda_channel_flags
- run:
name: build
command: |
Expand Down Expand Up @@ -278,6 +289,7 @@ jobs:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -296,12 +308,14 @@ jobs:
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
set -x
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
pip install $(ls ~/workspace/torchaudio*.whl) -f https://download.pytorch.org/whl/nightly/torch_nightly.html -f https://download.pytorch.org/whl/test/torch_test.html
pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/torch_${UPLOAD_CHANNEL}.html"
- run:
name: smoke test
command: |
Expand All @@ -315,6 +329,8 @@ jobs:
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -323,7 +339,7 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
conda install -v -y -c pytorch-test -c pytorch-nightly pytorch
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch
conda install -v -y $(ls ~/workspace/torchaudio*.tar.bz2)
- run:
name: smoke test
Expand All @@ -339,6 +355,8 @@ jobs:
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
Expand All @@ -347,7 +365,7 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
pip install $(ls ~/workspace/torchaudio*.whl) -f https://download.pytorch.org/whl/nightly/torch_nightly.html -f https://download.pytorch.org/whl/test/torch_test.html
pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/torch_${UPLOAD_CHANNEL}.html"
- run:
name: smoke test
command: |
Expand Down Expand Up @@ -391,6 +409,8 @@ jobs:
- checkout
- attach_workspace:
at: third_party
- designate_upload_channel
- load_conda_channel_flags
- generate_cache_key
- restore_cache:
{% raw %}
Expand Down Expand Up @@ -433,6 +453,8 @@ jobs:
- checkout
- attach_workspace:
at: third_party
- designate_upload_channel
- load_conda_channel_flags
- generate_cache_key
- restore_cache:
{% raw %}
Expand Down Expand Up @@ -470,6 +492,8 @@ jobs:
name: windows-cpu
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- generate_cache_key
- restore_cache:
{% raw %}
Expand Down Expand Up @@ -506,6 +530,8 @@ jobs:
CUDA_VERSION: "10.1"
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- generate_cache_key
- restore_cache:
{% raw %}
Expand Down Expand Up @@ -542,27 +568,13 @@ jobs:
steps:
- checkout
- install_build_tools_macos
- load_conda_channel_flags
- attach_workspace:
at: third_party
- generate_cache_key
- restore_cache:
{% raw %}
keys:
- env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum "third_party/CMakeLists.txt" }}-{{ checksum ".cachekey" }}
{% endraw %}
- designate_upload_channel
- run:
name: Setup
command: .circleci/unittest/linux/scripts/setup_env.sh
- save_cache:
{% raw %}
key: env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum "third_party/CMakeLists.txt" }}-{{ checksum ".cachekey" }}
{% endraw %}
paths:
- conda
- env
- third_party/build
- third_party/install
- third_party/src
- run:
name: Install torchaudio
command: .circleci/unittest/linux/scripts/install.sh
Expand All @@ -582,6 +594,8 @@ jobs:
resource_class: medium
steps:
- checkout
- designate_upload_channel
- load_conda_channel_flags
- generate_cache_key
- restore_cache:
{% raw %}
Expand Down Expand Up @@ -612,6 +626,7 @@ jobs:
steps:
- checkout
- generate_cache_key
- load_conda_channel_flags
- restore_cache:
{% raw %}
keys:
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"]


def build_workflows(prefix='', upload=False, filter_branch=None, indentation=6):
Expand Down
17 changes: 0 additions & 17 deletions .circleci/unittest/linux/scripts/environment.yml

This file was deleted.

25 changes: 23 additions & 2 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,34 @@ eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env

if [ -z "${CUDA_VERSION:-}" ] ; then
cudatoolkit="cpuonly"
case "$(uname -s)" in
Darwin*) cudatoolkit="";;
*) cudatoolkit="cpuonly"
esac
else
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="cudatoolkit=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c pytorch-nightly pytorch "${cudatoolkit}"
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" pytorch ${cudatoolkit}

printf "* Installing dependencies for test\n"
CONDA_PKGS="librosa>=0.8.0"
# TODO: Remove this after packages become available
# Currently there's no librosa package available for Python 3.9, so lets just skip the dependency for now
if [[ $(python --version) = *3.9* ]]; then
CONDA_PKGS="pysoundfile"
fi
conda install -y -c conda-forge pytest pytest-cov codecov scipy parameterized ${CONDA_PKGS}
pip install kaldi-io

printf "* Building codecs\n"
mkdir -p third_party/build
(
cd third_party/build
cmake ..
cmake --build .
)

printf "* Installing torchaudio\n"
BUILD_SOX=1 python setup.py install
2 changes: 2 additions & 0 deletions .circleci/unittest/linux/scripts/run_style_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -u
eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env

pip install clang-format flake8

# We want to run all the style checks even if one of them fail.

exit_status=0
Expand Down
17 changes: 0 additions & 17 deletions .circleci/unittest/linux/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

set -e

this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
root_dir="$(git rev-parse --show-toplevel)"
conda_dir="${root_dir}/conda"
env_dir="${root_dir}/env"
Expand All @@ -32,19 +31,3 @@ if [ ! -d "${env_dir}" ]; then
printf "* Creating a test environment\n"
conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION"
fi
conda activate "${env_dir}"

# 3. Install Conda dependencies
printf "* Installing dependencies (except PyTorch)\n"
conda env update --file "${this_dir}/environment.yml" --prune
if [ "${os}" == Linux ] ; then
pip install clang-format
fi

# 4. Buld codecs
mkdir -p third_party/build
(
cd third_party/build
cmake ..
cmake --build .
)
3 changes: 1 addition & 2 deletions .circleci/unittest/windows/scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ dependencies:
- pytest
- pytest-cov
- codecov
- scipy >= 1.4.1
- pip
- pip:
- scipy == 1.4.1
- kaldi-io
- PySoundFile
- librosa >= 0.8.0
- future
- parameterized
- dataclasses
8 changes: 7 additions & 1 deletion .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ else
cudatoolkit="cudatoolkit=${version}"
fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c pytorch-nightly pytorch "${cudatoolkit}"
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" pytorch "${cudatoolkit}"

# TODO: Remove this after packages become available
# Currently there's no librosa package available for Python 3.9, so lets just skip the dependency for now
if [[ $(python --version) != *3.9* ]]; then
pip install 'librosa>=0.8.0'
fi

printf "* Installing torchaudio\n"
python setup.py install
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx
sphinx==2.4.4
-e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
sphinxcontrib.katex
matplotlib
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
#
# The short X.Y version.
# TODO: change to [:2] at v1.0
version = 'master '
version = '0.7.1'
# The full version, including alpha/beta/rc tags.
# TODO: verify this works as expected
release = 'master'
release = '0.7.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ torchaudio.datasets
====================

All datasets are subclasses of :class:`torch.utils.data.Dataset`
i.e, they have ``__getitem__`` and ``__len__`` methods implemented.
and have ``__getitem__`` and ``__len__`` methods implemented.
Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`
which can load multiple samples parallelly using ``torch.multiprocessing`` workers.
For example: ::
Expand Down
Loading