microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.78k stars 2.94k forks source link

[js/web] update default export to include webgpu #22754

Open fs-eire opened 2 weeks ago

fs-eire commented 2 weeks ago

Description

This PR changes the following exports:

Migration instructions:

Export table

file name export entry includes WASM includes JSEP (WebGPU & WebNN) includes WebGL
ort.all.min.js
ort.all.js
ort.all.min.mjs
ort.all.mjs
onnxruntime-web/all ✔️ ✔️ ✔️
ort.min.js
ort.js
ort.min.mjs
ort.mjs
onnxruntime-web ✔️ ❌ --> ✔️ ✔️ -->❌
ort.webgpu.min.js
ort.webgpu.js
ort.webgpu.min.mjs
ort.webgpu.mjs
onnxruntime-web/webgpu ✔️ ✔️
ort.wasm.min.js
ort.wasm.js
ort.wasm.min.mjs
ort.wasm.mjs
onnxruntime-web/wasm ✔️
gyagp commented 2 weeks ago

Per my understanding, onnxruntime-web is more like the default one, while onnxruntime-web/ are for specific usages. Can we leave onnxruntime-web/webgpu as is (for symmetry), and have onnxruntime-web (without /) map to the files for onnxruntime-web/webgpu (ort.webgpu.*)? Furthermore, can we rename onnxruntime-web to onnxruntime, as we already know it will be used on the web. This could be another breaking change.

fs-eire commented 2 weeks ago

Per my understanding, onnxruntime-web is more like the default one, while onnxruntime-web/* are for specific usages. Can we leave onnxruntime-web/webgpu as is (for symmetry), and have onnxruntime-web (without /) map to the files for onnxruntime-web/webgpu (ort.webgpu.)? Furthermore, can we rename onnxruntime-web to onnxruntime, as we already know it will be used on the web. This could be another breaking change.

One reason that I want to deprecate ort.webgpu.min.js is because it is actually JSEP, not webgpu. JSEP build contains webgpu and webnn and is based on wasm. "onnxruntime-web/webgpu" will be kept in a few version anyway so we can decide whether to remove it or not then