Skip to content

Commit 77b2127

Browse files
authored
Update test_quant_passes.py (#2700)
* Update test_quant_passes.py Reduce tolerance to make tests less flakey * up
1 parent 1c96994 commit 77b2127

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

torchao/experimental/tests/test_quant_passes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def test_replace_q_dq_patterns_with_quantized_linear_ops_pass(self):
9191

9292
# Numerics should match
9393
exported_results = exported.module()(activations)
94-
self.assertTrue(torch.allclose(exported_results, eager_results))
94+
self.assertTrue(
95+
torch.allclose(exported_results, eager_results, atol=1e-3, rtol=1e-3)
96+
)
9597

9698
@parameterized.expand(
9799
[
@@ -148,7 +150,9 @@ def test_replace_q_dq_patterns_with_quantized_embedding_ops_pass(
148150

149151
# Numerics should match
150152
exported_results = exported.module()(indices)
151-
self.assertTrue(torch.allclose(exported_results, eager_results))
153+
self.assertTrue(
154+
torch.allclose(exported_results, eager_results, atol=1e-3, rtol=1e-3)
155+
)
152156

153157

154158
if __name__ == "__main__":

0 commit comments

Comments
 (0)