Skip to content
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

WebGPU Backend #122

Open
3 tasks
bwasti opened this issue Nov 20, 2022 · 2 comments
Open
3 tasks

WebGPU Backend #122

bwasti opened this issue Nov 20, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bwasti
Copy link
Contributor

bwasti commented Nov 20, 2022

This will enable browser support. We'll need to shim some files:

  • io
  • network
  • tensor/ffi

It doesn't make sense to support anything besides WebGPU at this point. WASM + SIMD is around 15-20x slower on my machine[1]. Although WebGL is more widely supported today, it doesn't have the compute features needed for efficient modern ML (transformers etc) and will likely be a deprecated backend for other frameworks when WebGPU comes online.

[1]: In chrome canary, with Unsafe webGPU enabled try models here: https://tensorflow.github.io/tfjs/e2e/benchmarks/local-benchmark/index.html

@bwasti bwasti added enhancement New feature or request help wanted Extra attention is needed labels Nov 20, 2022
@bwasti bwasti self-assigned this Nov 20, 2022
@josephrocca
Copy link

This is exciting! A cool side effect is that this will add Deno support, since Deno supports WebGPU (since v1.8) just like the browser. I guess it may make sense to eventually support Deno via FFI too as their FFI performance catches up to Bun, but even if it does get added, WebGPU has its own set of advantages (safety, isomorphism, etc.), so it may even be preferred over FFI in some circumstances despite having somewhat lower performance.

Looks like WebGPU support may actually land (in Chromium, at least) early/mid next year - looking forward to having a play around with this and building some demos/benchmarks/etc when it does.

@julien-blanchon
Copy link

julien-blanchon commented Jan 28, 2024

I'd love to see that happen, @bwasti are you still working on Shumai?

Maybe brr.js 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants