mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 11:56:45 +00:00
Fix a bug in the metal implemtation of col2im1d. (#2284)
This commit is contained in:
@ -848,7 +848,6 @@ impl BackendStorage for MetalStorage {
|
|||||||
.device
|
.device
|
||||||
.new_buffer(dst_el, self.dtype, "conv_transpose1d")?;
|
.new_buffer(dst_el, self.dtype, "conv_transpose1d")?;
|
||||||
|
|
||||||
let command_buffer = self.device.command_buffer()?;
|
|
||||||
let name = match self.dtype {
|
let name = match self.dtype {
|
||||||
DType::F32 => "col2im1d_f32",
|
DType::F32 => "col2im1d_f32",
|
||||||
DType::U32 => "col2im1d_u32",
|
DType::U32 => "col2im1d_u32",
|
||||||
@ -869,6 +868,12 @@ impl BackendStorage for MetalStorage {
|
|||||||
&kernel_l_mm,
|
&kernel_l_mm,
|
||||||
)?
|
)?
|
||||||
};
|
};
|
||||||
|
// It is important for the command buffer to be obtained *after* the matmul
|
||||||
|
// kernel has run, otherwise we might use a command-buffer that has been commited
|
||||||
|
// already resulting in the following error.
|
||||||
|
// _status < MTLCommandBufferStatusCommitted >
|
||||||
|
// -[IOGPUMetalCommandBuffer setCurrentCommandEncoder:]
|
||||||
|
let command_buffer = self.device.command_buffer()?;
|
||||||
candle_metal_kernels::call_col2im1d(
|
candle_metal_kernels::call_col2im1d(
|
||||||
&self.device.device,
|
&self.device.device,
|
||||||
&command_buffer,
|
&command_buffer,
|
||||||
|
Reference in New Issue
Block a user