-
Notifications
You must be signed in to change notification settings - Fork 3.4k
use WebGPU EP instead of JSEP in WebAssembly #24856
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
Conversation
3ae663c
to
2e67062
Compare
c59022b
to
414a928
Compare
TODO: resolve conflicts after #25022 is merged. |
both jsep and webgpu-ep builds for for me. |
@Honry could you please help to test/validate if this change breaks WebNN? This change is expected to have no behavior change for WebNN. Specifically:
Both should work for WebNN |
Sure, I will verify it with some demos. |
@fs-eire, both work! BTW, will we have a build specific for WebNN? e.g. |
Will not. This is the plan: currently both once we think the time is mature, we will use WebGPU EP in |
That make sense, thank you for the explanation! |
Description
This PR allows to use WebGPU EP in
onnxruntime-web
NPM package.Migration Plan
Currently, there are 2 different EPs implemented the WebGPU backend of onnxruntime-web. They are JSEP and WebGPU EP. The migration plan is to replace the JSEP with WebGPU EP and eventually remove the JSEP. The plan contains the following stages:
Package consumption changes
Default import (
import 'onnxruntime-web'
) and CPU only import (import 'onnxruntime-web/wasm'
) keeps their previous behaviors.WebGPU import (
import 'onnxruntime-web/webgpu'
) will now use WebGPU EP instead of JSEP. Previously it was the same as default import.WebGPU import will use a different suffix for the .mjs and .wasm name (which was
.jsep
):The suffix
.asyncify
is used as.jspi
is planned for future. They are 2 different ways of emscripten's async implementation (sync C++ function calls async JS function)