IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

dispatch_amd_4wave_conv2d

def dispatch_amd_4wave_conv2d[input_type: DType, filter_type: DType, output_type: DType, filter_is_fcrs: Bool, has_residual: Bool = False, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None] = None](input: TileTensor[input_type, Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type], filter: TileTensor[filter_type, Storage=filter.Storage, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type], output: TileTensor[output_type, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], stride: IndexList[Int(2)], dilation: IndexList[Int(2)], symmetric_padding: IndexList[Int(2)], num_groups: Int, ctx: DeviceContext, source_ptr: Optional[Pointer[Scalar[output_type], MutAnyOrigin, _safe=False]] = None, beta: Float32 = 0) -> Bool

Try to dispatch a Conv2D to amd_4wave_conv on MI355X.

Returns True if the convolution was handled; False if the caller should fall back (typically to MIOpen). See module docstring for the full acceptance criteria.

When has_residual=True and source_ptr is set, computes D = Conv(A, B) + beta * source via the in-kernel fused residual path (amd_4wave_conv[has_residual=True]). The source pointer is expected to point to an NHWC-contiguous buffer with the same shape as output. When has_residual=False (default), the call is identical to the no-residual variant: no extra ABI overhead beyond the launch packet's 16 bytes (DCE'd source_ptr / stride / beta).

Parameters:

  • ​input_type (DType): DType of the input activation tensor; must be float8_e4m3fn, bfloat16, or float16.
  • ​filter_type (DType): DType of the filter tensor; must equal input_type.
  • ​output_type (DType): DType of the output tensor; bfloat16 for FP8 inputs, otherwise tracks input_type.
  • ​filter_is_fcrs (Bool): True when filter is in FCRS layout; False for RSCF. Selects the transpose path and the R/S dim indices.
  • ​has_residual (Bool): True to fuse D = Conv + beta * source in-kernel via source_ptr (defaults to False).
  • ​elementwise_lambda_fn (Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None]): Optional fused 2D-coord epilogue lambda wrapping a 4D NHWC elementwise_simd_epilogue_type; None fuses no epilogue (defaults to None).

Args:

Returns:

Bool

Was this page helpful?