-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Web] WebAssembly memory is not detachable for Web Worker #19157
Comments
cc / @fs-eire |
Let me check if I can fix this. |
@Honry I made this fix which should allow proxy loading larger models. However, I am thinking of deprecating proxy worker support in future. The feature will not be removed. It will be there, but will only support CPU and no longer to support new features. Some features (eg. IO-Binding) are difficult to implement using proxy worker. For example, in WebGPU, you cannot create a GPUBuffer in main thread because it requires a ort-web already support being loaded in a worker via |
@fs-eire, thanks for your detailed explanation, that make sense, I will try to enable WebNN async API firstly and hope there's no performance regression. |
### Description allow proxy to load model with 1GB <= size < 2GB resolves #19157.
### Description allow proxy to load model with 1GB <= size < 2GB resolves #19157.
…19178) ### Description allow proxy to load model with 1GB <= size < 2GB resolves microsoft#19157.
Describe the issue
Issue introduced in 07cfc56#diff-66aa0acafe57e6847abcda96de26b731b3e32e44cd825f3a50c6afbe5ff3985eR52, for model with size > 1G, it uses WebAssembly Memory to allocate larger ArrayBuffer, such memory is not detachable and could not be transferred to Worker thread. Error will be threw from https://github.com/microsoft/onnxruntime/blob/main/js/web/lib/wasm/proxy-wrapper.ts#L140.
To reproduce
Error:
TypeError: Failed to execute 'postMessage' on 'Worker': ArrayBuffer at index 0 is not detachable and could not be transferred.
Urgency
No response
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
07cfc56
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered: