For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
conv2d_update_wo_tile
def conv2d_update_wo_tile[micro_kernel_height: Int, micro_kernel_width: Int, simd_size: Int, filter_packed: Bool, effected_by_padding: Bool, has_residual: Bool, last_c_tile: Bool, output_dt: DType, input_dt: DType, filter_dt: DType, elementwise_epilogue: Optional[def[rank: Int](coords: IndexList[rank], f_size: Int) capturing thin -> None] = None](output: Pointer[Scalar[output_dt], address_space=output.address_space, _safe=False], input: Pointer[Scalar[input_dt], address_space=input.address_space, _safe=False], filter: Pointer[Scalar[filter_dt], address_space=filter.address_space, _safe=False], first_c_tile: Bool, c_tile_size: Int, f_tile_offset: Int, f_tile_size: Int, conv_shape: ConvShape[Int(2)], n: Int, howo: IndexList[Int(2)])
Updates one micro tile of the 2D convolution output for a given (c, f) tile, accumulating over the R x S filter window and optionally applying an elementwise epilogue on the last C tile.
Parameters:
- βmicro_kernel_height (
Int): Number of output points along the WO dimension covered by the micro tile in register tiling. - βmicro_kernel_width (
Int): Number of SIMD registers assigned to the F dimension per output point. - βsimd_size (
Int): Number of elements in a SIMD register. - βfilter_packed (
Bool): True when the filter is prepacked inFRSCflayout for grouped convolution. - βeffected_by_padding (
Bool): True when the tile may touch padded input regions, requiring per-point bounds checks. - βhas_residual (
Bool): True when F is not a multiple ofsimd_size. The residual elements are loaded and padded with zero to fit a simd vector. - βlast_c_tile (
Bool): True when this is the last C tile, enabling the elementwise epilogue after accumulation. - βoutput_dt (
DType): Element type of the output tensor. - βinput_dt (
DType): Element type of the input tensor. - βfilter_dt (
DType): Element type of the filter tensor. - βelementwise_epilogue (
Optional[def[rank: Int](coords: IndexList[rank], f_size: Int) capturing thin -> None]): Optional elementwise function applied to the output after the last channel tile (defaults toNone).
Args:
- βoutput (
Pointer[Scalar[output_dt], address_space=output.address_space, _safe=False]): Pointer to the start of the output micro tile at(n, howo[0], howo[1], f_tile_offset). - βinput (
Pointer[Scalar[input_dt], address_space=input.address_space, _safe=False]): Pointer to the first input element of the micro tile before padding adjustment. - βfilter (
Pointer[Scalar[filter_dt], address_space=filter.address_space, _safe=False]): Pointer to the first filter coefficient in the filter window for the current(c, f)tile. - βfirst_c_tile (
Bool): True when this is the first C tile, zero-initializing the accumulator instead of loading from the output. - βc_tile_size (
Int): Number of input channels in the current C tile. - βf_tile_offset (
Int): Offset of the current tile along the F (output channel) dimension. - βf_tile_size (
Int): Number of output channels in the current F tile. - βconv_shape (
ConvShape[Int(2)]): Convolution dimension description for the 2D convolution. - βn (
Int): Batch index of the current input image. - βhowo (
IndexList[Int(2)]): Output spatial coordinates(ho, wo)of the tile's first output point, with the micro tile spanningmicro_kernel_heightconsecutivewovalues starting athowo[1].
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!