Skip to main content

Mojo function

naive_blockwise_scaled_fp8_matmul

naive_blockwise_scaled_fp8_matmul[c_type: DType, a_type: DType, b_type: DType, a_scales_type: DType, b_scales_type: DType, //, *, BLOCK_DIM: Int = 16, transpose_b: Bool = False, elementwise_lambda_fn: Optional[elementwise_epilogue_type] = None, accum_type: DType = get_accum_type[c_type](), scales_granularity_mnk: Optional[IndexList[3]] = None](c: LayoutTensor[c_type, c.layout, c.origin, element_layout=c.element_layout, layout_int_type=c.layout_int_type, linear_idx_type=c.linear_idx_type, masked=c.masked, alignment=c.alignment], a: LayoutTensor[a_type, a.layout, a.origin, element_layout=a.element_layout, layout_int_type=a.layout_int_type, linear_idx_type=a.linear_idx_type, masked=a.masked, alignment=a.alignment], b: LayoutTensor[b_type, b.layout, b.origin, element_layout=b.element_layout, layout_int_type=b.layout_int_type, linear_idx_type=b.linear_idx_type, masked=b.masked, alignment=b.alignment], a_scales: LayoutTensor[a_scales_type, a_scales.layout, a_scales.origin, element_layout=a_scales.element_layout, layout_int_type=a_scales.layout_int_type, linear_idx_type=a_scales.linear_idx_type, masked=a_scales.masked, alignment=a_scales.alignment], b_scales: LayoutTensor[b_scales_type, b_scales.layout, b_scales.origin, element_layout=b_scales.element_layout, layout_int_type=b_scales.layout_int_type, linear_idx_type=b_scales.linear_idx_type, masked=b_scales.masked, alignment=b_scales.alignment], ctx: DeviceContext)

naive_blockwise_scaled_fp8_matmul[c_type: DType, a_type: DType, b_type: DType, a_scales_type: DType, b_scales_type: DType, c_shape: DimList, a_shape: DimList, b_shape: DimList, a_scale_shape: DimList, b_scale_shape: DimList, //, *, BLOCK_DIM: Int = 16, transpose_b: Bool = False, elementwise_lambda_fn: Optional[elementwise_epilogue_type] = None, accum_type: DType = get_accum_type[c_type](), scales_granularity_mnk: Optional[IndexList[3]] = None](c_device: NDBuffer[c_type, 2, c_device.origin, c_shape], a_device: NDBuffer[a_type, 2, a_device.origin, a_shape], b_device: NDBuffer[b_type, 2, b_device.origin, b_shape], a_scales_device: NDBuffer[a_scales_type, 2, a_scales_device.origin, a_scale_shape], b_scales_device: NDBuffer[b_scales_type, 2, b_scales_device.origin, b_scale_shape], ctx: DeviceContext)

Was this page helpful?