Skip to main content

Mojo struct

VBufferTransposeLoads

struct VBufferTransposeLoads[out_type: DType, in_type: DType, shape: IndexList[3], group_size: Int, transpose_b: Bool, mut: Bool, dtype: DType, layout: Layout, address_space: AddressSpace, alignment: Int, origin: Origin[mut], masked: Bool, layout_int_type: DType, linear_idx_type: DType, //, tensor_core_mma: TiledTensorCore[out_type, in_type, shape, group_size, transpose_b], BN: Int, BK: Int, depth: Int, num_threads: Int, num_stages: Int = 1]

Fields

  • load_tile (LayoutTensor[dtype, Layout.row_major(((((min(depth, 128) * BK) // (4 if (depth == 64) else simd_width_of[dtype]() * num_threads)) * (depth // min(depth, 128))) * num_stages), 4 if (depth == 64) else simd_width_of[dtype]()), MutableAnyOrigin, address_space=AddressSpace(5)]):
  • mma_tile (LayoutTensor[dtype, Layout.row_major((depth // shape.__getitem__[3, DType.int64, Int](0)), simd_width_of[dtype]()), MutableAnyOrigin, address_space=AddressSpace(5)]):
  • smem_iter (LayoutTensorIter[dtype, blocked_product(Layout.row_major(VBufferTransposeLoads.pad[out_type, in_type, shape, group_size, transpose_b, mut, dtype, layout, address_space, alignment, origin, masked, layout_int_type, linear_idx_type, tensor_core_mma, BN, BK, depth, num_threads, num_stages, depth](), simd_width_of[dtype]()), Layout.row_major(1, (BK // simd_width_of[dtype]())), True), MutableAnyOrigin, address_space=AddressSpace(3), circular=True]):
  • global_iterator (LayoutTensorIter[dtype, LayoutTensor._compute_tile_layout[mut, dtype, layout, origin, address_space, Layout(IntTuple(1), IntTuple(1)), layout_int_type, linear_idx_type, masked, alignment, BK, depth]()[0], origin, address_space=address_space, axis=0, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked if masked else _tile_is_masked[layout, BK, depth]()]):
  • global_base_tile (LayoutTensor[dtype, layout, origin, address_space=address_space, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment]):
  • current_stage (Int):

Implemented traits

AnyType, KVBuffer, UnknownDestructibility

Aliases

__del__is_trivial

alias __del__is_trivial = True

base_layout

alias base_layout = Layout.row_major(VBufferTransposeLoads.pad[out_type, in_type, shape, group_size, transpose_b, mut, dtype, layout, address_space, alignment, origin, masked, layout_int_type, linear_idx_type, tensor_core_mma, BN, BK, depth, num_threads, num_stages, depth](), simd_width_of[dtype]())

depth_tile_size

alias depth_tile_size = min(depth, 128)

GlobalTensorType

alias GlobalTensorType = LayoutTensor[dtype, layout, origin, address_space=address_space, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment]

GlobalTiledIteratorType

alias GlobalTiledIteratorType = LayoutTensorIter[dtype, LayoutTensor._compute_tile_layout[mut, dtype, layout, origin, address_space, Layout(IntTuple(1), IntTuple(1)), layout_int_type, linear_idx_type, masked, alignment, BK, depth]()[0], origin, address_space=address_space, axis=0, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked if masked else _tile_is_masked[layout, BK, depth]()]

load_width

alias load_width = 4 if (depth == 64) else simd_width_of[dtype]()

loads_per_thread_per_depth_tile

alias loads_per_thread_per_depth_tile = ((min(depth, 128) * BK) // (4 if (depth == 64) else simd_width_of[dtype]() * num_threads))

LoadTileType

alias LoadTileType = LayoutTensor[dtype, Layout.row_major(((((min(depth, 128) * BK) // (4 if (depth == 64) else simd_width_of[dtype]() * num_threads)) * (depth // min(depth, 128))) * num_stages), 4 if (depth == 64) else simd_width_of[dtype]()), MutableAnyOrigin, address_space=AddressSpace(5)]

MMA_K

alias MMA_K = shape.__getitem__[3, DType.int64, Int](2)

MMA_M

alias MMA_M = shape.__getitem__[3, DType.int64, Int](0)

mma_tile_layout

alias mma_tile_layout = Layout.row_major((depth // shape.__getitem__[3, DType.int64, Int](0)), simd_width_of[dtype]())

MMATileType

alias MMATileType = LayoutTensor[dtype, Layout.row_major((depth // shape.__getitem__[3, DType.int64, Int](0)), simd_width_of[dtype]()), MutableAnyOrigin, address_space=AddressSpace(5)]

num_depth_tiles

alias num_depth_tiles = (depth // shape.__getitem__[3, DType.int64, Int](0))

num_k_tiles

alias num_k_tiles = ceildiv(BK, (shape.__getitem__[3, DType.int64, Int](2) * group_size))

num_repeats

alias num_repeats = (BK // simd_width_of[dtype]())

SharedIterType

alias SharedIterType = LayoutTensorIter[dtype, blocked_product(Layout.row_major(VBufferTransposeLoads.pad[out_type, in_type, shape, group_size, transpose_b, mut, dtype, layout, address_space, alignment, origin, masked, layout_int_type, linear_idx_type, tensor_core_mma, BN, BK, depth, num_threads, num_stages, depth](), simd_width_of[dtype]()), Layout.row_major(1, (BK // simd_width_of[dtype]())), True), MutableAnyOrigin, address_space=AddressSpace(3), circular=True]

SharedTileType

alias SharedTileType = LayoutTensor[dtype, blocked_product(Layout.row_major(VBufferTransposeLoads.pad[out_type, in_type, shape, group_size, transpose_b, mut, dtype, layout, address_space, alignment, origin, masked, layout_int_type, linear_idx_type, tensor_core_mma, BN, BK, depth, num_threads, num_stages, depth](), simd_width_of[dtype]()), Layout.row_major(1, (BK // simd_width_of[dtype]())), True), MutableAnyOrigin, address_space=AddressSpace(3), layout_int_type=_get_index_type(AddressSpace(3)), linear_idx_type=_get_index_type(AddressSpace(3))]

simd_width

alias simd_width = simd_width_of[dtype]()

smem_layout

alias smem_layout = blocked_product(Layout.row_major(VBufferTransposeLoads.pad[out_type, in_type, shape, group_size, transpose_b, mut, dtype, layout, address_space, alignment, origin, masked, layout_int_type, linear_idx_type, tensor_core_mma, BN, BK, depth, num_threads, num_stages, depth](), simd_width_of[dtype]()), Layout.row_major(1, (BK // simd_width_of[dtype]())), True)

tiler_layout

alias tiler_layout = Layout.row_major(1, (BK // simd_width_of[dtype]()))

Methods

__init__

__init__(out self, global_tile: LayoutTensor[dtype, layout, origin, address_space=address_space, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment], shared_ptr: UnsafePointer[Scalar[dtype], address_space=AddressSpace(3), mut=mut, origin=origin])

get_dtype

static get_dtype() -> DType

Returns:

DType

pad

static pad[dim: Int]() -> Int

Returns:

Int

load_from_dram

load_from_dram(mut self)

get_mma_tile

get_mma_tile(self) -> LayoutTensor[dtype, Layout.row_major((depth // shape.__getitem__[3, DType.int64, Int](0)), simd_width_of[dtype]()), MutableAnyOrigin, address_space=AddressSpace(5)]

Returns:

LayoutTensor

copy_to_shared

copy_to_shared[tile_id: Int = 0](self)

load_from_shared

load_from_shared[k_mma: Int](self)

Was this page helpful?