CharlieFRuan opened a new pull request, #17005: URL: https://github.com/apache/tvm/pull/17005
Prior to this PR, WebGPU errors such as OOM are only logged as a warning without affecting the program. This PR handles WebGPU error using `pushErrorScope()` and `popErrorScope()` following https://github.com/gpuweb/gpuweb/blob/main/design/ErrorHandling.md. We replace `createBuffer()` with `tryCreateBuffer()`, in which we catch all three types of errors. For now, we treat any error occurred in `createBuffer()` fatal and hence do `device.destroy()`. When a device is initiated, we use `device.lost.then()` to listen to the event of `device.destroy()`, upon which we log the error and call `Instance.dispose()`, prompting the user to re-initialize. See https://github.com/mlc-ai/web-llm/issues/356 for motivation. Tested end-to-end with WebLLM. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
