Skip to main content

conv2d_backward_dw

Function conv2d_backward_dw 

Source
pub fn conv2d_backward_dw<T: Triton, D: Num, const KH: i32, const KW: i32, const STRIDE_H: i32, const STRIDE_W: i32, const PAD_H: i32, const PAD_W: i32, const G: i32, const BLOCK_OW: i32>(
    dy_ptr: T::Pointer<D>,
    x_ptr: T::Pointer<D>,
    dw_ptr: T::Pointer<D>,
    _B: i32,
    C_IN: i32,
    C_OUT: i32,
    H: i32,
    W: i32,
    OH: i32,
    OW: i32,
)
where T::I32Tensor: Tensor<i32, 1> + Comparison<i32, BoolTensor = T::BoolTensor>, T::BoolTensor: BitAnd<Output = T::BoolTensor>, T::Pointer<D>: AddOffsets<i32, 1, T::I32Tensor, Output = T::Tensor<T::Pointer<D>>>,
Expand description

2-D convolution backward pass — gradient with respect to weights (dw).

Uses the same grid as the forward pass. Each CTA at (b, c_out, oh, ow_tile) accumulates partial sums into dw via atomic_add (one per (c_in_local, kh, kw) combination within the group).

G — number of groups. Weight layout: [C_OUT, C_IN/G, KH, KW]. Grid: pid = ((b * C_OUT + c_out) * OH + oh) * num_ow_tiles + ow_tile

dw must be zero-initialised before launch.