创建

登录 ReadmeX

或

了解我们如何处理你的信息: 隐私政策

ReadmeX

陪你读懂 AI 动态

今天,想先了解什么?

选一份动态总结,或直接聊聊你的问题。

社区和关注动态总结只属于你自己。

资讯

AWS 详解 MoE 融合内核优化,已并入 vLLM

AI 总结

AWS Machine Learning Blog 发文介绍其为融合 MoE 模型在 GPU 上实现的多项内核优化。文章称,通过交换 A、B 矩阵(Swap-AB)以匹配 NVIDIA Hopper 的 WGMMA 指令布局,在 H200 上为大模型带来 2% 至 4% 的端到端吞吐提升,并已合入 vLLM 0.24.0 及以后版本。另一项做法是用 do_not_specialize 标注消除 Triton 的 JIT 重复编译,AWS 称在 8 路张量并行下将首 token 延迟(TTFT)改善 9%,已进入 vLLM 0.22.0 及以后版本。AWS 表示这些优化已开源并用于 Amazon SageMaker AI 的 LMI 深度学习容器,合计带来最高 10% 吞吐提升和最高 9% 的首 token 延迟改善;上述数字均为 AWS 自述,未见独立验证。

深度见解

AWS 指出,MoE 运算占总计算时间的很大份额,因此该环节的低效会直接推高请求延迟和成本,这也是内核工程被视为性能提升空间最大之处的原因。

Mixture-of-Experts (MoE) is a sparsely-activated architecture that scales large language model (LLM) capacity while keeping per-token compute low. Because its operations account for a large share of total compute time, inefficiencies there directly raise request latency and cost. Therefore, optimizing MoE operations through kernel engineering offers the largest opportunity for performance gains.

Fused MoE is a key optimization technique for the MoE architecture. A fused MoE system merges token routing, data shuffling, and specialized network calculations into a single batched operation on the GPU. This replaces executing those routing and expert computations as separate, sequential loop operations. While this provides latency advantages, it also brings complexity in kernel implementations and debugging capability. High GPU utilization for this architecture requires hardware-specific optimizations.

In this post, we describe the different kernel optimizations we implemented for fused MoE models and show you how you can benefit from this work. We used a representative MoE model as our primary example.

Swap-AB for WGMMA utilization

To maximize tensor processing throughput, the NVIDIA Hopper architecture relies on the Warp Group Matrix Multiply Accumulate (WGMMA) instruction protocol, which executes collectively across a cooperative warpgroup of 128 threads. This operand asymmetry is fundamentally an instruction set architecture (ISA)-level property. In the underlying wgmma.mma_async assembly definition, the hardware fixes the matrix row dimension (M) at a constant scale of 64 to define its parallel thread-mapping topology. The column dimension (N) remains highly variable. Operand A strictly maps across this fixed M dimension (using registers or shared memory), and Operand B maps across the variable N dimension (through a shared memory descriptor). These operand slots are therefore structurally non-interchangeable. Consequently, peak hardware tile utilization is governed by these rigid shape encodings, requiring that the M dimension equals or exceeds 64 to prevent compute execution lanes from sitting idle.

#AWS#Amazon SageMaker AI#vLLM#NVIDIA#Hopper#Triton#AWS LMI deep learning container

原文约 7 分钟读完阅读原文
群聊

还没有评论,来说说你的看法。