Skip to content

Commit 68e1886

Browse files
authored
Skip test_choose_qparams_token_asym on pt 2.6 (#981)
* Pin PT nightly to fix token sym failure * update * push * p * push * skip test on pt 2.6 * fix * up
1 parent 8af72fc commit 68e1886

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/quantization/test_quant_primitives.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
TORCH_VERSION_AT_LEAST_2_3,
3131
TORCH_VERSION_AT_LEAST_2_4,
3232
TORCH_VERSION_AT_LEAST_2_5,
33+
TORCH_VERSION_AT_LEAST_2_6,
3334
is_fbcode,
3435
)
3536

@@ -201,6 +202,7 @@ def test_choose_qparams_group_sym_no_clipping_err(self):
201202
self.assertTrue(torch.equal(scale, scale_ref))
202203
self.assertTrue(torch.equal(zero_point, zp_ref))
203204
@unittest.skipIf(not TORCH_VERSION_AT_LEAST_2_3, "skipping when torch version is 2.3 or lower")
205+
@unittest.skipIf(TORCH_VERSION_AT_LEAST_2_6, "skipping when torch version is 2.6 or higher")
204206
@unittest.skipIf(is_fbcode(), "broken in fbcode")
205207
def test_choose_qparams_token_asym(self):
206208
input = torch.randn(10, 10)

torchao/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"TORCH_VERSION_AT_LEAST_2_3",
2727
"TORCH_VERSION_AT_LEAST_2_4",
2828
"TORCH_VERSION_AT_LEAST_2_5",
29+
"TORCH_VERSION_AT_LEAST_2_6",
2930

3031
# Needs to be deprecated in the future
3132
"TORCH_VERSION_AFTER_2_2",
@@ -317,6 +318,7 @@ def is_fbcode():
317318
def torch_version_at_least(min_version):
318319
return is_fbcode() or compare_versions(torch.__version__, min_version) >= 0
319320

321+
TORCH_VERSION_AT_LEAST_2_6 = torch_version_at_least("2.6.0")
320322
TORCH_VERSION_AT_LEAST_2_5 = torch_version_at_least("2.5.0")
321323
TORCH_VERSION_AT_LEAST_2_4 = torch_version_at_least("2.4.0")
322324
TORCH_VERSION_AT_LEAST_2_3 = torch_version_at_least("2.3.0")

0 commit comments

Comments
 (0)