Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 13d9ae0

Browse files
committed
Increase tolerances for test_np_percentile and test_np_quantile when using float16 and midpoint interpolation.
1 parent 764a514 commit 13d9ae0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/python/unittest/test_numpy_op.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7543,6 +7543,11 @@ def hybrid_forward(self, F, a):
75437543
if dtype == np.float16 and interpolation == 'linear': continue
75447544
atol = 3e-4 if dtype == np.float16 else 1e-4
75457545
rtol = 3e-2 if dtype == np.float16 else 1e-2
7546+
# decrease tolerance when using midpoint interpolation with float16
7547+
# tracked at https://github.com/apache/incubator-mxnet/issues/20869
7548+
if dtype == np.float16 and interpolation == 'midpoint':
7549+
atol = 3e-3
7550+
rtol = 1e-1
75467551
a = np.random.uniform(-10.0, 10.0, size=a_shape).astype(dtype)
75477552
qtype = random.choice(qtypes)
75487553
q = np.random.uniform(0, 1.0, size=q_shape).astype(qtype)
@@ -7606,6 +7611,11 @@ def hybrid_forward(self, F, a):
76067611
if dtype == np.float16 and interpolation == 'linear': continue
76077612
atol = 3e-4 if dtype == np.float16 else 1e-4
76087613
rtol = 3e-2 if dtype == np.float16 else 1e-2
7614+
# decrease tolerance when using midpoint interpolation with float16
7615+
# tracked at https://github.com/apache/incubator-mxnet/issues/20869
7616+
if dtype == np.float16 and interpolation == 'midpoint':
7617+
atol = 1e-3
7618+
rtol = 1e-1
76097619
a = np.random.uniform(-10.0, 10.0, size=a_shape).astype(dtype)
76107620
qtype = random.choice(qtypes)
76117621
q = np.random.uniform(0, 1.0, size=q_shape).astype(qtype)

0 commit comments

Comments
 (0)