Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/linux_aarch64_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
ffmpeg-version-for-tests: ['7']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
- name: Check out repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux_cuda_aarch64_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
cuda-version: ['12.6']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
cuda-version: ['12.6', '13.0', '13.2']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
container:
image: "pytorch/manylinuxaarch64-builder:cuda${{ matrix.cuda-version }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_cuda_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ jobs:
# PR.
# For the actual release we should add that label and change this to
# include more python versions.
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
# We test against 12.6 and 13.0 to avoid having too big of a CI matrix,
# but for releases we should add 12.8.
cuda-version: ['12.6', '13.0']
cuda-version: ['12.6', '13.0', '13.2']
# TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
ffmpeg-version-for-tests: ['4', '6', '7', '8']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']

container:
image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
Expand Down Expand Up @@ -114,8 +114,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
ffmpeg-version-for-tests: ['8']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
- name: Check out repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows_cuda_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ jobs:
# PR.
# For the actual release we should add that label and change this to
# include more python versions.
python-version: ['3.10']
cuda-version: ['12.6', '13.0']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
cuda-version: ['12.6', '13.0', '13.2']
# TODO: FFmpeg 5 on Windows segfaults in avcodec_open2() when passing
# bad parameters.
# See https://github.com/pytorch/torchcodec/pull/806
ffmpeg-version-for-tests: ['4', '6', '7', '8']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
- name: Setup env vars
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
# TODO: FFmpeg 5 on Windows segfaults in avcodec_open2() when passing
# bad parameters.
# See https://github.com/pytorch/torchcodec/pull/806
ffmpeg-version-for-tests: ['4', '6', '7', '8']
ffmpeg-version-for-tests: ['4', '5', '6', '7', '8']
needs: build
steps:
- name: Check out repo
Expand Down
13 changes: 8 additions & 5 deletions test/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ def test_nvdec_cuda_interface_get_frame_at(
ref_frame = ref_decoder.get_frame_at(frame_index)
nvdec_frame = nvdec_decoder.get_frame_at(frame_index)
# TODONVDEC P1 see above
if ffmpeg_major_version > 4 and asset is not TEST_SRC_2_720P_MPEG4:
if ffmpeg_major_version > 5 and asset is not TEST_SRC_2_720P_MPEG4:
torch.testing.assert_close(
nvdec_frame.data, ref_frame.data, rtol=0, atol=0
)
Expand Down Expand Up @@ -1838,7 +1838,7 @@ def test_nvdec_cuda_interface_get_frames_at(
ref_frames = ref_decoder.get_frames_at(indices)
nvdec_frames = nvdec_decoder.get_frames_at(indices)
# TODONVDEC P1 see above
if ffmpeg_major_version > 4 and asset is not TEST_SRC_2_720P_MPEG4:
if ffmpeg_major_version > 5 and asset is not TEST_SRC_2_720P_MPEG4:
torch.testing.assert_close(
nvdec_frames.data, ref_frames.data, rtol=0, atol=0
)
Expand Down Expand Up @@ -1881,7 +1881,7 @@ def test_nvdec_cuda_interface_get_frame_played_at(self, asset, seek_mode):
ref_frame = ref_decoder.get_frame_played_at(pts)
nvdec_frame = nvdec_decoder.get_frame_played_at(pts)
# TODONVDEC P1 see above
if ffmpeg_major_version > 4 and asset is not TEST_SRC_2_720P_MPEG4:
if ffmpeg_major_version > 5 and asset is not TEST_SRC_2_720P_MPEG4:
torch.testing.assert_close(
nvdec_frame.data, ref_frame.data, rtol=0, atol=0
)
Expand Down Expand Up @@ -1923,7 +1923,7 @@ def test_nvdec_cuda_interface_get_frames_played_at(self, asset, seek_mode):
ref_frames = ref_decoder.get_frames_played_at(timestamps)
nvdec_frames = nvdec_decoder.get_frames_played_at(timestamps)
# TODONVDEC P1 see above
if ffmpeg_major_version > 4 and asset is not TEST_SRC_2_720P_MPEG4:
if ffmpeg_major_version > 5 and asset is not TEST_SRC_2_720P_MPEG4:
torch.testing.assert_close(
nvdec_frames.data, ref_frames.data, rtol=0, atol=0
)
Expand Down Expand Up @@ -1970,7 +1970,7 @@ def test_nvdec_cuda_interface_backwards(self, asset, seek_mode):
ref_frame = ref_decoder.get_frame_at(frame_index)
nvdec_frame = nvdec_decoder.get_frame_at(frame_index)
# TODONVDEC P1 see above
if ffmpeg_major_version > 4 and asset is not TEST_SRC_2_720P_MPEG4:
if ffmpeg_major_version > 5 and asset is not TEST_SRC_2_720P_MPEG4:
torch.testing.assert_close(
nvdec_frame.data, ref_frame.data, rtol=0, atol=0
)
Expand Down Expand Up @@ -2144,7 +2144,10 @@ def create_decoder():
gc.collect()

with self.restore_nvdec_cache_capacity():
# Flush any decoders left in the cache by previous tests.
set_nvdec_cache_capacity(0)
assert _core._get_nvdec_cache_size(device_index=0) == 0
set_nvdec_cache_capacity(10)

# Create decoder, it should be in the cache
create_decoder()
Expand Down
16 changes: 12 additions & 4 deletions test/test_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,8 @@ def test_extra_options_errors(self, method, tmp_path, extra_options, error):
in_fbcode(), reason="NVENC not available in fbcode"
),
pytest.mark.skipif(
ffmpeg_major_version == 4,
reason="CUDA + FFmpeg 4 test is flaky",
ffmpeg_major_version in (4, 5),
reason="CUDA + FFmpeg 4/5 test is flaky",
),
],
),
Expand Down Expand Up @@ -1383,6 +1383,10 @@ def test_extra_options_utilized(self, tmp_path, profile, colorspace, color_range
IS_WINDOWS and ffmpeg_major_version == 8,
reason="against_cli tests fail on Windows with FFmpeg 8",
)
@pytest.mark.skipif(
ffmpeg_major_version == 5,
reason="NVENC results diverge too much on FFmpeg 5",
)
def test_nvenc_against_ffmpeg_cli(
self, tmp_path, method, format, codec, color_space, color_range
):
Expand Down Expand Up @@ -2751,8 +2755,8 @@ def test_audio_to_file_vs_to_file_like(self, tmp_path, format):
in_fbcode(), reason="NVENC not available in fbcode"
),
pytest.mark.skipif(
ffmpeg_major_version == 4,
reason="CUDA + FFmpeg 4 test is flaky",
ffmpeg_major_version in (4, 5),
reason="CUDA + FFmpeg 4/5 test is flaky",
),
],
),
Expand Down Expand Up @@ -3522,6 +3526,10 @@ def test_fragmented_mp4_truncation(self, format, method, tmp_path):
IS_WINDOWS and ffmpeg_major_version == 8,
reason="against_cli tests fail on Windows with FFmpeg 8",
)
@pytest.mark.skipif(
ffmpeg_major_version == 5,
reason="NVENC results diverge too much on FFmpeg 5",
)
def test_nvenc_against_ffmpeg_cli(
self, tmp_path, method, format, codec, color_space, color_range
):
Expand Down
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def assert_frames_equal(*args, **kwargs):
if sys.platform == "linux" and "x86" in platform.machine().lower():
if args[0].device.type == "cuda":
atol = 3 if cuda_version_used_for_building_torch() >= (13, 0) else 2
if ffmpeg_major_version == 4:
if ffmpeg_major_version in (4, 5):
assert_tensor_close_on_at_least(
args[0], args[1], percentage=95, atol=atol
)
Expand Down
Loading