Account

Posts of Data Scientology

newest first

#49482Link preview
Views56−43%vs avg
Forwards—
Reactions—
Comments—
#49480Link preview
Views88−10%vs avg
Forwards—
Reactions—
Comments—
#49475Link preview

The Ultimate MoE Training Handbook: training Mixture-of-Experts models with Megatron-LM, setting by setting P Handbook: https://huggingface.co/spaces/huggingface/moe-blogpost Hello, I'm Nouamane, one of the authors. I'm at Hugging Face and also worked on the Ultra-Scale and Smol Training Playbooks, if you've read those. This handbook is for people who have trained a dense model and want to train an MoE next, or who are curious how MoE training works. Chapter 2 is a Megatron-LM runbook: test the hardware, build the image, train a dense baseline, then a first MoE on one node, compared against that baseline. Chapter 3 takes the MoE layer apart (router, routing, load balancing, experts, block layout, training, systems). For each part we give the Megatron-LM code, what to watch, our recommendation, and what frontier MoEs chose. Chapter 4 follows the model into serving and RL. Chapters 3 and 4 need no GPU. When a result comes from our runs, we say so. Claims about frontier models cite their paper, config or code, and the toy simulations are labelled as such. The lessons come from about 800k GH200 GPU-hours allocated to MoE training on the Alps cluster at CSCS. Released: the handbook, its 55 figures as a gallery (https://huggingface.co/spaces/huggingface/moe-gallery), the scripts (https://gist.github.com/nmntz/5de952d686f66d7bce5bce8cba9d7139), and every recommended flag in one Megatron-LM block. Happy to answer questions. 🤗 https://redd.it/1xorgq0 @datascientology

Open in Telegram
Views136+39%vs avg
Forwards—
Reactions—
Comments—
#49474Link preview
Views104+7%vs avg
Forwards—
Reactions—
Comments—
#49467Link preview
Views116+19%vs avg
Forwards—
Reactions—
Comments—
#49466Link preview

Working through the Transformer forward pass by hand, one matrix at a time, is what finally made it click for me When I read *Attention Is All You Need*, the equations made sense line by line, but I couldn't picture the whole forward pass. What helped was writing out every matrix for a tiny example, noting its shape at each step, and doing the multiplications myself. A few things only clicked once I did it that way: * **Positional encoding.** Sine and cosine at different frequencies give every position its own signature, and the model doesn't have to learn one vector per position. Working out a 6 × 512 table by hand made it obvious why the authors hoped it would extend to sequences longer than any seen in training. * **Shapes barely change.** In the encoder, the matrix goes in as (tokens × d\_model) and comes out the same size after every layer. All the interesting work happens inside that fixed shape. * **BERT is mostly the same picture.** Once the encoder was clear, BERT turned out to be a small edit to it: a packed sentence pair, segment embeddings, and two small heads on top for the masked word and the next sentence. I wrote my notes up as step-by-step pages with practice exercises beside each step and a notebook that checks your answers, in case it's useful to anyone learning the same way: [https://guptaaditya95.github.io/llmbreakdown/](https://guptaaditya95.github.io/llmbreakdown/) I'm curious how others built their intuition for these models. Did working the math by hand help you, or did something else make it click? And which architecture was hardest to picture? https://redd.it/1xh9j50 @datascientology

Open in Telegram
Views119+22%vs avg
Forwards—
Reactions—
Comments—