HAWK:面向高效GPU-NPU阶段解耦大语言模型推理的异构感知KV缓存传输
HAWK: Heterogeneity-Aware KV Cache Transfer for Efficient GPU-NPU Phase-Disaggregated LLM Inference
AI总结:
该研究针对GPU-NPU异构架构中LLM阶段解耦的KV缓存传输难题,提出HAWK机制,实现高效跨设备传输,在性能接近纯GPU系统的同时提升了功率与成本效率。
摘要:
大语言模型(LLM)推理在其两个阶段表现出截然不同的计算特性:预填充阶段是计算密集型,而解码阶段则更受内存限制。因此,AI加速器在这两个阶段的效率水平各不相同。GPU非常适合预填充阶段,但在解码阶段往往利用率不足;相比之下,NPU在解码阶段能更有效地利用其计算资源。受这一观察结果的启发,我们探索了一种集成GPU和NPU的异构架构,将预填充映射到GPU、解码映射到NPU,以实现高性能和高效率。然而,实现这种异构集成颇具挑战性,因为LLM阶段解耦需要将KV缓存从预填充设备传输到解码设备(即从GPU传输到NPU),而设备间通信机制和KV缓存张量布局的差异会使该传输过程变得复杂。为解决这一问题,我们提出了HAWK,一种支持跨异构设备快速KV缓存传输的传输机制。HAWK建立了远程直接内存访问(RDMA)路径以实现直接跨设备传输,同时在传输过程中处理设备间张量布局的差异。具体而言,HAWK在NPU侧分配感知张量布局的RDMA缓冲区,以匹配目标张量布局。利用这些缓冲区,HAWK协调数据从常规连续GPU RDMA缓冲区到对应NPU缓冲区的传输,使传输后的张量可直接使用而无需额外的数据重排,同时保持传输效率。我们在采用商用GPU和NPU构建的系统上实现并评估了HAWK,结果显示在相同服务水平目标(SLO)约束下,其性能与仅使用GPU的系统相比差距在7.88%以内,同时实现了最高1.26倍的功率效率提升和1.72倍的成本效率提升。
英文摘要:
Large language model (LLM) inference exhibits distinct computational characteristics across its two phases: prefill is compute-intensive, whereas decode is more memory-bound. As a result, AI accelerators achieve varying levels of efficiency across the two phases. GPUs are well suited to prefill, but are often underutilized during decode. By contrast, NPUs can utilize their compute resources more effectively during decode. Motivated by this observation, we explore a heterogeneous architecture that integrates GPUs and NPUs, mapping prefill to GPUs and decode to NPUs to achieve high performance and efficiency. However, realizing such heterogeneous integration is challenging because LLM phase disaggregation requires KV cache transfer from prefill to decode (that is, from GPUs to NPUs), which is complicated by differences in inter-device communication mechanisms and KV cache tensor layouts. To address this, we propose HAWK, a transfer mechanism that enables rapid KV cache transfer across heterogeneous devices. HAWK establishes a remote direct memory access (RDMA) path for direct cross-device transfers while handling inter-device tensor layout discrepancies as part of the transfer process. In particular, HAWK allocates tensor-layout-aware RDMA buffers on the NPU side to match the target tensor layout. Leveraging these buffers, HAWK orchestrates data transfer from a conventional contiguous GPU RDMA buffer to the corresponding NPU buffers, allowing transferred tensors to be consumed directly without additional data rearrangement while maintaining transfer efficiency. We implement and evaluate HAWK on a system built with commercially available GPUs and NPUs, demonstrating performance within 7.88% of a GPU-only system under the same SLO constraints while achieving up to 1.26$\times$ higher power efficiency and 1.72$\times$ higher cost efficiency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。