-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enable WebNN GPU backend #181
Conversation
@huningxin, @BruceDai, PTAL, thanks! cc/ @mingmingtasd |
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 for this enabling, LGTM.
@@ -310,7 +310,7 @@ async function main() { | |||
// UI shows model loading progress | |||
await ui.showProgressComponent('current', 'pending', 'pending'); | |||
console.log('- Loading weights... '); | |||
const contextOptions = {deviceType}; | |||
const contextOptions = {'devicePreference': deviceType}; |
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.
Yes, since there's a Chromium issue - Cannot test Web Neural Network API (WebNN) by specified device type , here should use devicePreference
option which is align with MLContextOptions
of Model Loader API Spec to test GPU device.
@Honry , thanks for the PR! May I know what is the UX if user click "WebNN GPU" but browser doesn't support that? |
That's fine at the current stage. Please a Chromium implementation (CL-4814277) is moving the backend creation during context creation. It would allow the sample to detect the unsupported error before downloading the model. |
LGTM, thanks @Honry ! |
Thanks all, merging. |
No description provided.