Skip to content

Commit 75df5f5

Browse files
committed
skip dynamic opcheck unless torch>=2.5
1 parent e089ffb commit 75df5f5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/test_ops.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
run_tests,
1111
)
1212
from torch.testing._internal.optests import opcheck
13-
from torchao.utils import is_fbcode
13+
from torchao.utils import is_fbcode, TORCH_VERSION_AFTER_2_5
1414
from torchao.prototype.quant_llm import from_scaled_tc_fpx
1515
import pytest
1616

@@ -76,7 +76,7 @@ def test_quant_llm_linear_correctness(self, ebits, mbits, BS, OC, IC, splitK):
7676
instantiate_parametrized_tests(TestOps)
7777

7878

79-
## Tests for `unpack_int4_packed`
79+
## Tests for `tensor_core_layout`
8080
kTileSizeN = 8
8181
kTileSizeK = 16
8282

@@ -113,8 +113,12 @@ def test_unpack_tensor_core_tiled_layout_op(shape, inner_k_tiles):
113113
"test_schema",
114114
"test_autograd_registration",
115115
"test_faketensor",
116-
"test_aot_dispatch_dynamic",
117116
]
117+
118+
# TODO: Figure out why test fails unless torch >= 2.5
119+
if TORCH_VERSION_AFTER_2_5:
120+
test_utils.append("test_aot_dispatch_dynamic")
121+
118122
t = torch.randint(0, 16, dtype=torch.int, size=shape, device="cuda")
119123
packed_w = torch.ops.aten._convert_weight_to_int4pack(t, inner_k_tiles)
120124

@@ -272,13 +276,15 @@ def test_dequantize_tensor_core_tiled_layout_op(shape, inner_k_tiles, group_size
272276
"test_schema",
273277
"test_autograd_registration",
274278
"test_faketensor",
275-
"test_aot_dispatch_dynamic",
276279
]
280+
# TODO: Figure out why test fails unless torch >= 2.5
281+
if TORCH_VERSION_AFTER_2_5:
282+
test_utils.append("test_aot_dispatch_dynamic")
277283
opcheck(
278284
torch.ops.torchao.dequantize_tensor_core_tiled_layout,
279285
(packed_w, scales_and_zeros, group_size, inner_k_tiles),
280286
test_utils=test_utils,
281287
)
282288

283289
if __name__ == "__main__":
284-
run_tests()
290+
run_tests()

0 commit comments

Comments
 (0)