For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
dispatch_amd_4wave_conv3d
def dispatch_amd_4wave_conv3d[EpilogueFnType: ElementwiseEpilogueFn = inflated$def[comptime[dtype: DType, width: SIMDLength, *, alignment: Int] #kgen.func.symbol<@linalg::@utils::@"_no_epilogue_body[::DType,::SIMDLength,::SIMD[DType.int, 1],KGENParamList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike],::TypeList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike, $3]](::Coord[$3, $4],::SIMD[$0, $1])"<:!lit.struct<@std::@builtin::@dtype::@DType> dtype, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> width, :!lit.struct<@std::@simd::@SIMD<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype index}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}>> alignment, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?, :!lit.struct<@std::@builtin::@variadics::@TypeList<:meta<!lit.trait<@std::@traits::@anytype::@AnyType>> trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?>> *?>>], ComputeFnType: ElementwiseComputeFn = inflated$def[comptime[dtype: DType, width: SIMDLength, *, alignment: Int] #kgen.func.symbol<@linalg::@utils::@"identity_compute_fn[::DType,::SIMDLength,::SIMD[DType.int, 1],KGENParamList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike],::TypeList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike, $3]](::Coord[$3, $4],::SIMD[$0, $1])"<:!lit.struct<@std::@builtin::@dtype::@DType> dtype, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> width, :!lit.struct<@std::@simd::@SIMD<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype index}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}>> alignment, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?, :!lit.struct<@std::@builtin::@variadics::@TypeList<:meta<!lit.trait<@std::@traits::@anytype::@AnyType>> trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?>> *?>>], //, input_type: DType, filter_type: DType, output_type: DType, filter_is_fcqrs: Bool, has_epilogue_fn: Bool = False, has_compute_fn: Bool = False, block_m_override: Int = Int(0), block_n_override: Int = Int(0), block_k_override: Int = Int(0)](input: TileTensor[input_type, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type], filter: TileTensor[filter_type, Engine=filter.Engine, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type], output: TileTensor[output_type, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], stride: IndexList[Int(3)], dilation: IndexList[Int(3)], symmetric_padding: IndexList[Int(3)], num_groups: Int, ctx: DeviceContext, epilogue_fn: EpilogueFnType = no_epilogue_fn, compute_fn: ComputeFnType = no_compute_fn) -> Bool
Try to dispatch a Conv3D to amd_4wave_conv on MI355X. Returns True if handled; False if the caller should fall through (typically to dispatch_im2col_matmul_conv3d).
Parameters:
- EpilogueFnType (
ElementwiseEpilogueFn): Type ofepilogue_fn. - ComputeFnType (
ElementwiseComputeFn): Type ofcompute_fn. - input_type (
DType):DTypeof the input tensor; must befloat8_e4m3fn,bfloat16, orfloat16. - filter_type (
DType):DTypeof the filter tensor; must equalinput_type. - output_type (
DType):DTypeof the output tensor;bfloat16for FP8 input, otherwise tracksinput_type. - filter_is_fcqrs (
Bool):Trueif the filter is laid out as FCQRS[F, C, Q, R, S];Falseif QRSCF[Q*R*S*C, F]. - has_epilogue_fn (
Bool):Trueto store each output chunk throughepilogue_fninstead of writingoutput(defaults toFalse). - has_compute_fn (
Bool):Trueto storecompute_fnof each output chunk (defaults toFalse). - block_m_override (
Int): Override for the BM tile size, 0 uses the heuristic (defaults to 0). - block_n_override (
Int): Override for the BN tile size, 0 uses the heuristic (defaults to 0). - block_k_override (
Int): Override for the BK tile size, 0 uses the heuristic (defaults to 0).
Args:
- input (
TileTensor[input_type, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type]): Input NDHWC tensor of shape[N, D, H, W, C_in]; all spatial dims must be static. - filter (
TileTensor[filter_type, Engine=filter.Engine, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type]): Filter tensor; FCQRS[F, C, Q, R, S]whenfilter_is_fcqrselse QRSCF[Q, R, S, C, F]. - output (
TileTensor[output_type, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type]): Output NDHWC tensor of shape[N, D_out, H_out, W_out, C_out]. - stride (
IndexList[Int(3)]): Per-axis stride[stride_d, stride_h, stride_w]; all three must be equal and in{1, 2}. - dilation (
IndexList[Int(3)]): Per-axis dilation; must be(1, 1, 1). - symmetric_padding (
IndexList[Int(3)]): Per-axis symmetric padding[pad_d, pad_h, pad_w]; each in{0, 1, 2}andpad_hmust equalpad_w. - num_groups (
Int): Convolution group count; must be 1. - ctx (
DeviceContext):DeviceContextused to enqueue the transpose and conv kernels. - epilogue_fn (
EpilogueFnType): Stores each output chunk at a 2D coordinate(m, n), wheremis the flattened NDHW output row andnis the output channel. Used whenhas_epilogue_fnis set. - compute_fn (
ComputeFnType): Transforms each output chunk at the same 2D coordinate. Used whenhas_compute_fnis set.
Returns: