-
Notifications
You must be signed in to change notification settings - Fork 37
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
Reimplement macro to make writing kernels more ergonomic #80
Conversation
… the same signature
…e variables in `Binary` and `Unary ops.
All tests passing including frontend tests, actually ready for merge now |
Something in burn seems to be miscompiling, going back to draft until I can figure out what's going on |
All burn tests are passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, definitively a big improvement!
cubecl-core = { path = "../cubecl-core", version = "0.2", default-features = false } | ||
cubecl-cuda = { path = "../cubecl-cuda", version = "0.2", default-features = false } | ||
cubecl-linalg = { path = "../cubecl-linalg", version = "0.2", default-features = false } | ||
cubecl-wgpu = { path = "../cubecl-wgpu", version = "0.2", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are they needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the codegen comparison tests. Could move them but I put them here because they're testing the macro, not the backends in question. Or maybe just use the testgen macro thing.
…ure compiler intrinsics
This is a rewrite of the frontend macro to make writing kernels more ergonomic and "rust-like".
It replaces the
Comptime
struct with a#[comptime]
attribute so values can be used like any other Rust constant.Loops now use normal ranges and allow unrolling via
#[unroll]
rather than a verborse comptime parameter that is often set to a literal anyways. For conditional unrolling, the attribute supports inserting an expression:#[unroll(should_unroll)]
.The custom vectorized types are replaced with Rust primitives since vectorization has always been stored in the IR anyways. The vectorization field on the custom types was almost entirely redundant.
Adds support for struct destructuring in locals.
Folding of comptime values into literals has also been improved.
Testing
All unit and integration tests (including frontend tests) are passing. Several backend codegen tests are also added.
All burn tests are passing.