Skip to content

Conversation

@BruceDai
Copy link
Contributor

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.

@wpt-pr-bot
Copy link
Collaborator

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!

Copy link
Contributor

@Honry Honry left a 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/
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. :)

}

idl_array.add_objects({
NavigatorML: [],
Copy link
Contributor

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.

// 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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@@ -0,0 +1,40 @@
// META: global=window,worker
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// META: global=window,worker
// META: global=window,dedicatedworker

WebNN only support DedicatedWorker.

@BruceDai
Copy link
Contributor Author

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.

Copy link
Contributor

@Honry Honry left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@BruceDai
Copy link
Contributor Author

@Honry I rebased code to latest master, now all checks passed, PTAL, thanks.

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