webmachinelearning / webnn

🧠 Web Neural Network API
https://www.w3.org/TR/webnn/
Other
369 stars 46 forks source link

WebNN native implementation #129

Closed huningxin closed 3 years ago

huningxin commented 3 years ago

As the architecture diagram of WebNN explainer illustrates, WebNN highly relies on native ML APIs for hardware acceleration. There have been many design discussions within the CG are about the native ML API compatibility and performance. However, there is a lack of a good tool that could help the participants understand and evaluate different options in this important design space.

So, I propose to add a standalone native implementation of the WebNN API spec called webnn-native that complements the JavaScript implementation webnn-polyfill. Both the implementations would help inform the API spec development, validate implementability atop native APIs and provide a performance benchmark.

Essentially, webnn-native could expose a header file (e.g. webnn.h) that is generated by WebNN spec and include multiple native ML API backends, such as DirectML, NNAPI, ML Compute and OpenVINO mentioned in the explainer. The webnn.h could also help the coordination with WebAssembly group that is included by CG charter.

jbingham commented 3 years ago

@huningxin SGTM. Since this would be a standalone implementation, it sounds like it would be useful for development and benchmarking.

huningxin commented 3 years ago

@jbingham @wchao1115 , thanks for your positive feedbacks.

I'd propose to create a repo under https://github.com/webmachinelearning/webnn-native to host the development. @anssiko

anssiko commented 3 years ago

Per our resolution on WebML CG Teleconference – 21 January 2021, I created the following GH repo for the webnn-native project: https://github.com/webmachinelearning/webnn-native

anssiko commented 3 years ago

@huningxin once the initial webnn-native PR is available for review, please link it here and close this issue.

huningxin commented 3 years ago

https://github.com/webmachinelearning/webnn-native/pull/1