microsoft / microsoft/onnxruntime
[Web] WebGL backend freezes the main thread (`ort.env.webgl.proxy=true` has no effect)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### Describe the issue
This is a feature request for something like `ort.env.webgl.proxy=true` to prevent the main thread from freezing during inference.
IIUC, using WebGL in Web Workers requires `OffscreenCanvas`, which is available in all browsers except Safari (though it is available in their technical preview, so I'm assuming it'll be in the next major version).
### To reproduce
To reproduce the lag, visit this URL: https://josephrocca.github.io/rwkv-v4-web/demo/ and click "load" on the `rwkv-4-pile-430m-webgl.onnx` row.
### Urgency
Not super urgent, but WebGL is basically unusable for me until this is resolved.
### ONNX Runtime Installation
Released Package
### ONNX Runtime Version or Commit ID
1.14.0
### Execution Provider
WebGL
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the freeze at the linked RWKV demo using the WebGL model, then investigate the WebGL backend and the `ort.env.webgl.proxy=true` behavior. The issue is complete when WebGL inference can run without freezing the main thread, including in browsers supporting `OffscreenCanvas`, while the Safari limitation is understood.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- machine-learning, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100