TileMix:面向LLM推理加速的以Tile为中心的混合精度注意力机制

·

研究论文 · 2026/08/25

TileMix 是一种面向大语言模型推理加速的基于 tile 的混合精度注意力内核。它将注意力矩阵划分为硬件对齐的分数 tile,并通过紧凑的位掩码将每个 tile 组路由到 FP16 或 INT8 计算路径,同时共享在线 softmax 状态。该方法无需训练,支持分组查询注意力、可变长度批次和 INT8 键值缓存,在保持密集 token 连接的同时,通过可扩展的精度分组减少元数据开销。在 LLaMA、Qwen 和 Vicuna 上的 LongEval、LV-Eval 和 A100 预填充基准测试中,TileMix 恢复了统一 INT8 下损失的长上下文质量,并提高了预填充吞吐量,实现了可控的精度-效率权衡。

该文章提出了一种新颖的 tile 级混合精度注意力机制,在保持密集注意力的同时实现精度自适应,显著提升推理效率,且无需训练,具有实际应用价值。

Long-context prefill in large language models (LLMs) incurs substantial computation and memory traffic because dense self-attention computes quadratic query-key scores. Existing methods either use a uniform low-precision path or select token interactions, leaving spatial precision routing over hardware-aligned score tiles outside fused dense attention. We introduce TileMix, a tile-centric precision-routing kernel that makes numerical precision an executable spatial decision over score-tile groups within fused dense attention. TileMix partitions the attention matrix into hardware-aligned score tiles, packs routing decisions into compact bitmasks, and dispatches each tile group through FP16 or INT8 score computation while both paths update a shared online-softmax state. Scalable precision grouping lets each routing bit govern multiple adjacent key tiles, preserving hardware-aligned compute tiles and compact metadata at long contexts. By routing all legal tile groups, TileMix preserves dense token connectivity, requires no training, and supports grouped-query attention, variable-length batches, and INT8 key/value caches. Across LongEval, LV-Eval, and A100 prefill benchmarks on LLaMA, Qwen, and Vicuna, TileMix recovers long-context quality lost under uniform INT8 and improves prefill throughput over FP16, yielding a controllable accuracy-efficiency frontier across model families. The implementation is available at https://github.com/HanzhiZhang-Ulrica/TileMix.

阅读原文

参与讨论