Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Implementing the API (WebONNX) for doing inference on ONNX-serialized models on platform-available accelerators #367

Closed
KOLANICH opened this issue Jun 3, 2022 · 4 comments

Comments

@KOLANICH
Copy link

KOLANICH commented Jun 3, 2022

The idea is to implement a WebExtensions experiment that

  • discovers the native libs for ML inference, available in the system, such as platform-provided frameworks like WinML, TF Lite, and Core ML, libs installed from packages, like onnxruntimelatest packaged version(s) (contains M$ telemetry!), libonnxlatest packaged version(s) and maybe even ONNX-mlir + LLVM 15
  • binds to native libs available in the system
  • provides WebExtensions with the API to infer models

More info: open-source-ideas/ideas#69

@KOLANICH
Copy link
Author

KOLANICH commented Jun 3, 2022

The API should be designed so that almost exactly (but maybe under a different namespace, for example in webexts browser.onnx and in webpages as navigator.onnx) the same API could be exposed to web pages (allowing to use almost exactly the same code for them as within webexts).

@kpu
Copy link
Contributor

kpu commented Jun 3, 2022

You're absolutely right that native is faster. In fact the current WASM implementation is 10x slower than a proper native implementation, which could run in a sandbox. And that speed could also have been used to deliver better translation quality.

speed

We're developing a native messaging extension here: https://github.com/jelmervdl/firefox-translations though it's still WIP.

Have you spoken to the Web Machine Learning group at W3C? https://www.w3.org/blog/2021/04/w3c-launches-the-web-machine-learning-working-group/ Their timeline was too long for us to use it.

@KOLANICH
Copy link
Author

KOLANICH commented Jun 3, 2022

Have you spoken to the Web Machine Learning group at W3C?

No, but I guess I should. Thank you for mentioning it.

@marco-c
Copy link
Contributor

marco-c commented Jul 11, 2023

We are not going to make any improvements or fixes to the addon since we are now focusing on the built-in version.
Once some API along these lines is available in Firefox, we'll try to make use of it to speed up model inference.

@marco-c marco-c closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants