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
generic_flash_attention_kv_cache_padded
def generic_flash_attention_kv_cache_padded[collection_t: KVCollectionT, dtype: DType, //, *, mask_str: StaticString, local_window_size: Int = Int(-1), num_heads: Int = Int(-1)](q: TileTensor[dtype, Engine=q.Engine, linear_idx_type=q.linear_idx_type], kv_collection: collection_t, layer_idx: UInt32, valid_lengths: TileTensor[.uint32, Engine=valid_lengths.Engine, linear_idx_type=valid_lengths.linear_idx_type], scale: Float32, output: TileTensor[dtype, Engine=output.Engine, linear_idx_type=output.linear_idx_type], context: DeviceContext, sink_weights: OptionalReg[TileTensor[dtype, Layout[TypeList[Int64](), TypeList[ComptimeInt[Int(1)]]()], ImmutAnyOrigin]] = None)