Skip to content
View original post on X: meng shao
Published
Same story75/100

Hugging Face publishes a free Ultimate MoE Training Handbook from 800k GPU hours of experiments

AIHugging Face says it ran about 800k GPU hours of MoE experiments and released the results as The Ultimate MoE Training Handbook, a free, open guide of about 70k words with 55 interactive figures and runnable code. The guide covers expert count and size, all-to-all communication overhead, router choice with FP32 precision, and auxiliary loss versus loss-free bias for load balancing.
meng shaoVerified on X
@shao__meng
View on X

Hugging Face team spent ~800,000 GPU hours on experiments and compiled them into a free, open "Ultimate MoE Training Handbook"

The full text is about 70,000 words, with 55 interactive figures, runnable code, and real experimental data. It centers on the problems training teams most often run into: how to choose the number and size of experts, why cross-GPU communication slows training, how to set up routing and load balancing, and whether to convert a dense model or train from scratch. It is an engineering guide that systematically makes scattered MoE training experience public, for practitioners to consult repeatedly.
https://huggingface.co/spaces/huggingface/moe-blogpost

What exactly does MoE save?

MoE replaces part of the feed-forward network with multiple experts. A router selects several of them for each token, and then merges their outputs. As a result, a model can increase its total parameter count without increasing per-token computation in the same proportion.

The example in the text has 64 experts, selects 8 for each token, and gives each expert a width of 1024. Compared with a dense feed-forward layer of width 8192, it stores about 8 times as many parameters, yet the total expert width each token uses is the same. What it saves is activated computation, not the storage needed for all parameters; the example model as a whole has about 6.86 billion total parameters and 1.22 billion activated parameters.

The real difficulty lies in three areas

1. Routing must be stable. Expert selection depends on score ranking, and low precision can change close scores and therefore the selection results. The handbook therefore stresses computing routing in FP32, and discusses the trade-offs between different routing methods.

2. Expert load must be balanced. If large numbers of tokens flock to a few experts, other devices have to wait. The article compares methods such as auxiliary losses and bias adjustment that needs no auxiliary loss. A control experiment with forced uniform routing ran about 1.5 times faster, but it discards the learned routing, so it only shows the speed headroom and cannot be used directly as a training scheme.

3. Communication must not cancel out the computational gains. Once experts are spread across different GPUs, every layer has to dispatch tokens and collect results. In one performance analysis in the text, communication not hidden by computation accounted for about half of a step; in a case where a network misconfiguration made communication fall back to ordinary sockets, the run was even about 25 times slower.

Extending from training to deployment and reinforcement learning

The handbook recommends first checking hardware and networking and establishing a dense-model baseline, then adding MoE settings one at a time, rather than turning on all optimizations at once.

When deploying, reducing the number of experts selected per token lowers computation, but it does not automatically reduce the VRAM needed to hold the model weights, and it may affect quality. Reinforcement learning raises an additional problem: the inference engine that generates training data and the training engine may select different experts, causing their execution paths to diverge.

AITranslated from Chinese
Thomas Wolf@Thom_Wolf
18 of the 20 best open models today are Mixture-of-Experts. Dense is basically over. And yet the know-how to train a good MoE still lives mostly in the heads of a handful of teams. So we spent 800k GPU hours running the experiments ourselves and wrote everything down. Super happy to finally release "The Ultimate MoE Training Handbook", free and open, organized around the questions training teams hit: - how many experts, how big, shared or not? - why is half my step spent in all-to-all, and how do I hide it? - why is my run 25x slower with no error in the logs? - softmax, sigmoid or sqrt(softplus) router, and why keep it in fp32? - aux loss or DeepSeek's loss-free bias? - upcycle a dense checkpoint or train from scratch? - can I serve with fewer experts per token than I trained with? ⚠️ Warning: it's long (~70k words, budget a few days, sorry) but with 55 interactive figures, code you can run and numbers from our own runs. Read it here: https://huggingface.co/spaces/huggingface/moe-blogpost
View quoted post on X

This story is featured in top picks: “Hugging Face publishes a handbook on MoE training optimization”

Source details

meng shao · x.comPublished · added here

Original title: Hugging Face 团队投入 ~80 万 GPU 小时开展实验,整理成免费开放的「终极 MoE 训练手册」