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 struct

Conv2dResidualAdd

struct Conv2dResidualAdd

Fused conv2d + TMA residual add + bias for SM100 (Blackwell).

Computes: D = Conv(input, filter) + bias + source The residual (source) is loaded via TMA pre-fetch overlapped with MMA, and the bias is applied in the epilogue.

This op is intended for ResNet-style skip connections where a residual tensor is added to the convolution output.

Implemented traits​

AnyType, ImplicitlyDestructible

Methods​

execute​

static def execute[stride_h: Int, stride_w: Int, pad_top: Int, pad_bottom: Int, pad_left: Int, pad_right: Int, has_bias: Bool, target: StringSlice[StaticConstantOrigin]](output: ManagedTensorSlice[FusedOutput, static_spec=output.static_spec], input: ManagedTensorSlice[Input, static_spec=input.static_spec], filter: ManagedTensorSlice[Input, static_spec=filter.static_spec], source: ManagedTensorSlice[Input, static_spec=source.static_spec], bias: ManagedTensorSlice[Input, static_spec=bias.static_spec], ctx: DeviceContext)

shape​

static def shape(input: ManagedTensorSlice[Input, static_spec=input.static_spec], filter: ManagedTensorSlice[Input, static_spec=filter.static_spec], source: ManagedTensorSlice[Input, static_spec=source.static_spec], bias: ManagedTensorSlice[Input, static_spec=bias.static_spec]) -> IndexList[4]

Returns:

IndexList[4]