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

[WebNN-native/Node] support context-based compute graph. #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

miaobin
Copy link
Contributor

@miaobin miaobin commented Jul 14, 2022

Move synchronous and asynchronous compute methods from MLGraph to MLContext and rename the methods to MLContext.computeSync and MLContext.compute.

  • Modified webnn.json and webnn_wire.json to sync with the latest spec.
  • Retained the ComputeImpl() method under the GraphBase class and made it as a public member.
  • Retained the overrides of the compute implementation in the Graph classes of each backend.
  • The context-based compute is implemented by calling the ComputeImpl() method of the GraphBase class.
  • Modified the test cases and nodejs binding.

BTW, CI may be blocked, because the PR in the polyfill has not been merged.
@fujunwei @mingmingtasd PTAL, I can optimize the code here firstly.

node/src/Context.cpp Outdated Show resolved Hide resolved
src/webnn/native/dml/ContextDML.h Outdated Show resolved Hide resolved
@miaobin miaobin force-pushed the context-build-compute branch 2 times, most recently from 320e789 to 38bb77b Compare July 18, 2022 07:42
@miaobin
Copy link
Contributor Author

miaobin commented Jul 18, 2022

Fixed issues related to Wire, @fujunwei @mingmingtasd PTAL, Thanks.

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