Skip to main content

Mojo function

block_scaled_matmul

block_scaled_matmul[c_type: DType, a_type: DType, b_type: DType, scales_dtype: DType, //, *, SF_VECTOR_SIZE: Int, transpose_b: Bool = True, transpose_a: Bool = False, elementwise_lambda_fn: Optional[elementwise_epilogue_type] = None, pdl_level: PDLLevel = PDLLevel(), _trace_description: StringSlice[StaticConstantOrigin] = "", target: StringSlice[StaticConstantOrigin] = "cpu"](c_device: NDBuffer[c_type, MutAnyOrigin, c_device.shape, DimList.create_unknown[2]()], a_device: NDBuffer[a_type, ImmutAnyOrigin, a_device.shape, DimList.create_unknown[2]()], b_device: NDBuffer[b_type, ImmutAnyOrigin, b_device.shape, DimList.create_unknown[2]()], a_scales_device: NDBuffer[scales_dtype, ImmutAnyOrigin, a_scales_device.shape, DimList.create_unknown[5]()], b_scales_device: NDBuffer[scales_dtype, ImmutAnyOrigin, b_scales_device.shape, DimList.create_unknown[5]()], tensor_sf: Float32, ctx: DeviceContext)

NDBuffer overload of block_scaled_matmul. Converts to TileTensor and delegates.

block_scaled_matmul[c_type: DType, a_type: DType, b_type: DType, scales_dtype: DType, //, *, SF_VECTOR_SIZE: Int, transpose_b: Bool = True, transpose_a: Bool = False, elementwise_lambda_fn: Optional[elementwise_epilogue_type] = None, pdl_level: PDLLevel = PDLLevel(), _trace_description: StringSlice[StaticConstantOrigin] = "", target: StringSlice[StaticConstantOrigin] = "cpu"](c_device: TileTensor[c_type, c_device.LayoutType, c_device.origin, linear_idx_type=c_device.linear_idx_type, element_size=c_device.element_size], a_device: TileTensor[a_type, a_device.LayoutType, a_device.origin, linear_idx_type=a_device.linear_idx_type, element_size=a_device.element_size], b_device: TileTensor[b_type, b_device.LayoutType, b_device.origin, linear_idx_type=b_device.linear_idx_type, element_size=b_device.element_size], a_scales_device: TileTensor[scales_dtype, a_scales_device.LayoutType, a_scales_device.origin, linear_idx_type=a_scales_device.linear_idx_type, element_size=a_scales_device.element_size], b_scales_device: TileTensor[scales_dtype, b_scales_device.LayoutType, b_scales_device.origin, linear_idx_type=b_scales_device.linear_idx_type, element_size=b_scales_device.element_size], tensor_sf: Float32, ctx: DeviceContext)

Was this page helpful?