Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webnn] Add float32 tests for WebNN hardSwish op #38712

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

BruceDai
Copy link
Contributor

@fdwr @Honry @dontcallmedom PTAL, thanks.

9.11885929107666,
3.545238494873047,
2.4567370414733887,
0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fail to run these hardSwish tests by Chromium integrated WebNN API with XNNPack API back, since XNNPack API can distinguish 0.0 and -0.0.
@fdwr @huningxin Any suggestion? Thanks.

Copy link

@fdwr fdwr Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed and unsigned zero can be treated as equivalent (IEEE does https://en.wikipedia.org/wiki/Signed_zero#Comparisons). I recommend that before checking for ULP differences in assert_array_approx_equals_ulp, first check if expected == actual, and only if !=, would you need to check ULP too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fdwr Thanks for your suggestion! Yes, if actual was as same as expect one, no need to measure the ULP distance which would save testing time. Please take another look, thanks.

        whether actual result is as same as expect one.
@Honry Honry merged commit 50089b8 into web-platform-tests:master Mar 1, 2023
marcoscaceres pushed a commit that referenced this pull request Mar 28, 2023
* [webnn] Add float32 tests for WebNN hardSwish op

* [webnn] Optimize assert_array_approx_equals_ulp method by firstly check
        whether actual result is as same as expect one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants