ParallelKittens: Systematic and Practical Simplification of Multi-GPU AI Kernels (MLSys 2026)

一句话总结:在 ThunderKittens 基础上用 8 个核心 primitive 和统一程序模板封装 3 条多 GPU kernel 设计原则(传输机制、调度策略、设计开销),<50 行 device 代码就能达到 DP/TP 2.33×、SP 4.08×、EP 1.22× 的 speedup,匹配手工 Flux/Comet/CUTLASS。

问题

随着单 GPU 算力提升远快于互联带宽(A100→B200:BF16 tensor core 7.2×,NVLink 仅 3×),多 GPU kernel 的 inter-GPU 通信成了瓶颈;即使 LLM prefill 这种 compute-friendly 阶段,通信也占 >50% 时间。

已有 overlap 方案有三类局限:

  • Operator-specific 手工 kernel(Flux、Comet、FlashDMoE)强但不可复用、支持面窄。
  • Compiler-based(Triton Distributed、TileLink)无法跨 accelerator 适配,有时反而比 non-overlapped baseline 慢。
  • 通信库(NCCL、NVSHMEM)的封装牺牲了性能(pure allreduce 会损失 >1.7×)。

是否存在简单、通用的设计原则,从一小组 primitive 就能 systematically 写出 peak-performance multi-GPU kernel?

核心方法

三条设计原则(来自系统 microbenchmark)

  1. Transfer mechanism:copy engine、TMA、register 指令的带宽/粒度/功能 trade-off 不同。Copy engine 达 81% 峰值但需要 ≥256 MB 消息才饱和;TMA 只要 2 KB 就 74%;register 指令支持 in-network reduction 但要 ~76 个 SM 才能饱和(TMA 仅需 15)。
  2. Scheduling:intra-SM(thread 内 compute/comm 分工)vs inter-SM(SM 间分工)。计算/通信粒度一致时 intra-SM 更优(GEMM+RS 提升 1.2×);需要 in-network reduction 时 inter-SM 优(GEMM all-reduce 提升 3.62×)。
  3. Design overheads:NCCL/NVSHMEM 的同步和缓冲选择牺牲了性能;给用户显式控制能把 pure communication kernel 加速 >1.7×。

ParallelKittens(PK)抽象

  • 扩展 ThunderKittens(C++ embedded 框架),只暴露每种功能最高效的 transfer 机制(TMA for point-wise、register for in-network reduction,copy engine 完全不用)。
  • 8 个核心 primitive + 1 个统一程序模板,同时支持 inter-SM 和 intra-SM overlap。
  • 用户可控制 NVLink 传输、同步、peer memory,但隐藏 IPC 和虚拟内存交换。

关键结果

  • 通用 speedup(相比最强 baseline):DP/TP 2.33×、SP 4.08×、EP 1.22×;把 non-overlapped 通信占比分别压到 1%、9%、15%。
  • 对比 compiler-based(Triton Distributed):1.07–5.63×。
  • 对比 library-based(xDiT、YunChang):1.01–4.08×。
  • 简洁性:每个 kernel 只比原单 GPU GEMM/attention 多 <50 行 device 代码。
  • 平台:Hopper(H100)+ Blackwell(B200)均验证;已在 Cursor 大规模 in-house 训练采用。

相关