분산 MoE 학습을 위한 메모리 효율적인 전문가 라우팅
Memory-Efficient Expert Routing for Distributed MoE Training
한국어 초록
전문가 혼합(MoE) 모델이 수백 개의 전문가와 더 높은 top-$k$ 라우팅으로 확장됨에 따라, 분산 학습(training)에서의 메모리 효율성은 중요한 병목 현상이 되고 있습니다. 최대 메모리 사용량은 어텐션(attention)이 아니라 MoE 블록에 의해 지배됩니다. MoE 디스패치 파이프라인의 모든 중간 버퍼가 top-$k$ 라우팅에 의해 개별적으로 스케일링되기 때문입니다. 표준 all-to-all 디스패처는 라우팅된 모든 토큰(token)을 단일 집합 통신(collective) 단계로 전송하므로, 전체 top-$k$ 확장 버퍼를 한 번에 구성해야 합니다. 본 연구에서는 전문가 가중치나 토큰이 순환하는 동안 로컬에서 연산을 수행하여 전체 top-$k$ 확장 디스패치 버퍼의 생성을 방지하는 링 기반 MoE 실행 모델인 RelayMoE를 제안합니다. RelayMoE는 통신량에 따라 전문가 라우팅과 토큰 라우팅 중 하나를 선택하며, 전송과 연산을 중첩(overlap)합니다. 이러한 링 구조는 역전파 과정에서 메모리 효율적인 MoE 재연산을 자연스럽게 지원합니다. 즉, 각 홉(hop)에서 전문가 중간값을 재구성하고, 이를 사용해 그래디언트를 계산한 뒤, 다음 홉으로 넘어가기 전에 메모리를 해제합니다. 이렇게 절약된 메모리는 더 긴 시퀀스와 더 큰 배치를 지원하거나, 더 많은 어텐션 활성화를 유지하여 어텐션 재연산을 줄이고 학습 처리량을 향상시킬 수 있습니다. 우리는 30B$-$57B 규모의 프로덕션 MoE 모델(model) 및 다양한 전문가 구성에서 RelayMoE를 평가합니다. 단일 층(layer) MoE 실험에서 RelayMoE는 Megatron-LM 대비 평균 2배($2\times$)의 속도 향상을 달성합니다. 동일한 GPU 메모리 예산 하에서의 전체 모델 학습에서는 처리량을 최대 2.02배($2.02\times$) 향상시키고, 테스트된 최대 학습 가능 시퀀스 길이를 최대 2.85배($2.85\times$)까지 확장합니다.
원문 초록
As Mixture-of-Experts (MoE) models scale toward hundreds of experts and higher top-$k$ routing, memory efficiency in distributed training becomes a critical bottleneck. Peak memory is dominated by the MoE block, not attention: every intermediate buffer in the MoE dispatch pipeline is individually scaled by top-k routing. The standard all-to-all dispatcher sends all routed tokens in a single collective step, requiring the full top-$k$-expanded buffer to be constructed at once. In this work, we propose RelayMoE, a ring-based MoE execution model that computes locally as expert weights or tokens circulate, avoiding full top-$k$-expanded dispatch buffers. RelayMoE selects between expert and token routing according to communication volume and overlaps transfers with computation. The ring structure naturally supports memory-efficient MoE recomputation during backward: each hop reconstructs expert intermediates, uses them to compute gradients, and releases them before the next hop. The saved memory supports longer sequences and larger batches, or retains more attention activations to reduce attention recomputation and improve training throughput. We evaluate RelayMoE on 30B$-$57B production MoE models and varied expert configurations. In single-layer MoE experiments, RelayMoE achieves a $2\times$ average speedup over Megatron-LM. In full-model training under the same GPU memory budget, it improves throughput by up to $2.02\times$ and extends the largest tested trainable sequence length by up to $2.85\times$.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.