Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.