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

XNNPACK backend supports subgraph API #239

Merged
merged 8 commits into from
Apr 22, 2022

Conversation

huningxin
Copy link
Collaborator

XNNPACK subgraph API is used by TFLite XNNPACK delegate for graph level optimization and execution with good performance.

This PR updates WebNN-native's XNNPACK backend to support subgraph API with 27 ops support

  • binary including add, sub, mul, div, max, min
  • clamp
  • concat (only support concatenation of up to 4 inputs)
  • conv2d (only support nhwc layout)
  • gemm (only support constant weights)
  • matmul (only support 2d operand b)
  • pad
  • pool2d: average and max (only support nhwc layout)
  • reshape
  • split (only support even split up to 4 outputs)
  • squeeze
  • unary including abs, ceil, floor, neg
  • activations: relu, leakyRelu, hardswish, sigmoid
  • softmax

webnn_end2end_tests results:
[ PASSED ] 103 tests including MobileNetV2Nhwc and SqueezeNetNhwc
267 FAILED TESTS

@fujunwei , PTAL.

This PR also adds constant weights cases in gemm tests, @BruceDai , please also take a look.

@huningxin huningxin requested a review from fujunwei April 22, 2022 01:19
Copy link
Collaborator

@fujunwei fujunwei left a comment

Choose a reason for hiding this comment

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

LGTM with some comments.

src/webnn_native/WebnnNative.cpp Outdated Show resolved Hide resolved
src/webnn_native/xnnpack/GraphXNN.h Outdated Show resolved Hide resolved
@fujunwei
Copy link
Collaborator

LGTM, we can merge it when the CI is green.

@huningxin
Copy link
Collaborator Author

CI passed. I am going to merge it. Thanks for the review!

@huningxin huningxin merged commit c99145b into webmachinelearning:main Apr 22, 2022
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