Autogen webgpu dawn, removing wgpu-py dependency (f16 support part 1) - #8646
Conversation
8218e32 to
172d3bf
Compare
|
I'm worried about the long term maintenance of "dawn-python", is it possible to do this with a ctypes autogen script and put this in the tinygrad repo instead? It looks like it's doing this in the dawn-python package already. We're moving all the backends away from having Python deps. |
|
@geohot Yeah, i created dawn-python using clang2py, which we use for autogen, i can move it into the tinygrad repo. I think it's fine to grab the underlying prebuilt binaries from my repo though. (dawn.so, dawn.dylib) |
|
Yea, I'm fine with grabbing the bins from a GitHub release (like remu or ocelot) |
|
Progress on adding dawn bindings to autogen? |
172d3bf to
e9c463c
Compare
|
@geohot I moved dawn-python stuff to tinygrad autogen, I have all tests passing locally on my Mac, but have to clean it up and make it pass in CI. |
45586a9 to
585e21e
Compare
|
I don't think there should be a support for this. Why can't it go in the webgpu file? |
6df1b50 to
f7ca268
Compare
Everything is passing, except for the line limit test. |
6dd568c to
b3836d7
Compare
|
|
||
| if wait: webgpu.wgpuCommandEncoderResolveQuerySet(command_encoder, query_set, 0, 2, query_buf, 0) | ||
|
|
||
| cmd_buf = webgpu.wgpuCommandEncoderFinish(command_encoder, webgpu.WGPUCommandBufferDescriptor()) |
|
|
||
| def cb(status, compute_pipeline_impl, msg, u1, u2): pipeline_result[:] = status, compute_pipeline_impl, from_wgpu_str(msg) | ||
|
|
||
| cb_info = create_cb_info(webgpu.WGPUCreateComputePipelineAsyncCallbackInfo2, webgpu.WGPUCreateComputePipelineAsyncCallback2, cb) |
There was a problem hiding this comment.
Why is this a variable? (multiple places)
There was a problem hiding this comment.
It consistently segfaults if it's not saved into a variable before passing it in.
c2ad6e8 to
d26440a
Compare
d26440a to
0aa47c8
Compare
Changes |
|
Bumped the line limit to merge this, really happy to have that wgpu dep gone. |
Hello, just checking in here as one of the maintainers of wgpu-py, would any of you mind summarizing your reasons to move away from our library? Anything we could do better? Thanks! cc @almarklein |
|
@Korijn |

This PR changes the WebGPU runtime used from
wgputoDawn(used by Chrome):wgpuis not closely following the WebGPU specs, it doesn't impose a limit on storage buffers per kernel, but Dawn does, so some tests had to be skipped due to more than the supported number of buffers per kerneldawn-python(supports both Mac (Metal), and Linux (Vulkan)Here is a demo of
f16stable diffusion deployed from another branch that includes thef16support: https://wpmed92.github.io/stable-diffusion-tinygrad-f16/I see around 30% perf gain from
f16in SD.The
f16wgslchange is coming in a follow-up PR, I didn't want to put these two relatively big changes into 1 PR.