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

Support CPU backend for LeNet sample #205

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

huningxin
Copy link
Contributor

@huningxin huningxin commented Mar 25, 2024

The changes of this PR include:

  1. Revert Disable WebNN CPU for LeNet #204.
  2. Support nhwc conv2d and pool2d for LeNet and use nhwc for CPU device.
  3. Derive permuteData function from transformers.js that is used to permute the filter data.
  4. Use gemm to replace matmul, because XNNPACK matmul doesn't support 2D inputs.
  5. Fix some issues of UI.

/cc @ibelem

@huningxin huningxin requested a review from Honry March 25, 2024 08:29
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.
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.

Super!👍

@Honry Honry merged commit 5ec9ec8 into webmachinelearning:master Mar 25, 2024
3 checks passed
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