MegaFold提升3D注意力蛋白模型训练效率,支持更长序列和跨平台GPU加速。
MegaFold: Efficient Training of Next-Generation 3D Attention Protein Models on Cross-Platform GPUs
- 设计内存高效的3D注意力核与通信优化分片策略,降低计算与存储开销。
- 在32张GPU上实现序列长度提升3.36倍,端到端训练时间减少1.73倍(NVIDIA)。
- 适配NVIDIA与AMD GPU,解决蛋白模型训练中数据管道瓶颈问题。
近期生物分子建模进展得益于如AlphaFold3(AF3)等模型,其在Transformer架构中引入科学启发式改进。与传统Transformer不同,AF3类模型采用对2D成对表示的3D注意力机制,导致张量计算与内存消耗随序列长度呈立方级增长。尽管参数量中等,但其训练成本远高于同等规模的Transformer,严重受限于GPU显存容量。分析表明,3D注意力从根本上改变了训练负载,产生大量3D注意力图、复杂的操作间依赖、内核碎片化及繁重的主机侧数据流水线,与大语言模型训练差异显著,导致现代GPU利用率低下。现有GPU优化难以应对这些挑战,因3D注意力引入了复杂的跨层操作依赖。为此,我们提出MegaFold,一种面向下一代3D注意力蛋白模型的高效跨平台训练系统。MegaFold融合了内存高效的3D注意力核、针对二次表示的通信优化分片策略、关键执行路径的融合操作实现,以及消除预处理停顿的确定性感知主机-设备流水线。在NVIDIA H200与AMD MI250 GPU上的评估显示,MegaFold使32张GPU上的训练支持序列长度延长达3.36倍,端到端执行时间最多减少1.73倍(NVIDIA)和1.62倍(AMD)。
原文摘要 · Abstract (English)
Recent advances in biomolecular modeling have been catalyzed by models such as AlphaFold3 (AF3), which introduce science-informed changes to the transformer architecture. Unlike transformers, a defining characteristic of AF3-style models is their 3D attention over 2D pairwise representations which produces tensors whose computation and memory costs scale cubically with sequence length. As a result, despite moderate parameter counts, AF3-style models are far more expensive to train than size-equivalent transformers, and are severely constrained by GPU memory capacity. Our characterization shows 3D attention fundamentally changes the training workload, causing massive 3D attention maps, complex inter-operator dependencies, kernel fragmentation, and heavy host-side data pipelines which differ substantially from LLM training, leading to poor utilization on modern GPU systems. Moreover, existing GPU optimizations do not adequately address these challenges due to complex cross-layer inter-operator dependencies introduced by 3D attention. Motivated by these challenges, we introduce MegaFold, a novel cross-platform system for efficient training of next-generation 3D-attention protein models. MegaFold combines a memory-efficient 3D-attention kernel, a communication-efficient sharding strategy for quadratic representations, fused operator implementations for critical execution paths, and a determinism-aware host-device pipeline that eliminates preprocessing stalls. Evaluation on both NVIDIA H200 and AMD MI250 GPUs shows that MegaFold enables training with up to 3.36$\times$ longer sequence lengths on 32 GPUs while reducing end-to-end execution time by up to 1.73$\times$ (NVIDIA) and 1.62$\times$ (AMD).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。