vllm.v1.attention.ops.triton_turboquant_store
¶
Fused Triton kernels for TurboQuant KV store.
Two kernels: 1. _tq_fused_store_fp8: FP8 key scatter + value uniform quantization. 2. _tq_fused_store_mse: Fused binary-search bucketize + MSE index packing + value quantization.
The launcher triton_turboquant_store selects the appropriate kernel.
Functions:
-
triton_turboquant_store–Launch TQ store kernel (FP8 or MSE path).
_store_quantized_value(Value_ptr, KV_cache_ptr, base, slot_base, d_offs, d_mask, D, KPS, VQB, VAL_DATA_BYTES, BLOCK_D, BLOCK_VAL, BLOCK_GRP)
¶
Uniform quantization of values to VQB bits, pack, and store with scale/zero.
_tq_fused_store_fp8(Key_ptr, Value_ptr, KV_cache_ptr, Slot_mapping_ptr, stride_cache_block, stride_cache_pos, stride_cache_head, D, H, BLOCK_SIZE, BLOCK_D, KPS, VQB, VAL_DATA_BYTES, BLOCK_VAL, BLOCK_GRP=16, FP8_E4B15=0)
¶
FP8 key cast+scatter + value uniform quantization.
_tq_fused_store_mse(Y_ptr, Norms_ptr, Value_ptr, Midpoints_ptr, KV_cache_ptr, Slot_mapping_ptr, stride_cache_block, stride_cache_pos, stride_cache_head, D, H, BLOCK_SIZE, BLOCK_D, MSE_BYTES, KPS, VQB, VAL_DATA_BYTES, BLOCK_VAL, MSE_BITS, N_CENTROIDS, BLOCK_GRP=16)
¶
Fused MSE quantize + pack + store.
Performs binary-search bucketize, MSE index packing, norm storage, and value quantization in one kernel.
triton_turboquant_store(key, value, kv_cache, slot_mapping, PiT, midpoints, mse_bits, key_packed_size, value_quant_bits, key_fp8=False)
¶
Launch TQ store kernel (FP8 or MSE path).