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

Disable WebNN CPU for LeNet #204

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

ibelem
Copy link
Contributor

@ibelem ibelem commented Mar 25, 2024

Handwritten Digits Classification: The input layout nchw is not supported when select WebNN (CPU).

There is no lenet_nchw weights files under https://github.com/webmachinelearning/test-data/tree/main/models . Disable "WebNN CPU" in WebNN Samples.

@huningxin @Honry PTAL

lenet/index.html Outdated Show resolved Hide resolved
@ibelem
Copy link
Contributor Author

ibelem commented Mar 25, 2024

Comment out WebNN CPU backend until there is NCHW layout by transpose for LeNet. @Honry PTAL

Copy link
Collaborator

@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.

LGTM, thanks!

@Honry Honry merged commit cc9559c into webmachinelearning:master Mar 25, 2024
3 checks passed
huningxin added a commit to huningxin/webnn-samples that referenced this pull request Mar 25, 2024
Honry pushed a commit that referenced this pull request Mar 25, 2024
* Revert "Disable WebNN CPU for LeNet (#204)"

This reverts commit cc9559c.

* Support CPU backend for LeNet sample

The changes of this PR include:
1. Support nhwc conv2d and pool2d for LeNet.
2. Derive permuteData function from transformers.js that is used to
   permute the filter data.
3. Use gemm to replace matmul, because XNNPACK matmul doesn't support 2D
   inputs.
4. Fix some isses of UI.
Honry pushed a commit to Honry/webnn-samples that referenced this pull request May 15, 2024
* Disable WebNN CPU for LeNet

* Comment out WebNN CPU backend until there is NCHW layout by transpose
Honry pushed a commit to Honry/webnn-samples that referenced this pull request May 15, 2024
* Revert "Disable WebNN CPU for LeNet (webmachinelearning#204)"

This reverts commit cc9559c.

* Support CPU backend for LeNet sample

The changes of this PR include:
1. Support nhwc conv2d and pool2d for LeNet.
2. Derive permuteData function from transformers.js that is used to
   permute the filter data.
3. Use gemm to replace matmul, because XNNPACK matmul doesn't support 2D
   inputs.
4. Fix some isses of UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants