Sonar-MoE:用于内存高效型混合专家(MoE)训练的反向传播中专家更新方法
Sonar-MoE: In-Backward Expert Updates for Memory-Efficient Mixture-of-Experts Training
AI总结:
Sonar-MoE将反向传播中优化器机制应用于MoE训练,通过反向传播中更新专家张量并立即释放梯度,降低峰值内存19%-22%,同时减少训练时间17%-23%,且性能与标准训练相当。
摘要:
混合专家(MoE)模型的大部分参数属于其专家模块,标准训练会将每个专家的梯度保留在GPU内存中直至优化器步骤。该内存会随专家的数量和规模增长,因此MoE模型扩展时内存占用也会上升。我们提出Sonar-MoE,该方法在反向传播过程中更新每个专家张量并立即释放其梯度,将密集模型的反向传播中优化器机制应用于批量MoE专家张量,使GPU最多仅保留一层专家梯度。我们在bf16精度下对OLMoE-1B-7B和Granite-3.1-3B-A800M进行微调,使用两个专家内核后端,Sonar-MoE可将峰值内存降低19%至22%;其更新结果与无专家梯度裁剪的标准训练完全一致,保留的损失与所有基准的差值不超过0.003;每步训练时间比使用全局范数裁剪的标准训练少17%至23%。通过更新整个批量张量而非单个专家,Sonar-MoE避免了20%至72%的速度下降,同时保持了与反向传播中优化器在内存和速度上的匹配效果,且仍对密集参数进行裁剪。
英文摘要:
Most parameters of a Mixture-of-Experts (MoE) model belong to its experts, and standard training keeps every expert gradient in GPU memory until the optimizer step. This memory grows with the number and size of the experts, so it rises as MoE models scale. We introduce Sonar-MoE, which updates each expert tensor during the backward pass and frees its gradient right away. It brings optimizer-in-backward from dense models to batched MoE expert tensors, so the GPU never holds more than one layer of expert gradients. When we fine-tune OLMoE-1B-7B and Granite-3.1-3B-A800M in bf16 with two expert-kernel backends, Sonar-MoE lowers peak memory by 19% to 22%. Its updates are bitwise identical to standard training without expert gradient clipping, and held-out loss stays within 0.003 of all baselines. Each step also takes 17% to 23% less time than standard training with global-norm clipping. Updating whole batched tensors rather than individual experts is what keeps Sonar-MoE fast, as it avoids a 20% to 72% slowdown while using the same memory. Sonar-MoE matches optimizer-in-backward over all parameters in memory and speed while still clipping the dense parameters.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。