vllm.v1.attention.ops.triton_turboquant_decode
¶
Triton fused TurboQuant decode attention.
Decode path: Triton stage1 (split-KV tiled attention scoring + value accumulation) + stage2 (log-sum-exp reduction across splits).
Supports FP8 (E4M3) keys, 3-bit and 4-bit uniform quantized values.
Functions:
-
triton_turboquant_decode_attention–Launch fused TQ decode attention (Triton stage1 + stage2).
_get_layout(D, mse_bits, value_quant_bits, key_packed_size)
¶
Get cached layout constants.
_tq_full_dequant_kv(KV_cache_ptr, Block_table_ptr, Centroids_ptr, K_out_ptr, V_out_ptr, stride_ko_b, stride_ko_h, stride_ko_s, stride_vo_b, stride_vo_h, stride_vo_s, stride_cache_block, stride_cache_pos, stride_cache_head, stride_bt_b, HEAD_DIM, BLOCK_SIZE, NUM_KV_HEADS, MSE_BYTES, KPS, VQB, VAL_DATA_BYTES, MSE_BITS, KEY_FP8, BLOCK_D, NORM_CORRECTION=0, FP8_E4B15=0)
¶
Full dequant: reconstruct K (MSE centroids * norm or FP8) and V to fp16.
_use_fp8_e4b15(device=0)
¶
Return 1 if device needs fp8e4b15 (Ampere/Ada, SM < 8.9), else 0. On non-CUDA platforms (e.g. XPU), always returns 0 (use e4nv format).
triton_turboquant_decode_attention(query, kv_cache, block_table, seq_lens, Pi, centroids, scale, mse_bits, key_packed_size, value_quant_bits, key_fp8=False, norm_correction=False, PiT=None, mid_o_buf=None, output_buf=None, lse_buf=None, buf_holder=None, max_num_kv_splits=32)
¶
Launch fused TQ decode attention (Triton stage1 + stage2).
Returns: output tensor [B, Hq, D] in query's dtype.