13
13
tests :
14
14
strategy :
15
15
matrix :
16
- # TODO all from 3.9 to 3.13
17
- python_version : ["3.11 "]
16
+ python-version : ["3.11"]
17
+ ffmpeg-version : ["7 "]
18
18
fail-fast : false
19
19
uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
20
20
permissions :
@@ -23,26 +23,64 @@ jobs:
23
23
with :
24
24
runner : linux.12xlarge
25
25
repository : pytorch/audio
26
+ gpu-arch-type : cpu
27
+ gpu-arch-version :
26
28
timeout : 120
27
- script : |
28
- echo '::group::Setup Environment Variables'
29
- # Mark Build Directory Safe
30
- git config --global --add safe.directory /__w/audio/audio
29
+ job-name : linux-cpu
31
30
31
+ script : |
32
+ set -ex
32
33
# Set up Environment Variables
33
- export PYTHON_VERSION="${{ matrix.python_version }}"
34
+ export PYTHON_VERSION="${{ matrix.python-version }}"
35
+ export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
34
36
export PIP_PROGRESS_BAR=off
35
37
export CONDA_QUIET=1
36
- export CUDA_TESTS_ONLY="0"
37
- unset CUDA_VERSION
38
38
39
- # Set CHANNEL
39
+ # Set UPLOAD_CHANNEL
40
40
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
41
41
export UPLOAD_CHANNEL=test
42
42
else
43
43
export UPLOAD_CHANNEL=nightly
44
44
fi
45
45
46
+ echo "::group::Create conda env"
47
+ # Mark Build Directory Safe
48
+ git config --global --add safe.directory /__w/audio/audio
49
+ conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja
50
+ conda activate ci_env
51
+ conda info
52
+ ffmpeg -version
53
+ python -m pip install --upgrade pip
54
+ # We add conda library path as otherwise torchcodec is not
55
+ # able to load ffmpeg shared libraries:
56
+ export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
57
+ echo "::endgroup::"
58
+
59
+ echo "::group::Install TorchAudio test and PyTorch dependencies"
60
+ python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest
61
+ echo "::endgroup::"
62
+
63
+ echo "::group::Install PyTorch and TorchCodec"
64
+ PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu"
65
+ python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
66
+ python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")'
67
+ python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")'
68
+ echo "::endgroup::"
69
+
70
+ echo "::group::Build and install TorchAudio"
71
+ export BUILD_CPP_TEST=1
72
+ python -m pip install . -v --no-build-isolation
73
+ echo "::endgroup::"
74
+
75
+ echo "::group::Run TorchAudio C tests"
76
+ (cd build/temp*/test/cpp && ./wall_collision)
77
+ echo "::endgroup::"
78
+
79
+ echo "::group::Run TorchAudio tests"
80
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CTC_DECODER=true
81
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_unidecode=true
82
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_inflect=true
83
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_pytorch_lightning=true
46
84
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true
47
85
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true
48
86
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true
58
96
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true
59
97
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true
60
98
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true
61
- echo '::endgroup::'
62
-
63
- set -euxo pipefail
64
-
65
- echo '::group::Install PyTorch and Torchaudio'
66
- ./.github/scripts/unittest-linux/install.sh
67
- echo '::endgroup::'
68
-
69
- echo '::group::Run Tests'
70
- ./.github/scripts/unittest-linux/run_test.sh
71
- echo '::endgroup::'
99
+ pytest test/torchaudio_unittest -k "not torchscript and not fairseq and not demucs" -x
100
+ echo "::endgroup::"
0 commit comments