Extend supported dtypes for metal (im2col & upsample_2d) (#1938)

* update im2col dtype implementations

* update dtypes for upsample
This commit is contained in:
Thomas Santerre
2024-03-26 01:48:56 -04:00
committed by GitHub
parent 196765e995
commit f5dfe883d7
2 changed files with 16 additions and 0 deletions

View File

@ -1038,6 +1038,10 @@ impl BackendStorage for MetalStorage {
let command_buffer = self.device.command_buffer()?;
let name = match self.dtype {
DType::F32 => "im2col_f32",
DType::F16 => "im2col_f16",
DType::BF16 => "im2col_bf16",
DType::U8 => "im2col_u8",
DType::U32 => "im2col_u32",
dtype => crate::bail!("Metal conv2d {dtype:?} not implemented"),
};
candle_metal_kernels::call_im2col_strided(
@ -1250,6 +1254,10 @@ impl BackendStorage for MetalStorage {
}
let name = match self.dtype {
DType::F32 => "upsample_nearest2d_f32",
DType::F16 => "upsample_nearest2d_f16",
DType::BF16 => "upsample_nearest2d_bf16",
DType::U8 => "upsample_nearest2d_u8",
DType::U32 => "upsample_nearest2d_u32",
dtype => crate::bail!("Metal upsample_nearest2d {dtype:?} not implemented"),
};