RaMP:面向混合专家的运行时感知宏内核多态性
RaMP: Runtime-Aware Megakernel Polymorphism for Mixture-of-Experts
AI总结:
RaMP通过运行时感知的调度框架优化混合专家推理,基于硬件常数分析性能区域,实现高效内核配置,提升推理速度1.22倍,优于静态调度和多个现有系统。
摘要:
混合专家(MoE)推理的最佳内核配置取决于批大小和专家路由分布,但生产系统仅基于批大小调度,导致10-70%的内核吞吐量未被利用。本文提出RaMP,一种路由感知的调度框架。通过性能区域分析,仅基于硬件常数即可确定每个优化何时有效,正确预测了所有8种测试架构,包括3种未见过的架构。一个四参数波成本模型从运行时专家直方图中选择最快配置,实现0.93%的均值遗憾,仅需10-24分钟的一次性性能分析。由于模型仅依赖CTA网格几何,因此具有内核无关性:应用于Alpha-MoE时,无需源代码修改即可实现1.14倍的提升。与专为RaMP设计的CuTe DSL内核暴露134-268种多态配置相结合,RaMP在静态调度上实现1.22倍的内核加速,在vLLM服务中相对于Triton提升1.30倍,相对于DeepGEMM提升1.41倍,相对于FlashInfer CUTLASS提升1.13倍。
英文摘要:
LLM serving systems autotune their GPU kernels offline by timing candidate kernel configurations, like tile sizes, at a range of batch sizes. This works when the number of tokens determines a kernel's work, as in dense layers. However, we show that it does not hold for Mixture-of-Experts (MoE) layers where the router decides how the tokens are split across experts and GPUs. We find that the best kernel configuration depends on this split, and not only on the number of tokens--under expert parallelism, choosing the configuration for each GPU's actual token distribution is up to 1.45x faster than the existing choice. The split is not known until the router runs, so it cannot be looked up in advance. Hence, we introduce RaMP, which chooses the kernel configuration at run time from the routing split itself. RaMP compiles top configurations into one polymorphic kernel, and a small cost model on the GPU picks among them in a few microseconds. On serving traffic its cost model was never fit on, the configurations RaMP's cost model chooses from the kernel's full configuration space are up to 1.45x faster than those vLLM's offline autotuner picks for the same kernel on batches of 128 tokens or more (1.27x over all batches), and within 3.5% of an exhaustive search that times every configuration. RaMP's kernel and choice together make the MoE layer up to 1.84x faster than vLLM's Triton MoE on batches of 128 tokens or more. In vLLM, under both tensor and expert parallelism, RaMP lowers time per output token by up to 1.11x over the fastest stock MoE backend.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。