Skip to content

Commit

Permalink
Add documentation for custom cubecl kernels, update some outdated d…
Browse files Browse the repository at this point in the history
…ocs (#2404)
  • Loading branch information
wingertge authored Oct 25, 2024
1 parent fe86c10 commit d5e8e31
Show file tree
Hide file tree
Showing 15 changed files with 874 additions and 55 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions burn-book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [Quantization (Beta)](./quantization.md)
- [Advanced](./advanced/README.md)
- [Backend Extension](./advanced/backend-extension/README.md)
- [Custom `cubecl` Kernel](./advanced/backend-extension/custom-cubecl-kernel.md)
- [Custom WGPU Kernel](./advanced/backend-extension/custom-wgpu-kernel.md)
- [Custom Optimizer]()
- [WebAssembly]()
Expand Down
12 changes: 7 additions & 5 deletions burn-book/src/advanced/backend-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ impression that Burn operates at a high level over the backend layer. However, m
explicit instead of being chosen via a compilation flag was a thoughtful design decision. This
explicitness does not imply that all backends must be identical; rather, it offers a great deal of
flexibility when composing backends. The autodifferentiation backend trait (see
[autodiff section](../../building-blocks/autodiff.md)) is an example of how the backend trait has been
extended to enable gradient computation with backpropagation. Furthermore, this design allows you to
create your own backend extension. To achieve this, you need to design your own backend trait
[autodiff section](../../building-blocks/autodiff.md)) is an example of how the backend trait has
been extended to enable gradient computation with backpropagation. Furthermore, this design allows
you to create your own backend extension. To achieve this, you need to design your own backend trait
specifying which functions should be supported.

```rust, ignore
Expand Down Expand Up @@ -76,5 +76,7 @@ impl<E: TchElement> Backend for burn_autodiff::Autodiff<burn_tch::LibTorch<E>> {
}
```

The specificity of each implementation will be covered by the examples provided in this section.
Currently, we only have one example, but more are yet to come!
The specifics of each implementation will be covered by the examples provided in this section. The
`cubecl` compiler frontend is the recommended method of implementing custom kernels, since it
supports multiple backends, including `wgpu` and `CUDA`, and is the way first-party `burn` kernels
are written.
Loading

0 comments on commit d5e8e31

Please sign in to comment.