Skip to content

Commit

Permalink
Fix WOQ int8 failures
Browse files Browse the repository at this point in the history
  • Loading branch information
leslie-fang-intel committed Sep 13, 2024
1 parent 8236a87 commit 18585d2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@
def _int8wo_api(mod):
if TORCH_VERSION_AT_LEAST_2_4:
quantize_(mod, int8_weight_only(), set_inductor_config=False)
if not TORCH_VERSION_AT_LEAST_2_5:
if (
not TORCH_VERSION_AT_LEAST_2_5
) or torch._inductor.config.freezing:
unwrap_tensor_subclass(mod)
else:
change_linear_weights_to_int8_woqtensors(mod)
Expand Down Expand Up @@ -817,9 +819,6 @@ def test_int8_dynamic_quant_subclass_api(self, device, dtype):
@parameterized.expand(COMMON_DEVICE_DTYPE)
@unittest.skipIf(is_fbcode(), "broken in fbcode")
def test_int8_weight_only_quant_subclass_api(self, device, dtype):
if TORCH_VERSION_AT_LEAST_2_5 and device == "cpu":
self.skipTest("Regression introduced in PT nightlies")

undo_recommended_configs()
self._test_lin_weight_subclass_api_impl(
_int8wo_api, device, 40, test_dtype=dtype
Expand All @@ -829,9 +828,6 @@ def test_int8_weight_only_quant_subclass_api(self, device, dtype):
@torch._inductor.config.patch({"freezing": True})
@unittest.skipIf(not TORCH_VERSION_AT_LEAST_2_4, "freeze requires torch 2.4 and after.")
def test_int8_weight_only_quant_with_freeze(self, device, dtype):
if TORCH_VERSION_AT_LEAST_2_5 and device == "cpu":
self.skipTest("Regression introduced in PT nightlies")

self._test_lin_weight_subclass_api_impl(
_int8wo_api, device, 40, test_dtype=dtype
)
Expand Down

0 comments on commit 18585d2

Please sign in to comment.