vllm.v1.attention.ops.triton_reshape_and_cache_flash
¶
Functions:
-
triton_reshape_and_cache_flash_per_token_head_quant–Quantize key/value per (token, head) and write to paged cache.
triton_reshape_and_cache_flash_per_token_head_quant(key, value, key_cache, value_cache, k_scale_cache, v_scale_cache, slot_mapping, kv_quant_mode)
¶
Quantize key/value per (token, head) and write to paged cache.
Computes one scale = absmax / QUANT_MAX per (token, head), stores quantized data in key_cache/value_cache, and stores the float32 scale in k_scale_cache/v_scale_cache.
INT4 needs sub-byte packing + a Hadamard rotation, so it is handled by its own kernel; INT8 / FP8 share this kernel, with the quantization range (QUANT_MAX, QUANT_MIN) derived from the cache tensor dtype.