Skip to content

[STABLE ABI] Eliminate Device.h #3735

[STABLE ABI] Eliminate Device.h

[STABLE ABI] Eliminate Device.h #3735

name: Unit-tests on MacOS M1 CPU
on:
pull_request:
push:
branches:
- nightly
- main
- release/*
workflow_dispatch:
jobs:
build:
strategy:
matrix:
python-version: ["3.11"]
ffmpeg-version: ["7"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
permissions:
id-token: write
contents: read
with:
runner: macos-m1-stable
repository: pytorch/audio
timeout: 180
script: |
echo '::group::Setup Environment Variables'
# Mark Build Directory Safe
git config --global --add safe.directory /__w/audio/audio
# Set up Environment Variables
export PYTHON_VERSION="${{ matrix.python-version }}"
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export PIP_PROGRESS_BAR=off
export CONDA_QUIET=1
export CU_VERSION=""
export USE_OPENMP="0"
# Set CHANNEL
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export UPLOAD_CHANNEL=test
else
export UPLOAD_CHANNEL=nightly
fi
echo "::group::Create conda environment"
# Mark Build Directory Safe
git config --global --add safe.directory /__w/audio/audio
conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja
conda activate ci_env
conda info
ffmpeg -version
python -m pip install --upgrade pip
echo "::endgroup::"
echo "::group::Install TorchAudio test and PyTorch dependencies"
python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest
echo "::endgroup::"
echo "::group::Install PyTorch and TorchCodec"
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu"
python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")'
python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")'
echo "::endgroup::"
echo "::group::Build and install TorchAudio"
export BUILD_CPP_TEST=1
python -m pip install . -v --no-build-isolation
echo "::endgroup::"
echo "::group::Run TorchAudio tests"
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CUDA=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_HW_ACCEL=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_QUANTIZATION=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_sentencepiece=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_AUDIO_OUT_DEVICE=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CTC_DECODER=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_unidecode=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_inflect=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_pytorch_lightning=true
pytest test/torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa" -x
echo "::endgroup::"