[WIP] migrate WebGPU EP to WebAssembly to replace JSEP #23697
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR includes the changes that helps development/troubleshooting of the migration. Those changes are not supposed to be merged.
Migration Plan
STEP.1: enable WebGPU EP in WebAssembly build
enable WebGPU EP in WebAssembly build #23913
STEP.2: feature/perf parity
STEP.3: switch from JSEP to WebGPU EP
Important development/debug guide
Currently, this PR includes the following changes:
ort.bundle.mjsinstead ofort.bundle.min.js. this is much easier to debug in browser.globalThis["WEBGPU_EP"]to1to use a WebGPU EP implementation.globalThis["WEBGPU_STAT"]to1.Example:
How to build:
build_jsep.batwithbuild_webgpu.bat.the build will generates web assembly file that contains both JSEP and WebGPU EP. this helps testing because wasm build usually takes very long to complete.npm test -- ... npm run build npm pack--no-webgpu-ep:npm test --no-webgpu-ep -- ... npm run build --no-webgpu-ep npm pack --no-webgpu-epknown test failures
Those test cases need to be fixed: