vllm.distributed.kv_transfer.kv_checksum.kernels
¶
Triton kernel for the KV block checksums (see checksum.py) of several
layers of one layout, in one launch.
Functions:
-
layers_checksum–Add each layer's weighted piece sum of each block row into its column
layers_checksum(pieces, layers, block_ids, first_tokens, valid_tokens, out, aligned)
¶
Add each layer's weighted piece sum of each block row into its column
of out.
Parameters:
-
(pieces¶Tensor) –The first layer's cache as integer pieces
[num_blocks, kernel_blocks, heads, tokens, pieces], read as unsigned. Every layer's cache has its shape, strides and dtype. -
(layers¶Tensor) –[num_layers, 3]int64 on the device: each layer's cache address,layer * H + headof its first head, and its column ofout. -
(block_ids¶Tensor) –[n]int64 logical block ids. -
(first_tokens¶Tensor) –[n]int64 position in the request of each block's first token. -
(valid_tokens¶Tensor) –[n]int64 tokens to include from each block's start. -
(out¶Tensor) –[n, num_columns]int64 accumulator with unit column stride. -
(aligned¶bool) –Every address in
layersis a multiple of 16 bytes.