-
Notifications
You must be signed in to change notification settings - Fork 149
fix(metal): gate bf16 support to Apple Silicon and fix bf16 literals #1207
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,9 +58,9 @@ mod tests_spirv { | |
| #[allow(unexpected_cfgs)] | ||
| mod tests_msl { | ||
| pub type TestRuntime = crate::WgpuRuntime; | ||
| use half::f16; | ||
| use half::{bf16, f16}; | ||
|
|
||
| cubecl_core::testgen_all!(f32: [f16, f32], i32: [i16, i32], u32: [u16, u32]); | ||
| cubecl_core::testgen_all!(f32: [bf16, f16, f32], i32: [i16, i32], u32: [u16, u32]); | ||
| cubecl_std::testgen!(); | ||
|
Comment on lines
60
to
72
|
||
| cubecl_std::testgen_tensor_identity!([f16, flex32, f32, u32]); | ||
| cubecl_std::testgen_quantized_view!(f16); | ||
|
|
||
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.
compile_instruction_rhypotalways emits1.0 / hypot(...). For f32 call sites this promotes the expression to double (and may rely on double support / implicit narrowing back to float), which is risky in MSL and can cause compilation failures. Use an f32 literal (1.0f) or otherwise respect the_elemparameter to choose the correct literal/cast for F32 vs F64.