-
Notifications
You must be signed in to change notification settings - Fork 657
119 lines (107 loc) · 3.81 KB
/
unittest-linux-gpu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Unit-tests on Linux GPU
on:
pull_request:
push:
branches:
- nightly
- main
- release/*
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10"]
cuda_arch_version: ["11.8"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
runner: linux.g5.4xlarge.nvidia.gpu
repository: pytorch/audio
gpu-arch-type: cuda
gpu-arch-version: ${{ matrix.cuda_arch_version }}
timeout: 120
script: |
set -ex
# Set up Environment Variables
export PYTHON_VERSION="${{ matrix.python_version }}"
export CU_VERSION="${{ matrix.cuda_arch_version }}"
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}"
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_CUDA_SMALL_MEMORY=true
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=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
# Set CHANNEL
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export CHANNEL=test
else
export CHANNEL=nightly
fi
echo "::group::Create conda env"
# Mark Build Directory Safe
git config --global --add safe.directory /__w/audio/audio
conda create --quiet -y --prefix ci_env python="${PYTHON_VERSION}"
conda activate ./ci_env
echo "::endgroup::"
echo "::group::Install PyTorch"
conda install \
--yes \
--quiet \
-c "pytorch-${CHANNEL}" \
-c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${CU_VERSION}*"] \
"${CUDATOOLKIT}"
echo "::endgroup::"
echo "::group::Install TorchAudio"
conda install --quiet --yes 'cmake>=3.18.0' ninja
pip3 install --progress-bar off -v -e . --no-use-pep517
echo "::endgroup::"
echo "::group::Build FFmpeg"
.github/scripts/ffmpeg/build_gpu.sh
echo "::endgroup::"
echo "::group::Install other Dependencies"
conda install \
--quiet --yes \
-c conda-forge \
-c numba/label/dev \
sox libvorbis 'librosa==0.10.0' parameterized 'requests>=2.20'
pip3 install --progress-bar off \
kaldi-io \
SoundFile \
coverage \
pytest \
pytest-cov \
'scipy==1.7.3' \
transformers \
expecttest \
unidecode \
inflect \
Pillow \
sentencepiece \
pytorch-lightning \
'protobuf<4.21.0' \
demucs \
tinytag \
flashlight-text \
git+https://github.com/kpu/kenlm/ \
git+https://github.com/pytorch/fairseq.git@e47a4c8
echo "::endgroup::"
echo "::group::Run tests"
export PATH="${PWD}/third_party/install/bin/:${PATH}"
declare -a args=(
'-v'
'--cov=torchaudio'
"--junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml"
'--durations' '100'
'-k' 'cuda or gpu'
)
cd test
python3 -m torch.utils.collect_env
env | grep TORCHAUDIO || true
pytest "${args[@]}" torchaudio_unittest
coverage html