-
Notifications
You must be signed in to change notification settings - Fork 491
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
Clean up -jit suffix in feature flags and modules #2705
Conversation
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.
Nice!
Tested on the AMD runner.
You can update the commented tests in burn-hip/src/lib.rs
to match the CUDA ones. I did not execute them all, I just verified that there was no compilation issues. Keep them commented.
mod tests {
use burn_jit::JitBackend;
pub type TestRuntime = cubecl::hip::HipRuntime;
pub use half::f16;
burn_jit::testgen_all!([f16, f32], [i8, i16, i32, i64], [u8, u32]);
}
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2705 +/- ##
=======================================
Coverage 83.91% 83.91%
=======================================
Files 821 821
Lines 106890 106890
=======================================
Hits 89702 89702
Misses 17188 17188 ☔ View full report in Codecov by Sentry. |
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.
I think we should create a type alias for vulkan.
pub type Vulkan = Wgpu<Compiler = Spirv>;
Also, I would keep a feature flag spirv
in burn_wgpu
, so that users can customize the compiler used for Wgpu
without using the type alias.
Also, the Wgpu
backend should not have a default compiler, I think. We could create a WebGPU
type alias like Vulkan
with the default compiler being Wgsl
.
So, we can have a hierarchy of types, where we don't compromise on flexibility but make it clearer for Burn
users.
New feature flags:
vulkan = ["burn_wgpu", "spirv"]
webgpu = ["burn_wgpu", "burn_wgpu/wgsl"]
wgpu = ["burn_wgpu"]
We have to make it clear that the Wgpu
backend is decoupled from the compiler; users can create their own feature flag to choose the compiler if they want it to change depending on the platform. We could (and probably should) create a composed compiler that will become the default Wgpu
compiler, where each compiler feature flag activates a new compiler option to be determined at runtime. However, for now, we can't do that just yet, and users won't have the best performance by default because of that, and it's not clear how to do that right now.
Also, having the possibility to just have one compiler activated will always be a good option to reduce binary size and ease deployment.
@nathanielsimard Just made the suggested changes, though I kept the default compiler to wgsl for now to keep compatibility with the current |
Checklist
run-checks all
script has been executed.Changes
Feature flags:
"cuda-jit"
->"cuda"
"hip-jit"
->"hip"
"wgpu-spirv"
->"vulkan"
(forburn
andburn-core
, which enablesburn-wgpu/spirv
)Modules:
burn::backend::cuda_jit
->burn::backend::cuda
burn::backend::hip_jit
->burn::backend::hip
Backends:
CudaJit
->Cuda
HipJit
->Hip