Skip to content

Commit 1cd83ea

Browse files
author
Daniel Flores
committed
keep lower atol for CUDA<13
1 parent c5e8f5c commit 1cd83ea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/test_decoders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,10 @@ def test_full_and_studio_range_bt709_video(self, asset):
12231223
gpu_frame = decoder_gpu.get_frame_at(frame_index).data.cpu()
12241224
cpu_frame = decoder_cpu.get_frame_at(frame_index).data
12251225

1226-
if cuda_version_used_for_building_torch() >= (12, 9):
1226+
if cuda_version_used_for_building_torch() >= (13, 0):
12271227
torch.testing.assert_close(gpu_frame, cpu_frame, rtol=0, atol=3)
1228+
elif cuda_version_used_for_building_torch() >= (12, 9):
1229+
torch.testing.assert_close(gpu_frame, cpu_frame, rtol=0, atol=2)
12281230
elif cuda_version_used_for_building_torch() == (12, 8):
12291231
assert psnr(gpu_frame, cpu_frame) > 20
12301232

test/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def psnr(a, b, max_val=255) -> float:
7373
def assert_frames_equal(*args, **kwargs):
7474
if sys.platform == "linux":
7575
if args[0].device.type == "cuda":
76-
atol = 3
76+
atol = 3 if cuda_version_used_for_building_torch() >= (13, 0) else 2
7777
if get_ffmpeg_major_version() == 4:
7878
assert_tensor_close_on_at_least(
7979
args[0], args[1], percentage=95, atol=atol

0 commit comments

Comments
 (0)