From 68c5e41077d4502531e65c66987ec2fb1d212c89 Mon Sep 17 00:00:00 2001 From: Lunderberg Date: Thu, 12 Aug 2021 17:40:07 -0500 Subject: [PATCH] [UnitTest] Updated tolerances to avoid flaky unit test. (#8723) * [UnitTest] Updated tolerances to avoid flaky unit test. The result was correct, but the atol was just small enough to trigger a CI error for a value that was close to zero in an unrelated PR at #8670. https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-8670/16/pipeline/#step-236-log-1703 * Also updated 32-bit version of test_conv2d_nchw --- .../python/relay/test_auto_scheduler_layout_rewrite_networks.py | 2 +- tests/python/topi/python/test_topi_conv2d_nchw.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/python/relay/test_auto_scheduler_layout_rewrite_networks.py b/tests/python/relay/test_auto_scheduler_layout_rewrite_networks.py index 5b0125b452c5..dd3126a09810 100644 --- a/tests/python/relay/test_auto_scheduler_layout_rewrite_networks.py +++ b/tests/python/relay/test_auto_scheduler_layout_rewrite_networks.py @@ -179,7 +179,7 @@ def get_output(data, lib): actual_output = get_output(data, lib) expected_output = get_output(data, lib2) - tvm.testing.assert_allclose(actual_output, expected_output, rtol=1e-4, atol=1e-4) + tvm.testing.assert_allclose(actual_output, expected_output, rtol=1e-4, atol=2e-4) def test_conv2d(): diff --git a/tests/python/topi/python/test_topi_conv2d_nchw.py b/tests/python/topi/python/test_topi_conv2d_nchw.py index 5cc8bb0a1de7..96a7ff9b926c 100644 --- a/tests/python/topi/python/test_topi_conv2d_nchw.py +++ b/tests/python/topi/python/test_topi_conv2d_nchw.py @@ -142,7 +142,7 @@ def test_conv2d_nchw( if "int" in dtype: tol = {"atol": 0, "rtol": 0} elif dtype == "float32": - tol = {"rtol": 1e-4, "atol": 1e-4} + tol = {"rtol": 1e-4, "atol": 2e-4} elif dtype == "float16": # A summation in float16 with a single accumulator very # quickly runs into large rounding errors. At some point,