Skip to content

Commit

Permalink
[UnitTest] Updated tolerances to avoid flaky unit test. (#8723)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
Lunderberg authored Aug 12, 2021
1 parent 3e37bb5 commit 8843153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/python/topi/python/test_topi_conv2d_nchw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8843153

Please sign in to comment.