-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add IDL tests for Web Neural Network API #31201
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
Conversation
|
There are no reviewers for this pull request. Please reach out on W3C's irc server (irc.w3.org, port 6665) on channel #testing (web client) to get help with this. Thank you! |
Honry
left a comment
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.
Thanks @BruceDai ! Generally LGTM % some comments.
| @@ -0,0 +1 @@ | |||
| spec: https://webmachinelearning.github.io/webnn/ | |||
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.
Could you add some suggested reviewers to this file?
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.
Thanks @Honry.
@anaskim @dontcallmedom @Honry May I invite you to be reviewers? Then I would add your name into suggested reviewers list of META.yml file, thanks.
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.
Sure. :)
webnn/idlharness.https.any.js
Outdated
| } | ||
|
|
||
| idl_array.add_objects({ | ||
| NavigatorML: [], |
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.
Please also add 'navigator' to this NavigatorML object.
webnn/idlharness.https.any.js
Outdated
| // META: global=window,worker | ||
| // META: script=/resources/WebIDLParser.js | ||
| // META: script=/resources/idlharness.js | ||
| // META: script=https://webmachinelearning.github.io/webnn-polyfill/dist/webnn-polyfill.js |
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.
Could you add a README.md to explain what is webnn-polyfill and why/how we use it in wpt for now? Thus would help other contributors get started.
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.
I think we should land this without the polyfill - WPT is meant to test browser implementations, and the polyfill would hide any gap from browser implementations.
(naturally, this means the tests will fail all the browsers at the moment, but that's a proper reflection of the reality of the implementation landscape)
We could also have a separate open PR with just the polyfill added which would allow us to use WPT.fyi to collect results once the polyfill is added.
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.
Thanks @dontcallmedom.
We could also have a separate open PR with just the polyfill added which would allow us to use WPT.fyi to collect results once the polyfill is added.
Do you mean that we need add webnn-polyfill.js directly into WPT in the separate PR? If so, we have to consider maintaining it.
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.
what I meant is that we could have a separate PR - not meant to be merged (maybe marked as draft?) which just adds exactly the same line
// META: script=https://webmachinelearning.github.io/webnn-polyfill/dist/webnn-polyfill.js
then wpt.fyi would generate results for the said PR which would allow us to get automated results on how browsers behave when the polyfill is added, without polluting the default branch of WPT.
webnn/idlharness.https.any.js
Outdated
| @@ -0,0 +1,40 @@ | |||
| // META: global=window,worker | |||
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.
| // META: global=window,worker | |
| // META: global=window,dedicatedworker |
WebNN only support DedicatedWorker.
|
Thanks @Honry @dontcallmedom and @anssiko. I've updated commit, please take another look, thanks. BTW, if this pr was landed, I will submit new pr for polyfill, thanks. |
Honry
left a comment
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.
Thanks, LGTM.
f6cb57c to
158c88a
Compare
|
@Honry I rebased code to latest master, now all checks passed, PTAL, thanks. |
This PR is trying to add IDL tests for Web Neural Network API (WebNN API).
Current we could run these tests using WebNN-Polyfill which is a JavaScript implementation of the WebNN API. There're totally 353 IDL tests including 213 PASS tests and 140 Fail tests now, some FAIL tests are due to unimplemented WebNN API ops in the WebNN-Polyfill.
@dontcallmedom @anssiko @Honry, PTAL, thanks.