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

started the burn developer book #1184

Merged
merged 33 commits into from
Feb 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
260f93b
started the burn developer book
skewballfox Jan 26, 2024
d9a637f
forgot to enable mathjax for mdbook
skewballfox Jan 26, 2024
8fc11bb
copied the contents of architecture.md, and fleshing things out
skewballfox Jan 26, 2024
c1b4dae
fixed issue with inline mathjax
skewballfox Jan 26, 2024
e2738a8
fixed typos, added instructions
skewballfox Jan 26, 2024
79c29c6
updating info on tensorops, fixing typos
skewballfox Jan 27, 2024
cc93bab
added test for powf, fixed typos, updated index, etc
skewballfox Jan 27, 2024
fb64d11
fixed issue with burn-wgpu 0^0
skewballfox Jan 28, 2024
bcc232e
formatting
skewballfox Jan 28, 2024
227a5ea
updated section for adding ops to wgpu
skewballfox Jan 28, 2024
9ea4498
changed powf_scalar to powf_primitive for wgpu code
skewballfox Jan 29, 2024
15c0212
Update contributor-book/src/getting-started/testing.md
skewballfox Jan 29, 2024
f408eff
Update contributor-book/src/guides/adding-a-new-operation-to-burn.md
skewballfox Jan 29, 2024
b4f84d0
Update contributor-book/src/guides/adding-a-new-operation-to-burn.md
skewballfox Jan 29, 2024
151f444
Update contributor-book/src/getting-started/testing.md
skewballfox Jan 29, 2024
8c67766
Update contributor-book/src/getting-started/testing.md
skewballfox Jan 29, 2024
b312607
Update contributor-book/src/getting-started/setting-up-the-environmen…
skewballfox Jan 29, 2024
5ac299a
implementeds suggestions by @syl20bnr
skewballfox Jan 29, 2024
c4ee85b
fixed typography
skewballfox Jan 29, 2024
f63a79d
Apply suggestions from code review
skewballfox Jan 29, 2024
07db8ad
fixed typos, and incorrect rendering of footnotes
skewballfox Jan 29, 2024
1f89007
Format the text using prettier
antimora Jan 31, 2024
20057bf
implemented suggestions
skewballfox Jan 31, 2024
f0ba1d2
implemented suggestion
skewballfox Jan 31, 2024
418a08a
Merge branch 'main' into contributor-book
skewballfox Feb 1, 2024
3ea3219
updated testing autodiff section
skewballfox Feb 1, 2024
2739781
fixed typo
skewballfox Feb 1, 2024
5d06209
Apply suggestions from code review
skewballfox Feb 2, 2024
726d232
fixes related to code review
skewballfox Feb 2, 2024
e9ee469
added links to discord server
skewballfox Feb 2, 2024
c1f6304
fixed a typo in the book xtask and implemented changes from code review
skewballfox Feb 2, 2024
b3e84ef
implemented suggestions from code reviews
skewballfox Feb 2, 2024
6d9c783
implemented suggestions from code review
skewballfox Feb 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated section for adding ops to wgpu
  • Loading branch information
skewballfox committed Jan 28, 2024
commit 227a5ea03c8d0bca4e69e2cdc8b2ddce5c76f223
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ here is where code was added

1. to the implementation of [`TensorOps` under `burn-wgpu/src/ops/float_ops.rs`](https://github.com/tracel-ai/burn/blob/0368409eb3a7beaeda598c0c8ce1dc0c2c8c07cc/burn-wgpu/src/ops/float_ops.rs#L513)
2. the function being called was added to [burn-wgpu/src/ops/numeric.rs](https://github.com/tracel-ai/burn/blob/0368409eb3a7beaeda598c0c8ce1dc0c2c8c07cc/burn-wgpu/src/ops/numeric.rs#L199)
3. the call to the fmt function use to generate wgsl code in [`burn-wgpu/src/codegen/kernel.rs`](https://github.com/tracel-ai/burn/blob/main/burn-wgpu/src/codegen/kernel.rs#L208)
4. A custom function generator was added to [`burn-wgpu/src/codegen/function.rs`](https://github.com/tracel-ai/burn/blob/main/burn-wgpu/src/codegen/function.rs#L99)

There would have been a few other places additions would be necessary if some of the code for powf hadn't already been defined, such as [`burn-wgpu/src/fusion/elemwise/builder.rs`](https://github.com/tracel-ai/burn/blob/main/burn-wgpu/src/fusion/elemwise/optimization.rs) and [`burn-wgpu/src/fusion/elemwise/builder.rs`](https://github.com/tracel-ai/burn/blob/0368409eb3a7beaeda598c0c8ce1dc0c2c8c07cc/burn-wgpu/src/fusion/elemwise/builder.rs#L276), but I don't know if there are other places within `burn-wgpu` where additions would be necessary.
Much of the logic for powf had already been defined, so not much needed to be added. The reason for the custom powf function is generated, rather than directly using the underlying function as is the case with other operations, is due to issues with case handling of the wgsl pow function, like 0 to the 0 power being 1, and any negative number to an even power being positive. We reused as much as the existing logic as possible, such as the operation output description generation in [`burn-wgpu/src/fusion/elemwise/builder.rs`](https://github.com/tracel-ai/burn/blob/main/burn-wgpu/src/fusion/elemwise/optimization.rs) and then branched at the last point based off the var type of the rhs. I don't know if there are other places within `burn-wgpu` where additions would have been necessary otherwise.

## Adding the Op to burn-import

Expand Down
Loading