Flattening Every Memory Peak in Long-Context Mixture-of-Experts Training

Shrey Pandit, Xuan-Phi Nguyen, Yiran Zhao, Shafiq Joty

Salesforce AI Research

Published September 13, 2026 · on the feed September 17, 2026 · ▲ 19 · arXiv 2609.14306

Model architectureTheory & statistics No code arXiv ↗Hugging Face ↗

The abstract

Training a Mixture-of-Experts (MoE) model at long context or large batch size fails as soon as any one component's peak allocation exceeds device memory, so the target is every peak at once, not the average footprint. Four are left unbounded by the parallelism plans in common use, and each grows differently: expert dispatch with the routing matrix, the vocabulary projection with tokens times vocabulary, gradient checkpoint boundaries with depth times sequence length, and optimizer state with parameter count. Which one runs out first changes with the model, the context length, and the device count, so lowering the largest only exposes the next. We bound all four with schedules whose GPU working set is fixed at launch: PipelinedLLEP extends least-loaded expert parallelism with a cap on the tokens each source contributes to a dispatch chunk, Ring-DTP circulates activations or weight shards around a ring at the vocabulary projection and folds each block of logits into an online log-sum-exp, Selective checkpoint offload (SCO) keeps the one long-lived tensor of each checkpoint boundary in CPU memory, and OffloadStreamAdamW turns the serial CPU Adam update of optimizer offload into a bucket pipeline. All four change only the order and granularity of computation and data movement, so the loss and gradients stay exact. In matched component tests, they cut the MoE dispatch peak by up to 59.3% without losing throughput, the vocabulary projection peak by 86.6%, and the offloaded optimizer step by 2.05times faster. Composed on MoE models from 120B to 667B parameters, they train at 1M context length, 8--32times the reach of a tuned FSDP2 baseline, and up to 10.4times its throughput.

The Brief

3:10

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Flattening Every Memory Peak in Long-Context Mixture-of-Experts Training. By Shrey Pandit and three others, from Salesforce AI Research. Published on the thirteenth of September. No code repository is linked to it.

Training a Mixture-of-Experts model, MoE, at long context or large batch size fails the moment any single component's peak memory allocation exceeds what the device holds. The average footprint does not matter. What matters is every peak, all at once. The authors identify four peaks that the parallelism plans in common use leave unbounded, and each grows in its own way. It is a game of whack-a-mole, and the only way to win is to hold every peak down at the same time.

Expert dispatch grows with the routing matrix. The vocabulary projection grows with the number of tokens times the size of the vocabulary. The boundaries where gradients are checkpointed grow with depth times sequence length. And optimizer state grows with the parameter count. Which of these runs out first changes with the model, the context length, and the number of devices. So lowering the largest peak only exposes the next one behind it.

The answer is to bound all four together, each with a schedule whose GPU working set is fixed at launch. However long the context or large the model, the memory each component needs on the device is decided in advance and does not grow. Crucially, all four schedules change only the order and granularity of computation and data movement. None changes the arithmetic, so the loss and the gradients stay exact.

PipelinedLLEP extends least-loaded expert parallelism with a cap on how many tokens each source may contribute to one dispatch chunk. Ring-DTP handles the vocabulary projection by circulating activations or weight shards around a ring, and folds each block of logits into an online log-sum-exp, so the full set of logits never has to exist at once. No single source can then flood a chunk with its tokens.

Selective checkpoint offload, SCO, keeps the one long-lived tensor at each checkpoint boundary in CPU memory rather than on the GPU. And OffloadStreamAdamW takes the serial CPU Adam update used in optimizer offload and turns it into a pipeline over buckets, so the update streams instead of waiting in line. Between them, the four schedules match the four peaks one to one: dispatch, vocabulary, checkpoints, and optimizer.

In matched tests of each component, the schedules cut the MoE dispatch peak by up to fifty-nine point three percent without losing throughput, and cut the vocabulary projection peak by eighty-six point six percent. The offloaded optimizer step runs two point zero five times faster.

Composed together, on MoE models from one hundred and twenty billion parameters up to six hundred and sixty-seven billion, they train at a context length of one million tokens. That is eight to thirty-two times the reach of a tuned FSDP2 baseline, with up to ten point four times its throughput.

The framing is what does the work here. Memory failure in long-context MoE training is treated not as one bottleneck to be squeezed but as four independent ceilings, any of which can be the one that breaks. Fixing the working set of each in advance, while leaving the mathematics untouched, is what lets the whole run scale without trading away exactness.

Paper Quest · 7 chapters · about 40 min

Play this paper

Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.

Chapter 1 🧩 · The problem

Four memory peaks, and any one of them can end the run. Start there.

You are training a huge Mixture-of-Experts model at very long context. A step dies the moment any one component's memory peak exceeds the GPU, so the average footprint does not matter.

The road ahead

  1. 1 · The problem ~6 min Training a huge Mixture-of-Experts model at long context fails as soon as any single memory peak overflows the GPU, and four peaks grow in different ways.
  2. 2 · What came before ~3 min
  3. 3 · The key idea ~9 min Bound all four memory peaks at once, each with a schedule whose GPU working set is fixed at launch, changing only order and granularity so results stay exact.
  4. 4 · Choose your own research ~3 min
  5. 5 · Build the method ~8 min Three of the schedules: cap tokens per source in each dispatch chunk, fold logit blocks into an online log-sum-exp, and stream the Adam update in buckets.
  6. 6 · The experiment ~6 min You’ll guess: In matched component tests, by how much did Ring-DTP cut the peak memory of the vocabulary projection?
  7. 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Join free to play the whole quest ›

Free, with Google or an email address. Your stars and progress are kept.

KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.