tracel-ai / burn

Burn is a new comprehensive dynamic Deep Learning Framework built using Rust with extreme flexibility, compute efficiency and portability as its primary goals.
https://burn.dev
Apache License 2.0
8.54k stars 421 forks source link

"condvar wait not supported" in wasm-bindgen tests in browser with WebGPU backend #1922

Open MaximilianAzendorf opened 3 months ago

MaximilianAzendorf commented 3 months ago

Describe the bug When using burn (e.g. calling Tensor::from_data) with the WebGPU backend inside a wasm-bindgen test running on a chrome, it fails with an exception with the message "condor wait not supported".

To Reproduce See this repository containing a minimal reproduction of this behavior.

Expected behavior As far as I am aware, burn and the WebGPU backend support running in the browser. I therefore would expect that it is possible to use burn inside wasm-bindgen tests in a browser. If this is indeed not supported, I think that the documentation is insufficient in regards to which backend supports which platform.

Desktop (please complete the following information):

nathanielsimard commented 3 months ago

@MaximilianAzendorf I think on wasm you got to initialize the wgpu runtime manually using https://github.com/tracel-ai/burn/blob/3faf544bc417c70a33eaa6a636c9c21a563fcb63/crates/burn-wgpu/src/runtime.rs#L131