Skip to content

Commit

Permalink
Skip test_choose_qparams_token_asym on pt 2.6 (#981)
Browse files Browse the repository at this point in the history
* Pin PT nightly to fix token sym failure

* update

* push

* p

* push

* skip test on pt 2.6

* fix

* up
  • Loading branch information
msaroufim authored Sep 30, 2024
1 parent 8af72fc commit 68e1886
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/quantization/test_quant_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TORCH_VERSION_AT_LEAST_2_3,
TORCH_VERSION_AT_LEAST_2_4,
TORCH_VERSION_AT_LEAST_2_5,
TORCH_VERSION_AT_LEAST_2_6,
is_fbcode,
)

Expand Down Expand Up @@ -201,6 +202,7 @@ def test_choose_qparams_group_sym_no_clipping_err(self):
self.assertTrue(torch.equal(scale, scale_ref))
self.assertTrue(torch.equal(zero_point, zp_ref))
@unittest.skipIf(not TORCH_VERSION_AT_LEAST_2_3, "skipping when torch version is 2.3 or lower")
@unittest.skipIf(TORCH_VERSION_AT_LEAST_2_6, "skipping when torch version is 2.6 or higher")
@unittest.skipIf(is_fbcode(), "broken in fbcode")
def test_choose_qparams_token_asym(self):
input = torch.randn(10, 10)
Expand Down
2 changes: 2 additions & 0 deletions torchao/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"TORCH_VERSION_AT_LEAST_2_3",
"TORCH_VERSION_AT_LEAST_2_4",
"TORCH_VERSION_AT_LEAST_2_5",
"TORCH_VERSION_AT_LEAST_2_6",

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

TORCH_VERSION_AT_LEAST_2_6 = torch_version_at_least("2.6.0")
TORCH_VERSION_AT_LEAST_2_5 = torch_version_at_least("2.5.0")
TORCH_VERSION_AT_LEAST_2_4 = torch_version_at_least("2.4.0")
TORCH_VERSION_AT_LEAST_2_3 = torch_version_at_least("2.3.0")
Expand Down

0 comments on commit 68e1886

Please sign in to comment.