arXiv:2412.18106cs.AIcs.DC2024-12被引 7

通过混合调度与元核优化,显著提升昇腾芯片上大模型服务的吞吐量。

Tackling the Dynamicity in a Production LLM Serving System with SOTA Optimizations via Hybrid Prefill/Decode/Verify Scheduling on Efficient Meta-kernels

  • 将计算分解为细粒度元原语,用自适应块大小缓解动态负载波动。
  • 在昇腾NPU上实现最高89%的端到端吞吐提升,注意力与GEMM内核平均提速21.5%和14.6%。
  • 适用于生产级大模型服务,尤其适合块式编程的AI加速器架构。

满足生产级大语言模型(LLM)服务对低延迟和高成本效率的需求,需集成先进优化技术。然而,LLM输入输出长度的动态性,叠加优化后加剧了工作负载的不稳定性,使在AI加速器(尤其是基于分块编程模型的DSAs)上保持高效变得困难。为此,我们提出XY-Serve——一个原生支持昇腾的全链路生产级LLM服务系统。核心思想是通过抽象机制,将计算分解为统一、硬件友好的细粒度元原语,以平滑工作负载波动。针对注意力计算,提出一种元核,可按架构特性自动调整块大小,实现matmul-softmax-matmul的基本模式计算;针对GEMM,引入虚拟填充方案,在动态形状变化下仍能使用固定块大小的高效内核。实验表明,相比现有公开基线,XY-Serve在昇腾NPUs上实现了最高89%的端到端吞吐提升;其注意力与GEMM内核分别比现有库平均快21.5%和14.6%。尽管本工作聚焦昇腾平台,但方法可扩展至SIMT架构。

原文摘要 · Abstract (English)

Meeting growing demands for low latency and cost efficiency in production-grade large language model (LLM) serving systems requires integrating advanced optimization techniques. However, dynamic and unpredictable input-output lengths of LLM, compounded by these optimizations, exacerbate the issues of workload variability, making it difficult to maintain high efficiency on AI accelerators, especially DSAs with tile-based programming models. To address this challenge, we introduce XY-Serve, a versatile, Ascend native, end-to-end production LLM-serving system. The core idea is an abstraction mechanism that smooths out the workload variability by decomposing computations into unified, hardware-friendly, fine-grained meta primitives. For attention, we propose a meta-kernel that computes the basic pattern of matmul-softmax-matmul with architectural-aware tile sizes. For GEMM, we introduce a virtual padding scheme that adapts to dynamic shape changes while using highly efficient GEMM primitives with assorted fixed tile sizes. XY-Serve sits harmoniously with vLLM. Experimental results show up to 89% end-to-end throughput improvement compared with current publicly available baselines on Ascend NPUs. Additionally, our approach outperforms existing GEMM (average 14.6% faster) and attention (average 21.5% faster) kernels relative to existing libraries. While the work is Ascend native, we believe the approach can be readily applicable to SIMT architectures as well.

大模型服务昇腾优化动态调度元核

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。