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

Implement Webgpu device #893

Merged
merged 11 commits into from
Dec 3, 2023
Merged

Implement Webgpu device #893

merged 11 commits into from
Dec 3, 2023

Conversation

favilo
Copy link
Contributor

@favilo favilo commented Nov 27, 2023

Tried an initial implementation for #604

Based on the tasks from #597

  1. Add webgpu feature flag

  2. Create an Webgpu device struct under src/tensor/webgpu/device.rs & add impl DeviceStorage for WebGpu

  3. Implement tensor allocation methods under src/tensor/webgpu/allocate.rs. See src/tensor/cuda/allocate.rs for examples

    1. impl ZerosTensor
    2. impl OnesTensor
    3. impl OneFillStorage
    4. impl SampleTensor
    5. impl CopySlice
    6. impl TensorFromVec
    7. impl TensorToArray
  4. Implement skeleton kernels for Webgpu under tensor_ops - tests should compile & run but fail

    1. Add module webgpu.rs to all kernel folders
    2. Add a skeleton impl for all kernels (put todo!() in every kernel method)
    3. add impl Device<E> for Webgpu to src/tensor_ops/utilities/device.rs
  5. Actually implement OpenCL kernels - this is highly parallelizable, each tensor op can be worked on separately. Every tensor op with a folder will need a kernel

@coreylowman
Copy link
Owner

@favilo this is AWESOME!! I'm thinking we can merge this into main without actually implementing any of the kernels here, and then people can start adding them if they want. Does that sound good, or did you have plans to add more to this PR?

@favilo
Copy link
Contributor Author

favilo commented Dec 2, 2023

I'm good with that, or you can make a new branch and we can add to that one. I figured we'd want to start adding kernels in other PRs mostly because I'm not entirely sure where to start with them.

So I'm pretty much done with this particular code.

@favilo
Copy link
Contributor Author

favilo commented Dec 2, 2023

Rebased onto main, again.

@coreylowman coreylowman merged commit dda8daa into coreylowman:main Dec 3, 2023
4 checks passed
@coreylowman
Copy link
Owner

@favilo 🎉🎉🎉

@favilo favilo deleted the webgpu branch December 3, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants