IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

kpool_compress_kernel

def kpool_compress_kernel[dtype: DType, KLayoutType: TensorLayout, k_origin: ImmOrigin, GateLayoutType: TensorLayout, gate_origin: ImmOrigin, ApeLayoutType: TensorLayout, ape_origin: ImmOrigin, IROLayoutType: TensorLayout, iro_origin: ImmOrigin, PROLayoutType: TensorLayout, pro_origin: ImmOrigin, CacheLenLayoutType: TensorLayout, OutLayoutType: TensorLayout, out_origin: MutOrigin, KEngine: TensorEngine, GateEngine: TensorEngine, ApeEngine: TensorEngine, IROEngine: TensorEngine, PROEngine: TensorEngine, CacheLenEngine: TensorEngine, OutEngine: TensorEngine, head_dim: Int, kpool: Int](pooled: TileTensor[dtype, OutLayoutType, out_origin, Engine=OutEngine], k: TileTensor[dtype, KLayoutType, k_origin, Engine=KEngine], gate: TileTensor[dtype, GateLayoutType, gate_origin, Engine=GateEngine], ape: TileTensor[.float32, ApeLayoutType, ape_origin, Engine=ApeEngine], input_row_offsets: TileTensor[.uint32, IROLayoutType, iro_origin, Engine=IROEngine], pool_row_offsets: TileTensor[.uint32, PROLayoutType, pro_origin, Engine=PROEngine], cache_lengths: TileTensor[.uint32, CacheLenLayoutType, ImmutAnyOrigin, Engine=CacheLenEngine])

Builds one pooled key per block; one thread per channel.

Parameters:

Args:

Was this page helpful?