From 533e027a39a84a5b86f5b30586e3b43605fb9760 Mon Sep 17 00:00:00 2001 From: Daniel Vega-Myhre Date: Fri, 7 Feb 2025 09:55:54 -0800 Subject: [PATCH] skip torch versions < 2.5 --- test/float8/test_float8_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/float8/test_float8_utils.py b/test/float8/test_float8_utils.py index 80b169089e..25c5cdc69c 100644 --- a/test/float8/test_float8_utils.py +++ b/test/float8/test_float8_utils.py @@ -4,6 +4,10 @@ import torch from torchao.float8.float8_utils import _round_scale_down_to_power_of_2 +from torchao.utils import TORCH_VERSION_AT_LEAST_2_5 + +if not TORCH_VERSION_AT_LEAST_2_5: + pytest.skip("Unsupported PyTorch version", allow_module_level=True) # source for notable single-precision cases: @@ -33,6 +37,11 @@ def test_round_scale_down_to_power_of_2_valid_inputs( torch.tensor(expected_result).cuda(), ) result = _round_scale_down_to_power_of_2(input_tensor) + + print(f"input: {input}") + print(f"input tensor: {input_tensor}") + print(f"result: {result}") + print(f"expected_result: {expected_result}") assert ( torch.equal(result, expected_tensor) or (result.isnan() and expected_tensor.isnan())