Skip to content

Commit 0e72a50

Browse files
authored
Add missing torchcodec dependency to Windows CI installation script. (#4107)
* Add missing torchcodec dependency to Windows CI installation script. * Windows: install ffmpeg from conda * Use CPU torchcodec on Windows w/ CUDA-enabled torch
1 parent 799d288 commit 0e72a50

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

.github/scripts/unittest-windows/install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ fi
3232
printf "Installing PyTorch\n"
3333
pip install --pre torch --index-url https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${wheel}
3434

35+
python -c "import torch; print(torch.__version__)"
36+
3537
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
3638
echo torch.cuda.is_available is $torch_cuda
3739

@@ -42,6 +44,12 @@ if [ ! -z "${CUDA_VERSION:-}" ] ; then
4244
fi
4345
fi
4446

47+
printf "Installing TorchCodec\n"
48+
# torchcodec nightly has no Windows+CUDA wheels, so we'll use CPU-only
49+
# torchcodec also under CUDA-enabled torch:
50+
pip install --pre torchcodec --index-url https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu
51+
python -c "import torchcodec; print(torchcodec.__version__)"
52+
4553
# 2. Install torchaudio
4654
printf "* Installing fsspec\n" # TODO: is this required for torchaudio??
4755
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org fsspec

.github/scripts/unittest-windows/run_test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ python -m torch.utils.collect_env
1212
env | grep TORCHAUDIO || true
1313

1414
cd test
15-
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa"
15+
if [ -z "${CUDA_VERSION:-}" ] ; then
16+
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa"
17+
else
18+
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not cpu and (cuda or gpu) and not torchscript and not fairseq and not demucs and not librosa"
19+
fi
1620
coverage html

.github/scripts/unittest-windows/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ fi
3636
conda activate "${env_dir}"
3737

3838
# 3. Install minimal build tools
39-
conda install -y -c conda-forge cmake ninja
39+
conda install -y -c conda-forge cmake ninja "ffmpeg<8"

.github/workflows/unittest-windows-cpu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unittests on Windows CPU
1+
name: Unit-tests on Windows CPU
22

33
on:
44
pull_request:
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
unittests-windows-cpu:
13+
build:
1414
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
1515
with:
1616
repository: pytorch/audio
@@ -21,7 +21,7 @@ jobs:
2121
git config --global --add safe.directory /__w/audio/audio
2222
2323
# Set up Environment Variables
24-
export PYTHON_VERSION="3.10"
24+
export PYTHON_VERSION="3.11"
2525
export PIP_PROGRESS_BAR=off
2626
export CONDA_QUIET=1
2727
unset CUDA_VERSION

.github/workflows/unittest-windows-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unittests on Windows GPU
1+
name: Unit-tests on Windows GPU
22

33
on:
44
pull_request:
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
unittests-windows-gpu:
13+
build:
1414
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
1515
with:
1616
repository: pytorch/audio

0 commit comments

Comments
 (0)