AI News AI资讯 7h ago Updated 2h ago 更新于 2小时前 47

Cursor Open-Sources Mixture-of-Kittens (MoK): A Deterministic MoE Training Megakernel for GB300 NVL72 Racks Cursor 开源混合小猫(MoK):面向 GB300 NVL72 机架的确定性 MoE 训练 Megakernel

Cursor Research open-sourced Mixture-of-Kittens (MoK), a deterministic MoE training megakernel that fuses all communication and computation steps into a single kernel, powering Composer models across tens of thousands of GPUs MoK achieves up to 2.37x higher throughput than the strongest public baseline (MXFP8 forward), with 1.41x end-to-end gain across 512 GPUs on GB300 NVL72 racks Three key innovations: pull-based dispatch (5.8x faster signaling than push at 18 µs vs 103 µs), mid-granularity ov Cursor Research开源Mixture-of-Kittens (MoK),将MoE训练中的所有通信与计算步骤融合为单一确定性megakernel,已驱动Composer模型在数万GPU上训练 MoK在GB300 NVL72机架(72 GPU NVLink域)上实现最高2.37x吞吐量提升(MXFP8前向),端到端512 GPU测试达1.41x加速(760.9→1,070.2 tokens/sec/GPU) 三大核心设计:pull-based dispatch + push-based combine(信令从103µs降至18µs)、中等粒度overlap(目标≥2个SM wave)、

68
Hot 热度
62
Quality 质量
70
Impact 影响力

Analysis 深度分析

TL;DR

  • Cursor Research open-sourced Mixture-of-Kittens (MoK), a deterministic MoE training megakernel that fuses all communication and computation steps into a single kernel, powering Composer models across tens of thousands of GPUs
  • MoK achieves up to 2.37x higher throughput than the strongest public baseline (MXFP8 forward), with 1.41x end-to-end gain across 512 GPUs on GB300 NVL72 racks
  • Three key innovations: pull-based dispatch (5.8x faster signaling than push at 18 µs vs 103 µs), mid-granularity overlap heuristic targeting 2+ SM waves per expert GEMM, and a ring token buffer eliminating CPU-GPU synchronization entirely
  • Requires NVIDIA Blackwell SM100/SM103 GPUs (GB200/GB300 NVL72 racks), Python 3.12+, PyTorch 2.10+, CUDA 13.0+, and PyTorch symmetric memory for inter-GPU buffers
  • Apache-2.0 licensed; targets pretraining/post-training of DeepSeek-V3-style MoE models, on-policy RL post-training, and internal ablations

Why It Matters

MoK addresses the critical bottleneck in MoE training—inter-GPU communication, which can consume over half of end-to-end training time—by eliminating CPU involvement and maximizing NVLink utilization through a fully fused megakernel. For AI practitioners scaling MoE models on NVL72-scale infrastructure, this represents a significant throughput improvement that directly reduces training costs and time-to-train for frontier model development.

Technical Details

  • Architecture: MoK fuses all MoE communication (dispatch/combine) and computation (GEMM, router gradient) into a single deterministic megakernel. Scheduling leverages Blackwell's Cluster Launch Control to avoid RDMA serialization. Router weight gradients use a SonicMoE-style calculation fused into the SwiGLU backward pass.
  • Communication strategy: Asymmetric pull/push design—pull-based forward dispatch (18 µs signaling vs 103 µs for push, ~5.8x faster) with up to 29% higher NVLink bandwidth utilization under expert imbalance, combined with push-based forward combine. Backward mirrors this with pull reverse-combine and push reverse-dispatch, all served by one schedule table costing <3% of MoE runtime.
  • Overlap granularity: Targets a middle ground between Comet (fine-grained) and DeepEP (coarse-grained), using a heuristic that ensures at least two full SM waves per expert-grouped GEMM. For Kimi 2.5 shapes, the token floor is 2,368 tokens.
  • Ring token buffer: A fixed ring buffer of a few hundred megabytes cycles at minibatch granularity, interleaving dispatch and combine at macrobatch boundaries. The ring is walked in reverse during backward to minimize forward activation replay. Zero tokens are dropped, and CPU-GPU synchronization is eliminated.
  • Benchmarks: Tested on single NVL72 rack (EP degree 64, 2,048 tokens/GPU) against NCCL+PyTorch, DeepEP+PyTorch, DeepEP+TransformerEngine, and HybridEP+Megatron across Kimi K2.7 Code, GLM-5.2, Qwen3.5-397B-A17B, and DeepSeek-V4-Pro shapes. MXFP8 forward: 2.37x, MXFP8 backward: 1.78x, BF16 forward: 1.92x, BF16 backward: 1.58x. End-to-end on 512 GPUs: 760.9 → 1,070.2 tokens/sec/GPU (1.41x).

Industry Insight

  • MoK's hardware requirements (Blackwell SM100/SM103, NVL72 racks) create a high barrier to entry, concentrating competitive advantage among frontier labs, well-funded startups, and GPU neoclouds—smaller teams with 8-GPU setups cannot realistically adopt this optimization.
  • The pull-based dispatch design that eliminates cross-GPU completion signals and reduces signaling overhead by 5.8x could become a reference pattern for future MoE communication libraries, potentially influencing the broader ecosystem beyond the NVL72 form factor.
  • As MoE architectures continue to dominate frontier model development (DeepSeek-V3, Kimi, etc.), fused megakernel approaches that remove CPU bottlenecks will likely become standard practice for large-scale training, pushing the industry toward more integrated software-hardware co-design.

TL;DR

  • Cursor Research开源Mixture-of-Kittens (MoK),将MoE训练中的所有通信与计算步骤融合为单一确定性megakernel,已驱动Composer模型在数万GPU上训练
  • MoK在GB300 NVL72机架(72 GPU NVLink域)上实现最高2.37x吞吐量提升(MXFP8前向),端到端512 GPU测试达1.41x加速(760.9→1,070.2 tokens/sec/GPU)
  • 三大核心设计:pull-based dispatch + push-based combine(信令从103µs降至18µs)、中等粒度overlap(目标≥2个SM wave)、ring token buffer消除CPU-GPU同步
  • 仅支持NVIDIA Blackwell SM100/SM103(GB200/GB300 NVL72),Apache-2.0许可,适用DeepSeek-V3风格MoE模型预训练与on-policy RL后训练

为什么值得看

MoK揭示了MoE训练从"计算瓶颈"向"通信瓶颈"转移的范式转变,为下一代万亿参数模型训练提供了可复用的工程蓝图。其开源决定标志着顶级AI实验室开始将内部训练基础设施公共化,可能加速整个行业的MoE训练优化竞赛。

技术解析

  • 架构突破:MoK将MoE层的所有通信(expert dispatch/combine)和计算(GEMM、路由梯度)融合为单一确定性megakernel,解决MoE层占端到端训练时间超50%的瓶颈问题。支持BF16和MXFP8精度,路由梯度采用SonicMoE风格计算并融合进SwiGLU反向传播。
  • 通信策略创新:针对NVLink双向带宽利用,采用pull-based前向dispatch(18µs信令)+ push-based前向combine的混合策略,相比纯push方案在expert imbalance场景下提升29% NVLink带宽利用率,消除跨GPU完成信号依赖。
  • 重叠粒度与缓冲设计:介于Comet(细粒度)和DeepEP(粗粒度)之间,启发式目标为每expert-grouped GEMM至少2个完整SM wave(Kimi 2.5形状下floor为2,368 tokens)。ring token buffer(数百MB)在minibatch粒度循环,macrobatch边界交错dispatch/combine,反向时逆序遍历以最小化activation replay。
  • 基准测试:单NVL72机架EP=64、每GPU 2,048 tokens。对比NCCL+PyTorch、DeepEP+PyTorch、DeepEP+TransformerEngine、HybridEP+Megatron。模型形状覆盖Kimi K2.7 Code、GLM-5.2、Qwen3.5-397B-A17B、DeepSeek-V4-Pro。MXFP8前向2.37x、MXFP8反向1.78x、BF16前向1.92x、BF16反向1.58x。
  • 部署门槛:要求Python 3.12+、PyTorch 2.10+、CUDA 13.0+、NVIDIA Blackwell SM100/SM103 GPU(GB200/GB300 NVL72机架),跨GPU缓冲依赖PyTorch symmetric memory。适用对象为前沿实验室、融资模型初创公司、GPU neocloud和国家级计算中心。

行业启示

  • MoE训练基础设施正在形成新的护城河:MoK的性能优势高度依赖NVL72的72 GPU NVLink域和Grace CPU架构,这强化了"硬件+软件协同设计"的竞争壁垒,中小团队难以复制,可能加剧AI训练资源的集中化趋势。
  • 开源megakernel成为新范式:Cursor将内部训练核心组件开源(Apache-2.0),表明顶级实验室正从"闭源模型竞争"转向"开源基础设施影响力和标准制定",可能催生围绕MoE训练的工具链生态。
  • 通信优化取代计算优化成为新焦点:MoK的成功证明在Blackwell时代,MoE训练的瓶颈已从GPU计算转移到NVLink通信和CPU-GPU同步,行业研发资源将向通信调度、overlap策略和确定性训练方向重新分配。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 Training 训练 GPU GPU LLM 大模型 Research 科学研究