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

gelu_test disabled and flaky upon enabling #18381

Open
leezu opened this issue May 21, 2020 · 0 comments
Open

gelu_test disabled and flaky upon enabling #18381

leezu opened this issue May 21, 2020 · 0 comments

Comments

@leezu
Copy link
Contributor

leezu commented May 21, 2020

Description

https://github.com/apache/incubator-mxnet/blob/0210ce2c136afaa0f57666e5e1c659cab353f5f3/tests/python/unittest/test_gluon.py#L1423-L1434

is actually a no-op by mistake. Upon enabling the test as follows:

    gelu = mx.gluon.nn.GELU()
    def gelu_test(x):
        CUBE_CONSTANT = 0.044715
        ROOT_TWO_OVER_PI = 0.7978845608028654
        def g(x):
            return ROOT_TWO_OVER_PI * (x + CUBE_CONSTANT * x * x * x)
        def f(x):
            return 1.0 + mx.nd.tanh(g(x))
        def gelu(x):
            return 0.5 * x * f(x)
        return [gelu(x_i) for x_i in x]

    for test_point, ref_point in zip(gelu_test(point_to_validate), gelu(point_to_validate)):
        assert test_point == ref_point

the tests fails frequently

[2020-05-21T19:13:03.252Z]         for test_point, ref_point in zip(gelu_test(point_to_validate), gelu(point_to_validate)):
[2020-05-21T19:13:03.252Z] >           assert test_point == ref_point
[2020-05-21T19:13:03.252Z] E           assert \n[-0.04601725...ray 1 @cpu(0)> == \n[-0.04601722...ray 1 @cpu(0)>
[2020-05-21T19:13:03.252Z] E             -\n
[2020-05-21T19:13:03.252Z] E             -[-0.04601725]\n
[2020-05-21T19:13:03.252Z] E             -<NDArray 1 @cpu(0)>
[2020-05-21T19:13:03.252Z] E             +\n
[2020-05-21T19:13:03.252Z] E             +[-0.04601722]\n
[2020-05-21T19:13:03.252Z] E             +<NDArray 1 @cpu(0)>
[2020-05-21T19:13:03.252Z] E             Full diff:
[2020-05-21T19:13:03.252Z] E             
[2020-05-21T19:13:03.252Z] E             - [-0.04601725]
[2020-05-21T19:13:03.252Z] E             ?            ^
[2020-05-21T19:13:03.252Z] E             + [-0.04601722]
[2020-05-21T19:13:03.252Z] E             ?            ^
[2020-05-21T19:13:03.252Z] E               <NDArray 1 @cpu(0)>

http://jenkins.mxnet-ci.amazon-ml.com/blue/rest/organizations/jenkins/pipelines/mxnet-validation/pipelines/unix-cpu/branches/PR-18376/runs/5/nodes/363/steps/738/log/?start=0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant