-
Notifications
You must be signed in to change notification settings - Fork 732
Revise Linux GPU unittests CI workflow and remove ffmpeg CI workflow. #4103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
d84d4d5
a425a0d
820cead
84400db
c83d1f7
d88178f
a765a91
05a3083
83d3732
0be432e
0990d50
cd912e6
5b30c64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,98 +1,189 @@ | ||||||||
name: Unit-tests on Linux GPU | ||||||||
|
||||||||
on: | ||||||||
pull_request: | ||||||||
push: | ||||||||
branches: | ||||||||
- nightly | ||||||||
- main | ||||||||
- release/* | ||||||||
workflow_dispatch: | ||||||||
pull_request: | ||||||||
push: | ||||||||
branches: | ||||||||
- nightly | ||||||||
- main | ||||||||
- release/* | ||||||||
workflow_dispatch: | ||||||||
|
||||||||
jobs: | ||||||||
tests: | ||||||||
strategy: | ||||||||
matrix: | ||||||||
# TODO add up to 3.13 | ||||||||
python_version: ["3.10"] | ||||||||
cuda_arch_version: ["12.6"] | ||||||||
fail-fast: false | ||||||||
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main | ||||||||
permissions: | ||||||||
id-token: write | ||||||||
contents: read | ||||||||
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 PIP_PROGRESS_BAR=off | ||||||||
export CONDA_QUIET=1 | ||||||||
export CU_VERSION="${{ matrix.cuda_arch_version }}" | ||||||||
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}" | ||||||||
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 | ||||||||
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true | ||||||||
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_demucs=true | ||||||||
# Avoid reproducibility errors with CUBLAS: https://docs.nvidia.com/cuda/cublas/index.html#results-reproducibility | ||||||||
export CUBLAS_WORKSPACE_CONFIG=:4096:8 | ||||||||
# Set UPLOAD_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 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" | ||||||||
export GPU_ARCH_ID="cu126" # TODO this is currently hardcoded, should depend on matrix's value. | ||||||||
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${GPU_ARCH_ID}" | ||||||||
pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" | ||||||||
echo "::endgroup::" | ||||||||
echo "::group::Install TorchAudio" | ||||||||
conda install --quiet --yes cmake 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" | ||||||||
pip3 install parameterized requests coverage pytest pytest-cov scipy numpy expecttest | ||||||||
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) and not (torchscript and rnnt) and not torchscript_consistency' | ||||||||
) | ||||||||
cd test | ||||||||
python3 -m torch.utils.collect_env | ||||||||
env | grep TORCHAUDIO || true | ||||||||
pytest "${args[@]}" torchaudio_unittest | ||||||||
coverage html | ||||||||
build: | ||||||||
# Do not use matrix here to parameterize Python/CUDA versions. | ||||||||
samanklesaria marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
# This job is required to pass for each PR. | ||||||||
# The name of the required job is sensitive to matrix parameter. | ||||||||
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main | ||||||||
permissions: | ||||||||
id-token: write | ||||||||
contents: read | ||||||||
with: | ||||||||
job-name: Run tests | ||||||||
runner: linux.g5.4xlarge.nvidia.gpu | ||||||||
repository: pytorch/audio | ||||||||
gpu-arch-type: cuda | ||||||||
gpu-arch-version: "12.6" # See GPU_ARCH_ID below | ||||||||
samanklesaria marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
timeout: 120 | ||||||||
|
||||||||
script: | | ||||||||
set -ex | ||||||||
# Set up Environment Variables | ||||||||
export PYTHON_VERSION="3.10" | ||||||||
export CU_VERSION="11.8" | ||||||||
samanklesaria marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}" | ||||||||
samanklesaria marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
export PIP_PROGRESS_BAR=off | ||||||||
export CONDA_QUIET=1 | ||||||||
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 | ||||||||
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true | ||||||||
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_demucs=true | ||||||||
# Avoid reproducibility errors with CUBLAS: https://docs.nvidia.com/cuda/cublas/index.html#results-reproducibility | ||||||||
export CUBLAS_WORKSPACE_CONFIG=:4096:8 | ||||||||
# Set CHANNEL | ||||||||
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then | ||||||||
export CHANNEL=test | ||||||||
export BUILD_VERSION="$( cut -f 1 -d a version.txt )" | ||||||||
else | ||||||||
export CHANNEL=nightly | ||||||||
export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")" | ||||||||
fi | ||||||||
# Install miniforge | ||||||||
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" | ||||||||
bash Miniforge3.sh -b -p "${HOME}/conda" | ||||||||
source "${HOME}/conda/etc/profile.d/conda.sh" | ||||||||
|
||||||||
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 create --quiet -y --prefix ci_env python="${PYTHON_VERSION}" | |
conda create -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPU_ARCH_ID=cu126 # This is hard-coded and must be consistent with gpu-arch-version. | |
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/${GPU_ARCH_ID}" | |
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/cu${CU_VERSION_WITHOUT_PERIODS}" |
Uh oh!
There was an error while loading. Please reload this page.