-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement AbsKernelOp for WebGPU backend #896
Conversation
Ridiculous amount of warnings, and I'll probably clean up a lot of them, but the unused variables mostly have to do with the unimplemented kernels, I think |
Actually, I'll keep this a draft, I need to test it still. |
Also added tests for higher code coverage.
Hopefully I can figure out a way to remove it again.
Had to figure out a way to store zeros in place
though I won't be able to test that until I fix `mean`.
non-passthrough route. Can't get sum_to working until wgpu supports atomic operations. Which is super unfortunate. Maybe I'll work on that soon...
Weird magic number issue that I can't figure out...
So I went through several iterations of this.
Originally, I wanted to go with WGSL, since it's a language that was made for WebGPU specifically, but the issue I came across with it was that it doesn't have support for Then I replaced the code with GLSL, and had
For my fourth iteration through this, I got frustrated and decided, "Hey, this is rust! I should be using rust for these kernels." So I moved to So I went back to GLSL, and with the segfaults now fixed, I was able to power through and get it working how you see it now. Of course there is still a very strange problem with the So I'm going to be spending some time with a debugger and stepping through code to figure that out, but in the mean time, I have it working for the |
Have you tested this on backends besides Vulkan? AFAIK I feel a better approach is to just use WGSL, as it has the best support across |
Actually, I think wgpu just doesn't support atomics at all yet, that is why I went with passthrough. I can get behind WGSL, but it wouldn't support the preprocessor at all, so the code will have a lot of copied boilerplate, or we'd need to use templates of some sort. |
That's not the case; projects like
True. Bevy and Vello each have their own ad-hoc solutions for shader preprocessing, and I guess |
This also creates a broken, default implementation for all the other
UnaryKernel
s.