-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #585
base: master
Are you sure you want to change the base?
Webgpu backend #585
Conversation
Great - very useful! This is exactly what we need to get us started. |
Not sure if it's useful, but I just found this today: https://github.com/cryscan/web-rwkv So it's in Rust, but it's based on WebGPU. Also there are a bunch of WGSL files for stuff like matmul, softmax, SiLU etc in there: https://github.com/cryscan/web-rwkv/tree/main/src/shaders Has a compatible license as well. |
Any update on merging this or a guidance to contribute? |
Hi all,
I have whipped up a very quick and dirty webgpu backend for ggml. This is by no means ready for merging, it's been written in a day, supports only silu operation, and has a lot of extra files and questions around how to do things properly.
The implementation is copy/pasted from the Metal backend and adjusted.
Note - working on native with Mozilla's wgpu lib, not even tested on emscripten target, and might have issues on Chrome's Dawn.
@ggerganov I wanted to drop it here, if anyone wants to take over, as I'll be quite busy and plan to get back to it in a few months.
The branch doesn't have anything you need to make it run, here's an example repo that runs a working example:
https://github.com/audiovention/webgpu-ggml
The repo contains precompiled wgpu libs for Win/Linux/macos downloaded from https://eliemichel.github.io/LearnWebGPU/getting-started/hello-webgpu.html
The impl is mostly based on the example here:
https://github.com/gfx-rs/wgpu-native/blob/trunk/examples/compute/main.c#L28
Also I've copied a couple of source files from that repo, which currently take care of loading the shader, they can be easily removed.
Things that need to be addressed:
I'm open to answer any questions with my limited webgpu experience, and as I said I'll be happy if someone takes over.