Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

LLM Pretraining Engineering: Frameworks, Parallelism, and Scaling Laws

AI summary

The supplied article surveys large-model pretraining, covering data, tokenization, optimizers, memory, distributed parallelism, checkpoints, and model evaluation. It compares Megatron-LM, DeepSpeed, and torchtitan; explains the different configuration guidance in Kaplan’s and Chinchilla’s scaling laws; and discusses cost estimation, loss spikes, checkpoint recovery, and resuming distributed training. Framework and performance characterizations are the article’s assessments, while its cost calculation is presented without accompanying source calculations.

In-depth insight

The article organizes major framework choices, parallelism strategies, scaling-law guidance, and operational practices relevant to planning a large-scale pretraining run. Only one report was supplied, so its evaluative framework comparisons and cost claims warrant independent verification.

在上一篇《学习大模型训练的分布式并行策略》中,我们学习了把一个超大模型拆到成百上千张 GPU 上的几种手段:数据并行、张量并行、流水线并行。这些策略组合起来,就是常说的 3D 并行,是预训练能在万卡集群上跑起来的基础。

上一篇我们是从原理层面逐个拆开讲的,真到动手训练时,没有人会照着论文从零手写这些并行逻辑。业界已经有几个久经考验的开源框架,把并行策略、显存优化、通信调度都实现好了。今天我们就来看看预训练的工程全景,主流框架怎么选、模型规模怎么定、一次真实的预训练从实验到发布要经历哪些环节。

训练框架概述

预训练框架要解决的问题,就是把上一篇讲的那些并行策略变成配置项,同时把通信和显存压榨到位。目前主流的选择有三个:

框架出品方核心特点代表技术
Megatron-LMNVIDIA3D 并行的鼻祖,性能调优极致张量并行、流水线并行
DeepSpeed微软ZeRO 的出处,生态和文档完整ZeRO 三个阶段的显存切分
torchtitanPyTorch 官方纯原生 API 实现,代码简洁FSDP2、DTensor 组合式并行

#Megatron-LM#DeepSpeed#torchtitan#NVIDIA#Microsoft#PyTorch#OpenAI#DeepMind#Hugging Face Transformers#TRL#DeepSeek-V3#Chinchilla

Original · 19 min readRead the original
Group chat

No comments yet. Start the conversation.