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
KVLoad2CvtConsumer
struct KVLoad2CvtConsumer[dtype: DType, config: MLA_SM100_Decode_Config]
Consumer side of the FP8-to-BF16 load-and-convert KV pipeline.
Parametersβ
- βdtype (
DType): Element type of the FP8 KV tiles stored in SMEM. - βconfig (
MLA_SM100_Decode_Config): Decode config supplyingnum_kv_stages,BN_QK, andq_depthfor pipeline stage sizing.
Fieldsβ
- βpipe (
KVLoad2CvtConsumer[dtype, config].PipeT): - βsmem_upper_fp8 (
Pointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED, _safe=False]):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
bf16_stage_elemsβ
comptime bf16_stage_elems = (config * config)
fp8_stage_stride_elemsβ
comptime fp8_stage_stride_elems = (Int(2) * Int((mul config.BN_QK, config.q_depth)))
PipeTβ
comptime PipeT = KVPipelineGeneric[config.num_kv_stages, Int(1), (Int(1) + Int(32) if (xor (eq (xor (lt config.scale_block_size, 1), True), False), True) else Int(0)), (_resolve_warpgroup_size() + Int(2))]
Methodsβ
__init__β
def __init__(pipe: KVPipelineGeneric[config.num_kv_stages, Int(1), (Int(1) + Int(32) if (xor (eq (xor (lt config.scale_block_size, 1), True), False), True) else Int(0)), (_resolve_warpgroup_size() + Int(2))], smem_upper_fp8: Pointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED, _safe=False]) -> Self
stage_base_ptrβ
def stage_base_ptr(self) -> Pointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED, _safe=False]
Returns:
Pointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED, _safe=False]
waitβ
def wait(self)
release_allβ
def release_all(mut self)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!