-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
@mxnet-label-bot add [Operator, Test, pr-awaiting-review] |
It this op only support float32? |
Actually, only the tolerances (rtol, atol) are supposed to be float32. The elements of tensors could be any type. |
I am not sure that this fail is related to my changes made to this PR. I will make an empty commit for triggering CI. |
Failing tests are not related to the changes of this PR. I will launch CI one more time. |
Sometimes the CI may fails and raise an irrelated exception. We can disable the using of mx.nd.contrib.allclose firstly to check it. |
As I could see that _test_bulking() is not there and I need to fix it. |
Glad to see the success of CI : ) @chinakook @szha @mseth10 |
@drivanov Could you do a rebase to resolve the merge conflicts? |
there're merge conflicts that need to be resolved first. |
Just in case, I rebased. CI is ok and should be no merge conflicts. |
because PR apache#14443 is not approved yet in upstream
because PR apache#14443 is not approved yet in upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* MXNET version of numpy.allclose operation implemented * Helper function test_bulking renamed to _test_bulking * Will use mx.test_utils.assert_allclose and not a numpy version of similar function * Trigger CI * Trigger CI * Will use mx.test_utils.assert_allclose * Trigger CI * Trigger CI * Problem with missed _test_bulking() function fixed * Fixing minor bug in error reporting * Trigger CI * Trigger CI * retrigger CI * Fixing problems in discrepancies printout in assert_almost_equal * Trigger CI * Trigger CI * Improved version of MxNet allclose operator * Fixing minor problem in attribite definition for allclose operator * retrigger CI * Minor problem fixed * Trigger CI * try to fix find_max_violation * Trigger CI * Skip 'test_bulking_gluon_gpu()' test * Fixing bug in reporting MaxErrors for NaN coordinates. * use smaller testcase for test_layer_norm * remove redundant test for test_layer_norm * reuse old testcase * retrigger CI * ci * ci * Merge problem fixed * Fixing Python's lint problem * Trigger CI * Trigger CI * Trigger CI * Trigger CI * Trigger CI
Description
numpy.allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)
is implemented as a MxNet operator:test_allclose_function()
, this method is used only inwhere parameter a or/and b could be defined also as
mx.nd.array
(s):When calling
assert_almost_equal
, no moreasnumpy()
conversion needed. It will be done automatically (inassert_almost_equal
), if(a) a or b has no attribute "context" OR
(b) these attributes are different.
The elimination of
asnumpy()
conversions and the use ofmx.nd.contrib.allclose(...)
formx.nd.array
's allows to achieve 5-7x speedup for GPU tests that use long arrays.Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
Most of the changed files, were changed because of the eliminations of
asnumpy()
conversions which were used whenassert_almost_equal
function is called.