Skip to content

Commit 533e027

Browse files
skip torch versions < 2.5
1 parent 77d004e commit 533e027

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/float8/test_float8_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import torch
55

66
from torchao.float8.float8_utils import _round_scale_down_to_power_of_2
7+
from torchao.utils import TORCH_VERSION_AT_LEAST_2_5
8+
9+
if not TORCH_VERSION_AT_LEAST_2_5:
10+
pytest.skip("Unsupported PyTorch version", allow_module_level=True)
711

812

913
# source for notable single-precision cases:
@@ -33,6 +37,11 @@ def test_round_scale_down_to_power_of_2_valid_inputs(
3337
torch.tensor(expected_result).cuda(),
3438
)
3539
result = _round_scale_down_to_power_of_2(input_tensor)
40+
41+
print(f"input: {input}")
42+
print(f"input tensor: {input_tensor}")
43+
print(f"result: {result}")
44+
print(f"expected_result: {expected_result}")
3645
assert (
3746
torch.equal(result, expected_tensor)
3847
or (result.isnan() and expected_tensor.isnan())

0 commit comments

Comments
 (0)