diff --git a/PROGRESS.md b/PROGRESS.md index 1519cc0..81fd022 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -14,7 +14,7 @@ | 推理与测试时扩展 | 完成首版 | 76% | 真实模型采样曲线、PRM 案例与逐篇图表精读 | | 稀疏计算与 MoE | 完成首版 | 74% | 真实负载 traces 与专家特化案例 | | 长上下文专题 | 完成首版 | 72% | 真实模型配置、内核细节与失败案例 | -| 大规模训练系统 | 研究完成首轮 | 38% | 实现内存—并行—流水线—通信四页签实验室 | +| 大规模训练系统 | 完成首版 | 71% | 真实集群 traces、故障案例与精确 topology 配置 | | 引用与事实检查 | 进行中 | 54% | 自动化外链复查与来源等级扩展 | | 开源仓库 | 已完成首版 | 100% | 持续提交研究与网站迭代 | | k1412 部署 | 已完成首版 | 100% | 每轮发布保留不可变镜像与回滚点 | @@ -28,10 +28,10 @@ - [x] 提炼参考网站的编辑设计语言。 - [x] 确认 `git.k1412.top` 为 Gitea/Forgejo 兼容服务且本机 HTTPS 凭据可用于既有仓库。 - [x] 使用 Grok CLI 检索并形成约 95 篇一手论文的补充路线,主代理已回查关键来源。 -- [x] 完成 146 篇关键论文索引,覆盖 12 个专题与 Kimi/DeepSeek 聚光主线。 +- [x] 完成 166 篇关键论文索引,覆盖 12 个专题与 Kimi/DeepSeek 聚光主线。 - [x] 完成可检索、可按专题筛选的论文库页面。 -- [x] 完成 K3、Transformer 基础、DeepSeek 谱系、长上下文、MoE 与推理六篇首版长文。 -- [x] 完成 K3 三轴架构、Self-Attention、DeepSeek 谱系、长上下文、MoE 路由与推理专题三页签等八个原创交互视图。 +- [x] 完成 K3、Transformer 基础、DeepSeek 谱系、长上下文、MoE、推理与训练系统七篇首版长文。 +- [x] 完成 K3 三轴架构、Self-Attention、DeepSeek 谱系、长上下文、MoE 路由、推理三页签与训练系统四页签等十二个原创交互视图。 - [x] 完成长上下文首版:五张成本账、26 篇一手论文、10+ 机制图与 8 策略交互实验室。 - [x] 核验 FlashAttention、DeepSeek-V2/V3.2/V4、Kimi Linear/K3 等六份论文原文,并建立长上下文研究账本。 - [x] 核验 Switch、ST-MoE、DeepSeekMoE、Loss-Free、V3、LatentMoE 与 K3 原文,并建立 MoE 研究账本。 @@ -44,14 +44,16 @@ - [x] 训练系统专题完成首轮证据账本:九张资源账、37 个一手节点、DeepSeek-V2/V3/V4 与 Kimi K2/K2.5/K3 系统谱系。 - [x] 缓存并核验 18 篇训练系统核心论文,逐项校正 ZeRO 字节账、pipeline bubble、collective 口径、context parallel 与 MoonEP 上界。 - [x] 将 Grok 产物降级为明确标注的未核验 leads;正式账本只采用回查一手论文后的结论。 -- [x] Astro 类型检查、生产构建、10 个内部路由和桌面/移动端视觉检查通过。 +- [x] 完成训练系统首版:15 节长文、37 个一手节点、12 类机制图与显存—网格—气泡—通信四页签实验室。 +- [x] 训练系统真实 Chrome 断言通过:OOM、无效 mesh、DualPipe 参数副本、overlap 与 MoonEP buffer 均正确响应。 +- [x] Astro 类型检查、生产构建、11 个内部路由和桌面/移动端视觉检查通过。 - [x] 创建 `wuyang/llm-atlas` 公开仓库,匿名 API 确认 `private: false`。 -- [x] 本地生产镜像通过健康检查与全部 9 个页面路由烟雾测试。 +- [x] 上一生产镜像通过健康检查与当时全部页面路由烟雾测试。 - [x] 通过 Unraid Compose Manager、Nginx Proxy Manager 与 HTTPS 发布首版。 ## 正在进行 -- [ ] 大规模训练系统:实现四页签实验室与 ZeRO / Megatron → Expert/Context Parallel → DualPipe / MoonEP 长文。 +- [ ] 大规模训练系统二轮:真实集群 traces、故障恢复案例与精确 topology / kernel 配置。 - [ ] 推理专题二轮:真实 pass@k 曲线、PRM 失败案例与逐篇图表精读。 - [ ] 长上下文专题的真实模型配置对比、内核细节与失败案例二轮深化。 - [ ] MoE 专题的真实集群 traces、专家特化案例与二轮外部证据。 @@ -79,6 +81,8 @@ | 2026-07-29 | 并行度不再机械写成 `DP×TP×PP×EP×CP` | 先定义 device mesh、group overlap 与作用范围,再核算 world size | | 2026-07-29 | DeepSeek “近零通信”统一解释为特定 overlap 下的 exposed critical-path time | 防止把隐藏通信误写成没有传输字节 | | 2026-07-29 | Grok 训练系统包只保留为 `TRAINING_SYSTEMS_GROK_LEADS.md` | 候选论文、数字和公式不得越过一手证据账本直接进入站点 | +| 2026-07-29 | 训练系统首版用四个独立实验闭环 | 显存、device mesh、pipeline 与通信不合成一个伪“系统总分” | +| 2026-07-29 | 论文库随训练系统一手链扩充到 166 篇 | 新增 checkpoint、mixed precision、自动并行、FSDP、MoE/CP 与大集群系统节点 | ## 未决问题 diff --git a/README.md b/README.md index 6aff892..b814877 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ - 持续进度:[PROGRESS.md](./PROGRESS.md) - 证据与写作规范:[research/METHODOLOGY.md](./research/METHODOLOGY.md) -当前里程碑包含 16 专题学习地图、146 篇关键论文索引、Kimi K3 完整导读、 -Transformer 基础、DeepSeek 技术谱系、长上下文与 MoE 深度专题,以及五张原创交互可视化。 +当前里程碑包含 16 专题学习地图、166 篇关键论文索引、Kimi K3 完整导读、 +Transformer 基础、DeepSeek 技术谱系、长上下文、MoE、推理与训练系统深度专题, +以及覆盖核心机制的原创交互实验室。 其余专题按进度账本持续扩建。 ## 本地开发 diff --git a/package.json b/package.json index 12aa527..82fd26b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "check": "astro check", "check:site": "node scripts/check-site.mjs", "check:moe-browser": "node scripts/check-moe-browser.mjs", - "check:reasoning-browser": "node scripts/check-reasoning-browser.mjs" + "check:reasoning-browser": "node scripts/check-reasoning-browser.mjs", + "check:training-systems-browser": "node scripts/check-training-systems-browser.mjs" }, "dependencies": { "@astrojs/sitemap": "3.7.3", diff --git a/research/TRAINING_SYSTEMS_RESEARCH.md b/research/TRAINING_SYSTEMS_RESEARCH.md index 73bcf4e..5107493 100644 --- a/research/TRAINING_SYSTEMS_RESEARCH.md +++ b/research/TRAINING_SYSTEMS_RESEARCH.md @@ -1128,21 +1128,20 @@ K2 明确没有沿用 DualPipe: - [x] AgentENV 数字标为 K3 报告统计,不外推。 - [ ] 所有 30+ 论文链接发布前做可达性检查。 - [ ] 页面每个数字回链到邻近的一手来源。 -- [ ] 互动公式写单元测试与浏览器断言。 -- [ ] desktop / mobile / reduced-motion / keyboard 全部验证。 +- [x] 互动公式写单元测试与浏览器断言。 +- [x] desktop / mobile / reduced-motion / keyboard 全部验证。 - [ ] immutable image、NAS、VPS、NPM、HTTPS、公开 Forgejo 全链验证。 ## 首版页面完成闸门 -- [ ] 初学者能在不懂分布式系统的情况下读懂“为什么单卡放不下”。 -- [ ] 能用 byte ledger 解释参数、梯度、master weights 与 optimizer state。 -- [ ] 能区分 DP / TP / PP / EP / SP / CP 的切分对象。 -- [ ] 能解释为什么同样通信字节数仍可能有不同 wall time。 -- [ ] 能从时间轴上读出 GPipe、1F1B、ZeroBubble 与 DualPipe 差异。 -- [ ] 能解释 Ulysses、Ring 与 USP 的数据布局变化。 -- [ ] 能解释 DeepSeek-V3 的系统协同,而不是只背 DualPipe 名字。 -- [ ] 能解释为什么 K2 主动不采用 DualPipe。 -- [ ] 能沿 K2 → K2.5 → K3 读出内存与调度演进。 -- [ ] 能操作四个互动实验并触发至少一个 invalid / OOM / imbalance 情景。 +- [x] 初学者能在不懂分布式系统的情况下读懂“为什么单卡放不下”。 +- [x] 能用 byte ledger 解释参数、梯度、master weights 与 optimizer state。 +- [x] 能区分 DP / TP / PP / EP / SP / CP 的切分对象。 +- [x] 能解释为什么同样通信字节数仍可能有不同 wall time。 +- [x] 能从时间轴上读出 GPipe、1F1B、ZeroBubble 与 DualPipe 差异。 +- [x] 能解释 Ulysses、Ring 与 USP 的数据布局变化。 +- [x] 能解释 DeepSeek-V3 的系统协同,而不是只背 DualPipe 名字。 +- [x] 能解释为什么 K2 主动不采用 DualPipe。 +- [x] 能沿 K2 → K2.5 → K3 读出内存与调度演进。 +- [x] 能操作四个互动实验并触发至少一个 invalid / OOM / imbalance 情景。 - [ ] 论文阅读链、类型检查、链接、浏览器与容器验证全部通过。 - diff --git a/scripts/check-training-systems-browser.mjs b/scripts/check-training-systems-browser.mjs new file mode 100644 index 0000000..00af556 --- /dev/null +++ b/scripts/check-training-systems-browser.mjs @@ -0,0 +1,243 @@ +import { writeFileSync } from "node:fs"; + +const cdpPort = process.env.CDP_PORT ?? "9225"; +const baseUrl = process.env.SITE_URL ?? "http://127.0.0.1:4324"; +const pages = await fetch(`http://127.0.0.1:${cdpPort}/json/list`).then((response) => response.json()); +const page = pages.find((entry) => entry.type === "page"); +if (!page) throw new Error(`CDP ${cdpPort} 没有可用页面`); + +const socket = new WebSocket(page.webSocketDebuggerUrl); +await new Promise((resolve, reject) => { + socket.addEventListener("open", resolve, { once: true }); + socket.addEventListener("error", reject, { once: true }); +}); + +let nextId = 0; +const pending = new Map(); +const exceptions = []; +socket.addEventListener("message", (event) => { + const message = JSON.parse(event.data); + if (message.id && pending.has(message.id)) { + const { resolve, reject } = pending.get(message.id); + pending.delete(message.id); + if (message.error) reject(new Error(message.error.message)); + else resolve(message.result); + } + if (message.method === "Runtime.exceptionThrown") exceptions.push(message.params.exceptionDetails.text); +}); + +const command = (method, params = {}) => new Promise((resolve, reject) => { + const id = ++nextId; + pending.set(id, { resolve, reject }); + socket.send(JSON.stringify({ id, method, params })); +}); +const pause = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)); +const evaluate = async (expression) => { + const result = await command("Runtime.evaluate", { expression, returnByValue: true, awaitPromise: true }); + if (result.exceptionDetails) throw new Error(result.exceptionDetails.text); + return result.result.value; +}; +const navigate = async (path) => { + await command("Page.navigate", { url: `${baseUrl}${path}` }); + for (let attempt = 0; attempt < 50; attempt += 1) { + await pause(100); + if (await evaluate("document.readyState === 'complete'")) return; + } + throw new Error(`${path} 加载超时`); +}; +const screenshot = async (path, full = false) => { + const params = { format: "png", captureBeyondViewport: full }; + if (full) { + const metrics = await command("Page.getLayoutMetrics"); + params.clip = { + x: 0, + y: 0, + width: metrics.cssContentSize.width, + height: metrics.cssContentSize.height, + scale: 1, + }; + } + const result = await command("Page.captureScreenshot", params); + writeFileSync(path, Buffer.from(result.data, "base64")); +}; + +await command("Page.enable"); +await command("Runtime.enable"); +await command("Emulation.setDeviceMetricsOverride", { + width: 1440, + height: 1100, + deviceScaleFactor: 1, + mobile: false, +}); +await navigate("/training-systems/"); +await screenshot("/tmp/llm-atlas-training-systems-desktop.png"); + +const memory = await evaluate(`(() => { + const root = document.querySelector("[data-systems-lab]"); + root.querySelector('[data-memory-preset="single"]').click(); + const single = { + total: root.querySelector("[data-memory-total]").textContent, + verdict: root.querySelector("[data-memory-verdict]").textContent, + overflow: root.querySelector("[data-hbm-card]").classList.contains("is-overflow"), + }; + root.querySelector('[data-memory-preset="k3"]').click(); + return { + single, + k3: { + total: root.querySelector("[data-memory-total]").textContent, + verdict: root.querySelector("[data-memory-verdict]").textContent, + offload: root.querySelector('[data-memory-metric="offload"]').textContent, + formula: root.querySelector("[data-memory-formula]").textContent, + }, + }; +})()`); + +const mesh = await evaluate(`(() => { + const root = document.querySelector("[data-systems-lab]"); + root.querySelector('[data-system-tab="mesh"]').click(); + root.querySelector('[data-mesh-preset="v3"]').click(); + const v3 = { + equation: root.querySelector("[data-mesh-equation]").textContent, + status: root.querySelector("[data-mesh-capacity]").textContent, + invalid: root.querySelector("[data-mesh-status]").classList.contains("is-invalid"), + }; + root.querySelector('[data-mesh-preset="invalid"]').click(); + return { + v3, + invalid: { + equation: root.querySelector("[data-mesh-equation]").textContent, + status: root.querySelector("[data-mesh-capacity]").textContent, + invalid: root.querySelector("[data-mesh-status]").classList.contains("is-invalid"), + }, + }; +})()`); + +const pipeline = await evaluate(`(() => { + const root = document.querySelector("[data-systems-lab]"); + root.querySelector('[data-system-tab="pipeline"]').click(); + root.querySelector('[data-schedule="1f1b"]').click(); + const one = { + copies: root.querySelector('[data-pipeline-metric="copies"]').textContent, + reading: root.querySelector("[data-pipeline-reading]").textContent, + rows: root.querySelectorAll(".timeline-row").length, + }; + root.querySelector('[data-schedule="dual"]').click(); + return { + one, + dual: { + copies: root.querySelector('[data-pipeline-metric="copies"]').textContent, + reading: root.querySelector("[data-pipeline-reading]").textContent, + note: root.querySelector("[data-pipeline-note]").textContent, + }, + }; +})()`); + +const communication = await evaluate(`(() => { + const root = document.querySelector("[data-systems-lab]"); + root.querySelector('[data-system-tab="communication"]').click(); + const overlap = root.querySelector('[data-comm-input="overlap"]'); + overlap.value = "0"; + overlap.dispatchEvent(new Event("input", { bubbles: true })); + const exposed = { + bytes: root.querySelector('[data-comm-metric="bytes"]').textContent, + time: root.querySelector('[data-comm-metric="exposed"]').textContent, + }; + overlap.value = "95"; + overlap.dispatchEvent(new Event("input", { bubbles: true })); + return { + exposed, + hidden: { + bytes: root.querySelector('[data-comm-metric="bytes"]').textContent, + time: root.querySelector('[data-comm-metric="exposed"]').textContent, + }, + moe: { + deep: root.querySelector('[data-moe-metric="deep-buffer"]').textContent, + moon: root.querySelector('[data-moe-metric="moon-buffer"]').textContent, + slots: root.querySelector('[data-moe-metric="slots"]').textContent, + bars: root.querySelectorAll("[data-expert-rank]").length, + }, + }; +})()`); + +const layout = await evaluate(`(() => { + const nav = document.querySelector(".top-nav"); + const meta = document.querySelector(".header-meta"); + return { + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + navGap: Number((meta.getBoundingClientRect().left - nav.getBoundingClientRect().right).toFixed(1)), + navLinks: document.querySelectorAll(".top-nav a").length, + articleSections: document.querySelectorAll(".article-section").length, + paperLinks: document.querySelectorAll(".paper-chain a").length, + labTabs: document.querySelectorAll("[data-system-tab]").length, + }; +})()`); + +await evaluate(`(() => { + document.documentElement.style.scrollBehavior = "auto"; + document.querySelector("[data-systems-lab]").scrollIntoView({ block: "start", behavior: "instant" }); +})()`); +await pause(150); +await screenshot("/tmp/llm-atlas-training-systems-lab-desktop.png"); + +await command("Emulation.setDeviceMetricsOverride", { + width: 390, + height: 844, + deviceScaleFactor: 1, + mobile: true, +}); +await navigate("/training-systems/"); +await screenshot("/tmp/llm-atlas-training-systems-mobile-closed.png"); +const mobile = await evaluate(`(() => { + const toggle = document.querySelector("#menu-toggle"); + toggle.click(); + return { + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + menuVisible: getComputedStyle(toggle).display !== "none", + menuOpen: toggle.getAttribute("aria-expanded"), + title: document.querySelector("h1").innerText, + }; +})()`); + +await command("Emulation.setDeviceMetricsOverride", { + width: 1440, + height: 1100, + deviceScaleFactor: 1, + mobile: false, +}); +await navigate("/"); +const home = await evaluate(`({ + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + releaseCards: document.querySelectorAll(".release-card").length, + firstRelease: document.querySelector(".release-card h2").textContent, + navLinks: document.querySelectorAll(".top-nav a").length, +})`); +await evaluate(`document.querySelector("#new-chapters").scrollIntoView({ block: "start", behavior: "instant" })`); +await pause(100); +await screenshot("/tmp/llm-atlas-home-training-systems-release.png"); + +const report = { memory, mesh, pipeline, communication, layout, mobile, home, exceptions }; +console.log(JSON.stringify(report, null, 2)); + +const numeric = (value) => Number.parseFloat(value); +const failures = []; +if (!memory.single.overflow || !memory.single.verdict.includes("OOM")) failures.push("单卡 OOM 场景未触发"); +if (!memory.k3.formula.includes("14P") || !memory.k3.verdict.includes("可以放入")) failures.push("K3 分层存储预设异常"); +if (mesh.v3.invalid || !mesh.v3.equation.includes("2,048")) failures.push("V3 设备网格异常"); +if (!mesh.invalid.invalid || !mesh.invalid.status.includes("相差")) failures.push("无效设备网格没有被拒绝"); +if (pipeline.one.rows !== 4 || pipeline.one.copies !== "1×") failures.push("1F1B 时间轴异常"); +if (pipeline.dual.copies !== "2×" || !pipeline.dual.note.includes("near-zero")) failures.push("DualPipe 边界解释缺失"); +if (communication.exposed.bytes !== communication.hidden.bytes) failures.push("overlap 错误改变了通信字节"); +if (numeric(communication.exposed.time) <= numeric(communication.hidden.time)) failures.push("overlap 没有降低 exposed time"); +if (communication.moe.bars !== 12 || !communication.moe.slots.includes("E/R")) failures.push("MoonEP 对照异常"); +if (layout.articleSections !== 16 || layout.paperLinks !== 37 || layout.labTabs !== 4) failures.push("章节、论文或实验数量异常"); +if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentOverflow > 0) failures.push("页面存在横向溢出"); +if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); +if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); +if (home.releaseCards !== 4 || !home.firstRelease.includes("一万张 GPU")) failures.push("首页训练系统新章入口异常"); +if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); + +socket.close(); +if (failures.length) { + failures.forEach((failure) => console.error(`- ${failure}`)); + process.exit(1); +} diff --git a/src/components/SiteHeader.astro b/src/components/SiteHeader.astro index cf12692..5da6ea0 100644 --- a/src/components/SiteHeader.astro +++ b/src/components/SiteHeader.astro @@ -13,6 +13,7 @@ const items = [ { id: "moe", href: "/moe/", label: "MoE" }, { id: "long-context", href: "/long-context/", label: "长上下文" }, { id: "reasoning", href: "/reasoning/", label: "推理" }, + { id: "training-systems", href: "/training-systems/", label: "训练系统" }, { id: "papers", href: "/papers/", label: "论文库" }, { id: "progress", href: "/progress/", label: "进度" }, ]; diff --git a/src/components/TrainingSystemsLab.astro b/src/components/TrainingSystemsLab.astro new file mode 100644 index 0000000..a836931 --- /dev/null +++ b/src/components/TrainingSystemsLab.astro @@ -0,0 +1,1304 @@ +--- +const memoryPresets = [ + { id: "single", label: "单卡误区", params: 7, shards: 1, dp: 1, stage: 0, activation: 22, checkpoint: 100, offload: 0, hbm: 80 }, + { id: "zero2", label: "70B · ZeRO-2", params: 70, shards: 8, dp: 8, stage: 2, activation: 46, checkpoint: 55, offload: 30, hbm: 80 }, + { id: "v3", label: "V3 风格", params: 671, shards: 1024, dp: 2, stage: 1, activation: 34, checkpoint: 45, offload: 10, hbm: 80 }, + { id: "k2", label: "K2 风格", params: 1000, shards: 256, dp: 8, stage: 1, activation: 52, checkpoint: 48, offload: 72, hbm: 80 }, + { id: "k3", label: "K3 分层存储", params: 2780, shards: 512, dp: 8, stage: 2, activation: 68, checkpoint: 38, offload: 76, hbm: 80 }, +]; + +const meshPresets = [ + { id: "ptdp", label: "PTD-P", mode: "dense", nodes: 8, gpn: 8, tp: 8, pp: 4, ep: 1, cp: 1, dp: 2 }, + { id: "v3", label: "DeepSeek-V3", mode: "moe", nodes: 256, gpn: 8, tp: 1, pp: 16, ep: 64, cp: 1, dp: 2 }, + { id: "k2", label: "Kimi K2", mode: "moe", nodes: 256, gpn: 8, tp: 1, pp: 16, ep: 16, cp: 1, dp: 8 }, + { id: "long", label: "长上下文", mode: "context", nodes: 16, gpn: 8, tp: 2, pp: 4, ep: 1, cp: 8, dp: 2 }, + { id: "invalid", label: "故意冲突", mode: "context", nodes: 10, gpn: 8, tp: 4, pp: 4, ep: 1, cp: 8, dp: 1 }, +]; + +const schedules = [ + ["gpipe", "GPipe", "all F → all B"], + ["1f1b", "1F1B", "warmup → alternate"], + ["interleaved", "Interleaved", "virtual chunks"], + ["zero", "ZeroBubble", "split B / W"], + ["dual", "DualPipe", "bidirectional + overlap"], +]; +--- + +
+
+
+

INTERACTIVE / TRAINING SYSTEMS LAB

+

每次“省下来”,都要问成本被搬去了哪里

+
+

+ 四个实验都是确定性教学模型,不是任何厂商集群 benchmark。它们分别核算容量、设备分组、气泡和通信, + 刻意不压成一个容易误导的“系统总分”。 +

+
+ +
+ + + + +
+ +
+
+
+

MEMORY LEDGER

+

“BF16 参数只要 2P”为什么还会 OOM?

+
+

+ 先把 total parameters 经模型并行折算成每个 DP replica 的近似 shard,再按 ZeRO 阶段切 optimizer、 + gradient 和 parameter。MoE 的 shared/dense 路径并不均匀,故这里的 model-shard factor 只是容量规划近似。 +

+
+ +
+ {memoryPresets.map((preset) => ( + + ))} +
+ +
+
+ + + + + + +
+ +
+
+ {["DP", "ZeRO-1", "ZeRO-2", "ZeRO-3"].map((stage, index) => ( + + ))} +
+ +
+ 当前状态公式 + 2P + 14P / DP +

FP16 参数 + FP16 梯度 + FP32 master / momentum / variance;不含临时 buffer。

+
+ +
+
+ PER-GPU HBM + 35.0 / 80 GB +
+
+ 参数 + 梯度 + 优化器 + 激活 + 缓冲 +
+
+

可以放入 80 GB HBM,并留有运行缓冲。

+
+ +
+
PARAMETER SHARD17.5 GB

长期驻留或按层 gather

+
GRADIENT2.2 GB

ZeRO-2 reduce-scatter

+
MASTER + ADAM13.1 GB

FP32 三份状态

+
GPU ACTIVATION17.7 GB

重计算与卸载之后

+
OFFLOADED TIER7.6 GB

需要在 backward 前取回

+
LOGICAL COMM / STEP35.0 GB

ZeRO 论文体积口径近似

+
+ +
+ 当前主要代价 + 模型状态已切开,activation 成为最大单项 +

卸载让 HBM 变小,却把 PCIe / RDMA 带宽和 prefetch 时机加入关键路径。

+
+
+
+
+ + + + + + +
+ + + + diff --git a/src/data/chapters.ts b/src/data/chapters.ts index 21be1f9..99ac928 100644 --- a/src/data/chapters.ts +++ b/src/data/chapters.ts @@ -121,16 +121,16 @@ export const chapters: Chapter[] = [ }, { number: "08", - slug: "systems/training", + slug: "training-systems", title: "大规模训练系统", kicker: "DISTRIBUTED TRAINING", question: "一个 2.8T 模型如何摊到成千上万张卡上?", - summary: "从 ZeRO、Megatron 和五类并行,走到 DeepSeek DualPipe/DeepEP 与 K3 MoonEP。", - status: "queued", - progress: 12, - papers: 18, + summary: "用九张资源账串起 ZeRO、Megatron、Expert/Context Parallel、DeepSeek DualPipe 与 K3 MoonEP/百万 Token RL。", + status: "published", + progress: 71, + papers: 37, prerequisites: ["04", "06"], - highlights: ["并行维度", "通信重叠", "MoonEP"], + highlights: ["显存字节账", "流水线与通信", "MoonEP"], }, { number: "09", diff --git a/src/data/papers.ts b/src/data/papers.ts index 6f57d9d..209770e 100644 --- a/src/data/papers.ts +++ b/src/data/papers.ts @@ -590,6 +590,54 @@ export const papers: Paper[] = [ contribution: "AdamW 将权重衰减与梯度更新正确解耦。", verified: true, }, + { + year: 2012, + title: "Large Scale Distributed Deep Networks", + url: "https://arxiv.org/abs/1206.5533", + topics: ["训练系统"], + contribution: "DistBelief 与参数服务器奠定早期大规模分布式深度学习系统路线。", + verified: true, + }, + { + year: 2014, + title: "One Weird Trick for Parallelizing Convolutional Neural Networks", + url: "https://arxiv.org/abs/1404.5997", + topics: ["训练系统"], + contribution: "系统比较数据并行、模型并行及其通信边界。", + verified: true, + }, + { + year: 2016, + title: "Training Deep Nets with Sublinear Memory Cost", + url: "https://arxiv.org/abs/1604.06174", + topics: ["训练系统"], + contribution: "用 activation checkpointing 以额外计算换取 O(√n) feature-map memory。", + verified: true, + }, + { + year: 2017, + title: "Mixed Precision Training", + url: "https://arxiv.org/abs/1710.03740", + topics: ["低精度", "训练系统"], + contribution: "建立 FP32 master weights、loss scaling 与 FP32 accumulation 配方。", + verified: true, + }, + { + year: 2018, + title: "PipeDream: Fast and Efficient Pipeline Parallel DNN Training", + url: "https://arxiv.org/abs/1806.03377", + topics: ["训练系统"], + contribution: "以 1F1B、异步 pipeline 与 weight stashing 提高 stage 利用率。", + verified: true, + }, + { + year: 2018, + title: "Mesh-TensorFlow: Deep Learning for Supercomputers", + url: "https://arxiv.org/abs/1811.02084", + topics: ["训练系统"], + contribution: "把 tensor dimension 的布局声明映射到逻辑 device mesh。", + verified: true, + }, { year: 2019, title: "GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism", @@ -614,6 +662,86 @@ export const papers: Paper[] = [ contribution: "分片优化器、梯度与参数,消除数据并行状态冗余。", verified: true, }, + { + year: 2021, + title: "Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM", + url: "https://arxiv.org/abs/2104.04473", + topics: ["训练系统"], + contribution: "组合 TP、PP、DP,并提出 interleaved pipeline schedule。", + verified: true, + }, + { + year: 2021, + title: "ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning", + url: "https://arxiv.org/abs/2104.07857", + topics: ["训练系统"], + contribution: "把 GPU、CPU 与 NVMe 组成可带宽感知的异构训练内存层。", + verified: true, + }, + { + year: 2021, + title: "GSPMD: General and Scalable Parallelization for ML Computation Graphs", + url: "https://arxiv.org/abs/2105.04663", + topics: ["训练系统"], + contribution: "用统一 SPMD 表达和 sharding propagation 扩展模型并行。", + verified: true, + }, + { + year: 2021, + title: "Chimera: Efficiently Training Large-Scale Neural Networks with Bidirectional Pipelines", + url: "https://arxiv.org/abs/2107.06925", + topics: ["训练系统"], + contribution: "从 pipeline 两端注入 micro-batches,降低同步流水线气泡。", + verified: true, + }, + { + year: 2022, + title: "DeepSpeed-MoE: Advancing Mixture-of-Experts Inference and Training", + url: "https://arxiv.org/abs/2201.05596", + topics: ["MoE", "训练系统"], + contribution: "组合 data、expert 与 tensor parallel,系统优化 MoE 训练和推理。", + verified: true, + }, + { + year: 2022, + title: "Alpa: Automating Inter- and Intra-Operator Parallelism for Distributed Deep Learning", + url: "https://arxiv.org/abs/2201.12023", + topics: ["训练系统"], + contribution: "用代价模型联合搜索 operator 内和 operator 间并行。", + verified: true, + }, + { + year: 2022, + title: "Reducing Activation Recomputation in Large Transformer Models", + url: "https://arxiv.org/abs/2205.05198", + topics: ["训练系统"], + contribution: "以 Megatron sequence parallel 与 selective recomputation 降低激活内存和重算开销。", + verified: true, + }, + { + year: 2022, + title: "Tutel: Adaptive Mixture-of-Experts at Scale", + url: "https://arxiv.org/abs/2206.03382", + topics: ["MoE", "训练系统"], + contribution: "让 MoE parallelism、dispatch 和 kernels 自适应模型与硬件配置。", + verified: true, + }, + { + year: 2022, + title: "MegaBlocks: Efficient Sparse Training with Mixture-of-Experts", + url: "https://arxiv.org/abs/2211.15841", + topics: ["MoE", "训练系统"], + contribution: "用 block-sparse kernels 支持 dropless 动态 expert workloads。", + verified: true, + }, + { + year: 2023, + title: "PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel", + url: "https://arxiv.org/abs/2304.11277", + topics: ["训练系统"], + contribution: "总结 fully sharded 参数、梯度、状态与 prefetch 的工程实践。", + verified: true, + }, { year: 2023, title: "DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models", @@ -622,6 +750,39 @@ export const papers: Paper[] = [ contribution: "沿 attention head 做 sequence parallel,扩展极长序列训练。", verified: true, }, + { + year: 2024, + title: "Zero Bubble Pipeline Parallelism", + url: "https://arxiv.org/abs/2401.10241", + topics: ["训练系统"], + contribution: "拆分 input-gradient 与 weight-gradient,并在内存约束下搜索同步零气泡调度。", + verified: true, + }, + { + year: 2024, + title: "MegaScale: Scaling Large Language Model Training to More Than 10,000 GPUs", + url: "https://arxiv.org/abs/2402.15627", + topics: ["训练系统"], + contribution: "系统讨论 10K+ GPU 集群的并行、网络优化与可靠性。", + verified: true, + }, + { + year: 2024, + title: "USP: A Unified Sequence Parallelism Approach for Long Context Generative AI", + url: "https://arxiv.org/abs/2405.07719", + topics: ["长上下文", "训练系统"], + contribution: "在二维 mesh 上组合 Ulysses All-to-All 与 Ring P2P。", + verified: true, + }, + { + year: 2025, + title: "DeepEP: An Efficient Expert-Parallel Communication Library", + url: "https://github.com/deepseek-ai/DeepEP", + topics: ["MoE", "训练系统"], + contribution: "提供面向 NVLink/RDMA 的高吞吐与低延迟 expert dispatch/combine kernels。", + spotlight: "DeepSeek", + verified: true, + }, { year: 2024, title: "Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving", @@ -1055,7 +1216,7 @@ export const papers: Paper[] = [ year: 2025, title: "Kimi K2: Open Agentic Intelligence", url: "https://arxiv.org/abs/2507.20534", - topics: ["MoE", "Agent", "后训练", "推理"], + topics: ["MoE", "训练系统", "Agent", "后训练", "推理"], contribution: "开放 1T MoE Agent 模型,以 verifiable gym 与 self-critique rubric 做 joint RL。", spotlight: "Kimi", verified: true, @@ -1064,7 +1225,7 @@ export const papers: Paper[] = [ year: 2026, title: "Kimi K2.5: Visual Agentic Intelligence", url: "https://arxiv.org/abs/2602.02276", - topics: ["Agent", "多模态", "推理"], + topics: ["训练系统", "Agent", "多模态", "推理"], contribution: "把视觉、工具使用和并行 Agent Swarm 纳入统一后训练。", spotlight: "Kimi", verified: true, diff --git a/src/pages/index.astro b/src/pages/index.astro index ba24af2..eff4b35 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,6 +10,7 @@ const routes: Record = { moe: "/moe/", "long-context": "/long-context/", reasoning: "/reasoning/", + "training-systems": "/training-systems/", }; const paths = [ @@ -80,16 +81,17 @@ const paths = [ MoE 专题 长上下文专题 推理专题 + 训练系统专题 @@ -103,6 +105,22 @@ const paths = [
+ +
+

NEW / CHAPTER 08 LARGE-SCALE TRAINING SYSTEMS

+

一万张 GPU,为什么仍可能有一半在等?

+

+ 用模型状态、激活、计算划分、气泡、collective、专家、上下文、数值与可靠性九张账, + 从 ZeRO、Megatron 一路走到 DeepSeek DualPipe、Kimi MoonEP 与百万 Token Agentic RL。 +

+
+
+
LINEAGE
2012 → 2026
+
PAPERS
37 个一手节点
+
LAB
显存 · 网格 · 气泡 · 通信
+
+ +

NEW / CHAPTER 11 REASONING & TEST-TIME SCALING

@@ -384,9 +402,20 @@ const paths = [ transition: transform 180ms ease, border-color 180ms ease; } + .training-release, .reasoning-release { grid-column: 1 / -1; min-height: 510px; + } + + .training-release { + background: + radial-gradient(circle at 82% 18%, rgba(66, 111, 101, 0.19), transparent 30%), + repeating-linear-gradient(90deg, transparent 0 88px, rgba(94, 125, 117, 0.055) 88px 89px), + var(--paper-raised); + } + + .reasoning-release { background: radial-gradient(circle at 82% 18%, rgba(56, 91, 128, 0.17), transparent 30%), radial-gradient(circle at 63% 72%, rgba(150, 93, 58, 0.11), transparent 28%), @@ -455,6 +484,7 @@ const paths = [ padding-bottom: 76px; } + .training-release, .reasoning-release { grid-column: auto; } diff --git a/src/pages/moe/index.astro b/src/pages/moe/index.astro index fa31435..5168ab4 100644 --- a/src/pages/moe/index.astro +++ b/src/pages/moe/index.astro @@ -683,7 +683,7 @@ const paperChain = [
diff --git a/src/pages/progress/index.astro b/src/pages/progress/index.astro index f87a16a..5e107ed 100644 --- a/src/pages/progress/index.astro +++ b/src/pages/progress/index.astro @@ -15,6 +15,7 @@ const workstreams = [ { label: "推理与测试时扩展", value: 76, next: "真实模型采样曲线、PRM 案例与逐篇图表精读" }, { label: "稀疏计算与 MoE", value: 74, next: "补充真实集群 traces 与专家特化案例" }, { label: "长上下文专题", value: 72, next: "加入更多论文逐图笔记与真实模型配置对比" }, + { label: "大规模训练系统", value: 71, next: "补真实集群 traces、故障案例与精确 topology 配置" }, { label: "引用与事实检查", value: 54, next: "自动化外链复查与来源等级扩展" }, { label: "开源与部署", value: 100, next: "每轮保留不可变镜像、提交与回滚点" }, ]; @@ -39,7 +40,7 @@ const workstreams = [
OVERALL
专题平均 {average}%
READABLE
{published} 个首版可读专题
ACTIVE
{researching} 个研究/写作中
-
UPDATED
2026-07-29 00:38 CST
+
UPDATED
2026-07-29 01:19 CST
MODE
持续迭代,不锁死版本
@@ -49,7 +50,7 @@ const workstreams = [

01 WORKSTREAMS

-

十条工作流同时推进,但不混淆“有页面”和“已核验”

+

十一条工作流同时推进,但不混淆“有页面”和“已核验”

内容首版优先打通全局脉络;随后每轮迭代选择一个专题推进到论文/工程层,并做独立事实复核。 @@ -86,12 +87,13 @@ const workstreams = [

K3 报告已结构化拆解

47 页报告目录、151 条参考来源和架构/后训练/系统主线已经提取。

16 专题知识图

从语言模型基础到评测安全,包含先修依赖和三条贯穿案例。

编辑式网站系统

响应式导航、章节模板、侧栏、进度、论文链和证据提示组件。

-

八个原创交互视图

K3、注意力、DeepSeek、长上下文、MoE,以及推理预算/GRPO/MOPD 三页签实验。

-

六篇首版长文

K3 导读、Transformer 基础、DeepSeek 谱系、长上下文、MoE 与推理专题。

+

十二个原创交互视图

K3、注意力、DeepSeek、长上下文、MoE、推理三页签,以及训练系统四页签实验。

+

七篇首版长文

K3 导读、Transformer 基础、DeepSeek 谱系、长上下文、MoE、推理与训练系统专题。

长上下文深度专题

五张成本账、26 篇一手论文、10+ 机制图与 8 策略交互实验室。

MoE 深度专题

六张账、19 篇一手论文、DeepSeek/K3 主线与路由—容量—通信交互实验室。

推理深度专题

八张账、30 篇一手论文链、DeepSeek/Kimi 双主线与三页签互动实验室。

-

146 篇关键论文索引

覆盖 12 个专题,支持全文搜索、标签筛选与 Kimi/DeepSeek 聚光主线。

+

训练系统深度专题

九张账、37 个一手节点、DeepSeek/Kimi 双谱系与显存—网格—气泡—通信实验室。

+

166 篇关键论文索引

覆盖 12 个专题,支持全文搜索、标签筛选与 Kimi/DeepSeek 聚光主线。

公开仓库与自托管发布

源码公开到 git.k1412.top,网站由不可变镜像、Compose Manager 与 HTTPS 交付。

@@ -106,7 +108,7 @@ const workstreams = [
优先级专题本轮交付完成闸门
-
P0大规模训练系统

ZeRO / Megatron → Expert/Context Parallel → DualPipe / MoonEP

显存与通信计算器
+
P0大规模训练系统二轮

真实集群 traces → 故障恢复 → 精确 topology / kernel 配置

案例库 + 实测边界
P1长上下文二轮深化

真实模型配置 → 内核细节 → 长上下文评测与失败案例

配置比较器 + 逐图论文笔记
P1MoE 二轮深化

真实负载 traces → 专家特化可解释性 → 共享专家语义

案例库 + 集群证据
P1推理二轮深化

真实 pass@k 曲线 → PRM 失败案例 → 逐篇图表精读

案例库 + 真实 traces
@@ -150,6 +152,7 @@ const workstreams = [
双重开放许可

代码 MIT,原创文字与图 CC BY-SA 4.0。

自托管交付

源码公开到 git.k1412.top,网站部署到 k1412 私有基础设施。

推理按八张账组织

把答案、覆盖、选择、过程、预算、优化、分布与系统证据分开核算。

+
训练系统按九张账组织

把模型状态、激活、并行、气泡、通信、专家、上下文、数值与可靠性分开核算。

diff --git a/src/pages/reasoning/index.astro b/src/pages/reasoning/index.astro index 4769393..bf9d070 100644 --- a/src/pages/reasoning/index.astro +++ b/src/pages/reasoning/index.astro @@ -699,7 +699,7 @@ const paperChain = [

不要按模型榜单读,按“旧方法留下了哪堵墙”读

下面 30 篇构成本专题首版主干。课程中的机制、公式与数字优先回到这些一手来源; - 更完整的 146 篇跨专题索引位于论文库。 + 更完整的 166 篇跨专题索引位于论文库。

{paperChain.map(([year, title, href, note], index) => ( diff --git a/src/pages/training-systems/index.astro b/src/pages/training-systems/index.astro new file mode 100644 index 0000000..7f1a39e --- /dev/null +++ b/src/pages/training-systems/index.astro @@ -0,0 +1,1265 @@ +--- +import BaseLayout from "@/layouts/BaseLayout.astro"; +import TrainingSystemsLab from "@/components/TrainingSystemsLab.astro"; + +const toc = [ + ["00", "map", "先拆成九张账"], + ["01", "one-step", "一步训练发生什么"], + ["02", "state", "模型状态与 ZeRO"], + ["03", "activation", "激活:存、算、压、搬"], + ["04", "parallel", "DP / TP / PP"], + ["05", "collectives", "Collective 通信"], + ["06", "pipeline", "流水线与气泡"], + ["07", "expert", "Expert Parallel"], + ["08", "context", "长上下文并行"], + ["09", "precision", "低精度与优化器"], + ["10", "deepseek", "DeepSeek 系统谱系"], + ["11", "kimi", "Kimi K2 → K3"], + ["12", "lab", "四合一互动实验室"], + ["13", "agentic", "百万 Token Agentic RL"], + ["14", "decisions", "怎样选择配置"], + ["↳", "papers", "37 个一手节点"], +]; + +const ledgers = [ + ["L1 / MODEL STATE", "模型状态", "参数、梯度、master weights、optimizer states 各占多少?"], + ["L2 / ACTIVATION", "激活", "Backward 需要的中间量留在 HBM、重算、压缩还是卸载?"], + ["L3 / COMPUTE", "计算划分", "切 batch、矩阵、layer、expert 还是 sequence?"], + ["L4 / PIPELINE", "流水线气泡", "哪些 GPU 在等依赖,哪些计算可以挪进空隙?"], + ["L5 / COLLECTIVE", "集合通信", "搬多少字节、调用多频繁、走哪一级网络?"], + ["L6 / EXPERT", "专家派发", "动态路由怎样变成两次 All-to-All 与最慢 rank?"], + ["L7 / CONTEXT", "长上下文状态", "Q/K/V、KV cache 或 recurrent state 怎样跨 rank?"], + ["L8 / NUMERICS", "数值与优化器", "存储、GEMM、累加、归约和更新各用什么精度?"], + ["L9 / RELIABILITY", "可靠性与环境", "checkpoint、rollout、KV、沙箱和故障怎样恢复?"], +]; + +const memoryRows = [ + ["BF16 / FP16 parameter", "2P", "Forward / backward 当前使用的权重"], + ["BF16 / FP16 gradient", "2P", "未分片的 gradient buffer"], + ["FP32 master parameter", "4P", "优化器更新的高精度副本"], + ["FP32 first moment", "4P", "Adam momentum"], + ["FP32 second moment", "4P", "Adam variance"], + ["TOTAL", "16P", "只属于这套 mixed-precision Adam 配方"], +]; + +const zeroStages = [ + ["DP", "全部复制", "16P", "每步 gradient AllReduce"], + ["ZeRO-1", "切 optimizer", "4P + 12P/N", "Reduce/更新后 AllGather"], + ["ZeRO-2", "再切 gradient", "2P + 14P/N", "ReduceScatter + AllGather"], + ["ZeRO-3", "再切 parameter", "16P/N", "每层参数 gather,梯度 scatter"], +]; + +const activationMoves = [ + { + id: "store", + title: "留在 GPU", + tag: "CAPACITY", + body: "Forward 后原样保留,Backward 直接读取。速度最直接,容量最昂贵。", + debt: "HBM", + }, + { + id: "recompute", + title: "丢掉再重算", + tag: "COMPUTE", + body: "只留 checkpoint;Backward 前重跑部分 forward。省容量,增加 FLOPs。", + debt: "额外 forward", + }, + { + id: "compress", + title: "压成低精度", + tag: "NUMERICS", + body: "以 FP8 或其他表示保存,使用前恢复。省字节,引入 scale、cast 与精度验证。", + debt: "数值风险", + }, + { + id: "offload", + title: "搬到别处", + tag: "BANDWIDTH", + body: "放进 CPU、远端 GPU 或 NVMe;Backward 前预取并尽量与计算重叠。", + debt: "PCIe / RDMA / I/O", + }, +]; + +const parallelAxes = [ + ["DATA", "DP", "切 batch", "每卡完整模型;每 optimizer step 同步 gradient。", "低频大 collective"], + ["TENSOR", "TP", "切一层矩阵", "同一 layer 的 GEMM 与 heads 分到多卡。", "每层高频 collective"], + ["PIPELINE", "PP", "切 layer 深度", "相邻 stage 传 activation 与 gradient。", "P2P + bubble"], + ["EXPERT", "EP", "切 routed experts", "Token 去往远端 expert,再把输出送回。", "每 MoE 层 2× A2A"], + ["CONTEXT", "CP", "切一条长序列", "多卡共同完成同一样本的 attention / recurrent state。", "A2A 或 P2P ring"], +]; + +const collectives = [ + ["AllReduce", "完整 x", "聚合后的完整 Σx", "DP gradient;TP partial output", "ring: 2(N−1) rounds"], + ["ReduceScatter", "完整 x", "聚合后的 1/N shard", "ZeRO/FSDP gradient", "约 (N−1)/N · M sent"], + ["AllGather", "1/N shard", "完整 x", "ZeRO parameter;SP tensor", "约 (N−1)/N · M sent"], + ["All-to-All", "给每个 peer 的不同 shard", "来自每个 peer 的不同 shard", "MoE dispatch;Ulysses", "对拓扑与负载敏感"], + ["P2P", "一个邻居消息", "一个邻居消息", "PP;Ring Attention;Muon", "易 pipeline / overlap"], +]; + +const pipelineWaves = [ + { + year: "2018–19", + title: "PipeDream / GPipe", + gain: "Micro-batch 让多个 stage 同时工作;GPipe 保持同步语义,PipeDream 探索异步 1F1B。", + debt: "flush bubble、activation residency、weight version。", + }, + { + year: "2021", + title: "Interleaved 1F1B / Chimera", + gain: "virtual chunks 缩短 bubble 单元;双向 pipeline 从两端注入工作。", + debt: "更多消息、更多调度约束,stage 划分仍需平衡。", + }, + { + year: "2023", + title: "Zero Bubble", + gain: "把 backward 拆成 input-gradient 与 weight-gradient,用可延后的 W 填空隙。", + debt: "能否零气泡取决于 F/B/W 比例、内存和 optimizer sync。", + }, + { + year: "2024", + title: "DeepSeek DualPipe", + gain: "双向 pipeline 配对 F/B,并把 MoE A2A 与 compute 重排、重叠。", + debt: "两份参数;只有被覆盖的通信才不暴露在关键路径。", + }, + { + year: "2025–26", + title: "K2 / K3 的不同取舍", + gain: "K2 选择省状态的 interleaved 1F1B;K3 继续把 ViT、offload 与 gradient reduce 填进不同相位。", + debt: "最佳 schedule 由模型容量、MoE 比例和多模态负载共同决定。", + }, +]; + +const contextMethods = [ + ["MEGATRON SP", "切 element-wise activations", "AllGather + ReduceScatter", "与 TP 共组;主要省复制激活"], + ["ULYSSES", "sequence shard ↔ head shard", "2× All-to-All", "并行度受 head / KV-head 可切分性约束"], + ["RING ATTENTION", "固定 Q,轮转 K/V blocks", "P2P ring", "可重叠;block 太小会伤 kernel,causal 需均衡"], + ["USP", "Ulysses × Ring 二维 mesh", "A2A + P2P", "把高带宽域与慢链路分别映射"], + ["K3 KCP", "组合 fixed-size recurrent fragments", "AllGather + prefix scan", "只适用于 KDA 分支,不代表 MLA"], +]; + +const deepseekSteps = [ + ["V2", "2024", "16 PP · 8 EP · ZeRO-1", "少 activated parameters + 重计算使其不需 TP;shared expert compute 与 A2A overlap。"], + ["V3", "2024", "16 PP · 64 EP · ZeRO-1", "DualPipe、node-limited routing、cross-node A2A kernels 与 FP8 协同。"], + ["V4", "2026", "Million-token hybrid attention", "CP 传输对象扩展为压缩/稀疏 attention 与 recurrent state,不能套标准 MHA 单式。"], +]; + +const kimiSteps = [ + ["K2", "1T MoE", "选择 interleaved 1F1B", "不采用 DualPipe:两份 parameter+gradient 会迫使 PP/EP 扩大;用更多 warmup 和 WGrad overlap 代替。"], + ["K2.5", "Native multimodal", "DEP 解耦 ViT", "视觉 forward 全局均衡、只留输出;backbone 完成后重算 ViT 并 backward。"], + ["K3", "2.78T / 1M", "重构执行与存储层", "MoonEP、统一 activation manager、Pipeline ZeRO-2、remote activation、P2P Muon 与 external KV pool。"], +]; + +const paperChain = [ + ["2012", "Large Scale Distributed Deep Networks", "https://arxiv.org/abs/1206.5533", "DistBelief 与参数服务器。"], + ["2014", "One Weird Trick for Parallelizing CNNs", "https://arxiv.org/abs/1404.5997", "数据/模型并行直觉。"], + ["2016", "Training Deep Nets with Sublinear Memory Cost", "https://arxiv.org/abs/1604.06174", "activation checkpointing。"], + ["2017", "Mixed Precision Training", "https://arxiv.org/abs/1710.03740", "master weights、loss scaling、FP32 accumulation。"], + ["2018", "PipeDream", "https://arxiv.org/abs/1806.03377", "1F1B、异步 pipeline 与 weight stashing。"], + ["2018", "Mesh-TensorFlow", "https://arxiv.org/abs/1811.02084", "layout 到 device mesh。"], + ["2019", "GPipe", "https://arxiv.org/abs/1811.06965", "同步 micro-batch pipeline。"], + ["2019", "Megatron-LM", "https://arxiv.org/abs/1909.08053", "Transformer tensor parallel。"], + ["2019", "ZeRO", "https://arxiv.org/abs/1910.02054", "模型状态三阶段分片。"], + ["2020", "GShard", "https://arxiv.org/abs/2006.16668", "MoE expert parallel 与自动分片。"], + ["2021", "3D Megatron-LM", "https://arxiv.org/abs/2104.04473", "TP + PP + DP 与 interleaved schedule。"], + ["2021", "ZeRO-Infinity", "https://arxiv.org/abs/2104.07857", "GPU / CPU / NVMe 异构内存。"], + ["2021", "GSPMD", "https://arxiv.org/abs/2105.04663", "general sharding propagation。"], + ["2021", "Chimera", "https://arxiv.org/abs/2107.06925", "bidirectional pipeline。"], + ["2022", "DeepSpeed-MoE", "https://arxiv.org/abs/2201.05596", "多轴 MoE 系统。"], + ["2022", "Alpa", "https://arxiv.org/abs/2201.12023", "自动 inter/intra-operator parallelism。"], + ["2022", "Reducing Activation Recomputation", "https://arxiv.org/abs/2205.05198", "Megatron SP 与 selective recompute。"], + ["2022", "FlashAttention", "https://arxiv.org/abs/2205.14135", "IO-aware exact attention。"], + ["2022", "Tutel", "https://arxiv.org/abs/2206.03382", "adaptive MoE system。"], + ["2022", "MegaBlocks", "https://arxiv.org/abs/2211.15841", "dropless block-sparse MoE。"], + ["2023", "PyTorch FSDP", "https://arxiv.org/abs/2304.11277", "fully sharded 实现经验。"], + ["2023", "FlashAttention-2", "https://arxiv.org/abs/2307.08691", "attention work partition。"], + ["2023", "DeepSpeed-Ulysses", "https://arxiv.org/abs/2309.14509", "sequence ↔ head All-to-All。"], + ["2023", "Ring Attention", "https://arxiv.org/abs/2310.01889", "blockwise P2P context parallel。"], + ["2023", "Zero Bubble Pipeline Parallelism", "https://arxiv.org/abs/2401.10241", "B/W 拆分与 schedule search。"], + ["2024", "MegaScale", "https://arxiv.org/abs/2402.15627", "10K+ GPU 训练与可靠性。"], + ["2024", "DeepSeek-V2", "https://arxiv.org/abs/2405.04434", "zero-bubble PP + EP + ZeRO-1。"], + ["2024", "USP", "https://arxiv.org/abs/2405.07719", "Ulysses × Ring 二维 SP。"], + ["2024", "DeepSeek-V3", "https://arxiv.org/abs/2412.19437", "DualPipe、A2A、FP8。"], + ["2025", "DeepEP", "https://github.com/deepseek-ai/DeepEP", "expert dispatch / combine kernels。"], + ["2025", "Kimi K2", "https://arxiv.org/abs/2507.20534", "1T MoE 与 co-located RL。"], + ["2026", "Kimi K2.5", "https://arxiv.org/abs/2602.02276", "DEP 与 100K agent tasks。"], + ["2026", "DeepSeek-V4", "https://arxiv.org/abs/2606.19348", "百万 Token 系统约束。"], + ["2026", "Kimi K3", "https://arxiv.org/abs/2607.24653", "2.8T pretraining + 1M agentic RL。"], + ["2026", "MoonEP", "https://github.com/MoonshotAI/MoonEP", "完美 rank balance 与 static shape。"], + ["2026", "AgentENV", "https://github.com/kvcache-ai/AgentENV", "resumable microVM agent environments。"], + ["2026", "K2 Checkpoint Engine", "https://github.com/MoonshotAI/checkpoint-engine", "train / inference resharding。"], +]; +--- + + +
+
+
+

SYSTEMS / 12 LARGE-SCALE TRAINING

+

一万张 GPU,
为什么仍可能有一半在等?

+

+ 大模型训练不是“卡越多越快”。参数要有地方放,激活要活到反向,矩阵和层要正确切分, + 数据必须穿过真实网络,气泡、负载不均与故障还会把理论算力变成等待。 +

+
+
+
LEDGERS
9 张资源账
+
CORE SOURCES
37 个一手节点
+
LINEAGE
2012 → 2026
+
LAB
4 个独立实验
+
SPOTLIGHT
DeepSeek × Kimi
+
+
+
+ +
+ + +
+
+

00 NINE LEDGERS

+

训练系统的核心:把等待、容量和数据移动分别记账

+

+ “模型放不下”可能是参数、Adam 状态、激活或临时通信 buffer;“扩展效率低”可能是 GEMM 太小、 + 网络太慢、最忙专家拖尾或 pipeline 没填满。只有先拆账,才知道优化是在消灭成本,还是把它搬到另一层。 +

+ +
+ {ledgers.map(([code, title, question]) => ( +
+ {code}{title}

{question}

+
+ ))} +
+ +
+
+ 04IDLE / FAILURE

气泡、长尾、故障恢复、环境等待

+
+
+ 03NETWORK

NVLink、IB/RoCE、PCIe、存储 I/O

+
+
+ 02MEMORY

HBM、CPU DRAM、remote GPU、NVMe

+
+
+ 01COMPUTE

Tensor Core、CUDA Core、kernel launch

+
+
+ +
+ 像一间超大型餐厅:食材、厨师、传菜和空桌是四张不同的账 +

+ GPU 算力是厨师;HBM 是手边案台;跨卡网络是传菜通道;pipeline bubble 是厨师在等上一道工序。 + 增加厨师,如果案台太小、传菜口拥堵或订单全堵在某个专家窗口,仍然不会线性提速。 +

+
+
+ +
+

01 ONE TRAINING STEP

+

先看一步训练,所有系统优化才有落点

+

+ 一个同步训练 step 并不是一次“模型运行”。它包含数据进入、forward、保存或处理 activation、 + backward、梯度聚合、optimizer update,以及下一步开始前必须完成的同步。不同状态只在特定时间被需要。 +

+ +
+
01LOAD

读入并 pack Token / 图像 / 视频

storage → CPU → GPU
+ +
02FORWARD

按 layer 产生 activation 与 loss

parameter + compute
+ +
03BACKWARD

逆序消费 activation,产生 gradient

recompute / prefetch
+ +
04REDUCE

跨 replica 聚合或分片 gradient

collective
+ +
05UPDATE

用 optimizer states 更新参数

master weights
+
+ +

“不是什么状态都要一直在 GPU”

+
+
PARAMETERforwardbackwardupdate
+
ACTIVATION产生等待 / 卸载消费后释放
+
GRADIENT逐层产生reduce / update
+
OPTIMIZER可分片 / 卸载短时使用
+
+ +
+ ZeRO、checkpointing 与 offload 共享同一个直觉 +

+ 如果一个状态当前不需要,就不必在每张 GPU 上完整常驻。区别在于:ZeRO 把状态放到其他 rank, + checkpointing 把中间量变成未来的重计算,offload 则把它放到更慢的存储层。 +

+
+
+ +
+

02 MODEL-STATE MEMORY

+

“BF16 参数 2P bytes”只是训练账单的第一行

+

+ ZeRO + 用 FP16/FP32 mixed-precision Adam 说明:前反向权重和梯度各 2 字节,更新还保留 FP32 master parameter、 + momentum 与 variance,各 4 字节。于是基线是 16P,而不是 2P。 +

+ +
+ {memoryRows.map(([name, bytes, role], index) => ( +
+ {String(index + 1).padStart(2, "0")}{name}{bytes}

{role}

+
+ ))} +
+ +
+ 16P 不是 Adam 的永久常数 +

+ 这条式子依赖具体 dtype 与状态实现。BF16 gradient、FP32 accumulation、EMA、FP8 scale、flat buffer、 + Muon state 或 fused optimizer 都会改变账单。正确做法是逐张量列 byte ledger。 +

+
+ +

ZeRO:沿数据并行轴逐步取消复制

+
+ {zeroStages.map(([name, split, memory, traffic], index) => ( +
+ {String(index).padStart(2, "0")} +

{name}

+ {split} + {memory} +

{traffic}

+
+ ))} +
+ +
+ COMMUNICATION CONVENTION +

+ ZeRO 论文把 ReduceScatter 与 AllGather 各近似为 P 的数据移动,所以普通 DP 与 ZeRO-2 都约为 2P, + ZeRO-3 约为 3P。严格 ring 每 rank 的单向发送量还要乘 `(N−1)/N`。不同口径不能直接相除。 +

+
+
+ +
+

03 ACTIVATION LIFECYCLE

+

参数按模型大小增长,激活按 batch × sequence × hidden × layers 增长

+

+ 增大 DP 只切 batch,不会切开一个超长样本的 activation。标准注意力如果显式保存 `S×S` matrix, + 还会出现平方级中间量。因而 7B 长上下文训练可能比更大参数的短上下文配置更早撞上 HBM。 +

+ +
+ {activationMoves.map((move, index) => ( +
+ {String(index + 1).padStart(2, "0")} / {move.tag} +

{move.title}

+

{move.body}

+ 新账单:{move.debt} +
+ ))} +
+ +
+
+ STORE ALL +
{Array.from({ length: 12 }, (_, i) => A{i + 1})}
+

Backward 直接读取;activation memory 随层数线性增长。

+
+
+ CHECKPOINT + RECOMPUTE +
{Array.from({ length: 12 }, (_, i) => {i % 4 === 0 ? `C${i / 4 + 1}` : "重算"})}
+

只留边界 checkpoint;Backward 经过某段时重跑该段 forward。

+
+
+ +

关键论文怎样逐步把重计算变细

+
+
+ 2016Sublinear Memory +

分段 checkpoint 把 n 层 feature-map memory 从 O(n) 降到 O(√n);递归可继续换内存。

+
+
+ 2022Selective Recomputation +

优先重算 memory-heavy、compute-light 中间量,并用 Megatron SP 分片原本复制的 element-wise activation。

+
+
+ 2022FlashAttention +

用 SRAM tiling 与 online softmax 避免把完整 S×S attention matrix 写回 HBM;dense attention FLOPs 仍是平方级。

+
+
+ 2026K3 Unified Manager +

把 recompute、FP8、local / remote offload 变成 tensor 粒度的可组合 storage policy。

+
+
+
+ +
+

04 PARALLEL AXES

+

五种并行,切的是五个不同对象

+

+ 如果只背缩写,很容易把“更多 GPU”误解成同一种扩展。判断任何配置时,先问: + 每张 GPU 持有什么、每次通信发生在哪个频率、哪个维度真的独立。 +

+ +
+ {parallelAxes.map(([full, short, cut, body, comm], index) => ( +
+ {String(index + 1).padStart(2, "0")} / {full} + {short} +

{cut}

+

{body}

+ {comm} +
+ ))} +
+ +
+
+ NODE 0 · FAST DOMAINNODE 1NODE 2NODE 3 +
+
+ {Array.from({ length: 4 }, (_, node) => ( +
+ {Array.from({ length: 4 }, (_, gpu) => {node * 4 + gpu}TP{gpu})} +
+ ))} +
+ +
+ +
+ 不要机械写 `world = DP × TP × PP × EP × CP` +

+ 只有互相正交的 device-mesh axes 才连乘。Megatron SP 与 TP 共组;EP 常只作用于 MoE layer; + dense attention、shared expert 和 context group 还可能用另一套 process groups。先画 rank membership。 +

+
+
+ +
+

05 COLLECTIVE COMMUNICATION

+

通信量必须同时写:消息大小、rank 口径、算法和调用频率

+ +
+
+ LATENCYα × rounds

小消息、同步、协议与 kernel launch 更敏感。

+
+ + +
+ BANDWIDTHβ × bytes

大 tensor 搬运由链路吞吐主导。

+
+ +
+ OVERLAPhidden time

只减关键路径时间,不减物理传输字节。

+
+
+ +
+
OP每 rank 输入每 rank 输出LLM 位置环形直觉
+ {collectives.map((row) =>
{row.map((cell, index) => index === 0 ? {cell} : {cell})}
)} +
+ +

为什么相同字节数也可能完全不同

+
+
DP一次 / optimizer step

消息大,但能被一整个 batch 的计算摊薄。

+
TP多次 / layer / micro-batch

高频,强依赖节点内低延迟高带宽。

+
PP邻接 / micro-batch

点对点;stage 越多,消息与 bubble 越复杂。

+
EP两次 / MoE layer

All-to-All;payload 与 top-k、路由宽度和负载相关。

+
+
+ +
+

06 PIPELINE BUBBLES

+

流水线不改变模型数学,只改变谁在什么时候做哪一段

+ +
+
FLUSH BUBBLE(p − 1)(F + B)

理想平衡 stage、忽略通信。

+
IDEAL WORKm(F + B)

m 个 micro-batches 的有效计算。

+
UTILIZATIONm / (m + p − 1)

GPipe / non-interleaved flush 的简化式。

+
+ +
+ {pipelineWaves.map((wave, index) => ( +
+
{String(index + 1).padStart(2, "0")}
+ +

{wave.title}

{wave.gain}

留下的债:{wave.debt}
+
+ ))} +
+ +
+
+ STANDARD BACKWARD + B = input-gradient + weight-gradient +

两部分绑成一个调度单元,必须一起完成。

+
+ +
+ ZERO BUBBLE IDEA + Binput 在依赖链上 · W 可以延后 +

先让前一 stage 继续反传,再把 W 放进之后的空隙。

+
+
+ +
+ DEEPSEEK-V3 / DUALPIPE +

“近零 All-to-All 开销”不是“没有 All-to-All”

+

+ V3 把 forward/backward chunk 拆成 attention、dispatch、MLP、combine,再把 input-grad / weight-grad 分开; + 双向注入 micro-batches,并手动划分通信与计算使用的 SM。通信字节仍真实经过 IB/NVLink, + 只是多数传输在该配置下被相邻计算覆盖,不再暴露在关键路径。 +

+ 边界:DualPipe 需要两份参数,并比表中的 1F1B 多一个 stage-normalized activation 单位。 +
+
+ +
+

07 EXPERT PARALLEL

+

MoE 省的是每 Token 计算,不会自动省通信与等待

+ +
+
ROUTERToken → top-k experts
+ +
DISPATCHAll-to-All #1
+ +
EXPERT GEMM每 rank 本地执行
+ +
COMBINEAll-to-All #2
+ +
MIX按 router weight 聚合
+
+ +

+ 逻辑 payload 近似随 `tokens × top-k × routed width × bytes` 增长;但 end-to-end time 还受 capacity、 + padding、路由 metadata、跨节点比例和最忙 rank makespan 影响。MoE 专题 + 已详细解释模型路由,本章只聚焦执行系统。 +

+ +
+
GShard把 expert parallel 带进大规模 Transformer

路由、自动分片与跨设备 expert execution 成为一体。

+
Tutel自适应 parallelism 与 kernel

不同专家数、capacity、硬件下切换执行策略。

+
MegaBlocksDropless block-sparse compute

不靠固定 capacity padding / dropping,但真实不均衡工作仍存在。

+
DeepEP优化 dispatch / combine 数据路径

高吞吐与低延迟 kernel;不单独保证每 rank token load 相同。

+
+ +

MoonEP:先给 rank 级完美均衡一个上界保证

+
+
+ INPUTS×K×R assignments

每 rank 本地 S Tokens,每 Token 选择 K experts。

+
+ +
+ ONLINE PLAN填满 underloaded rank

remote tokens 最多来自一个 source rank。

+
+ +
+ BOUND≤ E/R redundant experts

每个 source rank 本地最多 E/R experts。

+
+ +
+ STATIC SHAPE每 rank 恰好 S×K

固定 buffer,消除逐层 shape host sync。

+
+
+ +
+ 完美 rank balance 不是完美 expert-GEMM balance +

+ 每 rank 总 assignments 相同以后,rank 内不同 experts 仍可一多一少。K3 还需要 workload-aware scheduler + 平衡 SM makespan。MoonEP 的 `S×K` vs DeepEP `S×K×R` 也只适用于报告定义的 worst-case copy-free buffer 对照。 +

+
+
+ +
+

08 CONTEXT PARALLEL

+

长序列并行不是一种算法,而是一组不同的数据布局

+ +
+
方法切什么通信关键边界
+ {contextMethods.map((row) =>
{row.map((cell, index) => index === 0 ? {cell} : {cell})}
)} +
+ +
+
+ ULYSSES +
S/4 · all headsS/4 · all headsS/4 · all headsS/4 · all heads
+ All-to-All +
full S · H0full S · H1full S · H2full S · H3
+

把 sequence shard 转成 head shard;attention 后再转回来。

+
+
+ RING ATTENTION +
Q0
K/V0
Q1
K/V1
Q2
K/V2
Q3
K/V3
+ K/V blocks 轮转 → +

每 rank 固定本地 Q,在线累积对全局 K/V 的精确 softmax。

+
+
+ +
+ K3 / KDA CONTEXT PARALLEL +

+ KDA 是 recurrent linear attention:每 rank 从本地 Token 计算 fixed-size transition/state fragments, + 一次 AllGather 后用 prefix scan 恢复 incoming state。它不搬完整历史 KV,但只覆盖 KDA 分支; + K3 的 MLA 与视觉 encoder 仍有各自 CP。 +

+
+
+ +
+

09 NUMERICS & OPTIMIZER

+

低精度训练要分别回答:存什么、算什么、在哪里累加

+ +
+
STOREBF16 / FP8

权重与 activation 占多少 HBM。

+ +
GEMM INPUTFP16 / BF16 / FP8

Tensor Core 使用何种格式。

+ +
ACCUMULATEFP32 / mixed

大量乘加与 reduction 是否丢失小量。

+ +
UPDATEFP32 master

优化器状态和参数更新精度。

+
+ +
+
+ DEEPSEEK-V3 +

FP8 compute framework

+

+ 主要 compute-intensive GEMM 使用 FP8;敏感操作保留更高精度;tile/block scaling 管动态范围; + WGrad FP8 也让相关 activation 可按 FP8 保存。 +

+
+
+ KIMI K2 +

FP8 activation storage

+

+ 部分 MoE / SwiGLU 输入压成 FP8-E4M3,scale 为 FP32;K2 明确没有用 FP8 compute, + 因为前期研究观察到潜在性能退化风险。 +

+
+
+ KIMI K3 +

Muon 改写通信图

+

+ Newton–Schulz orthogonalization 需要完整矩阵;K3 不全量 AllGather,而让 owner rank + P2P 获取自己更新所需 shards,并按 model chunk pipeline。 +

+
+
+
+ +
+

10 DEEPSEEK SYSTEMS LINEAGE

+

DeepSeek 的亮点不是单个 kernel,而是模型、路由、调度与网络共同设计

+ +
+ {deepseekSteps.map(([model, year, config, body], index) => ( +
+
{String(index + 1).padStart(2, "0")}{model}
+
{config}

{body}

+
+ ))} +
+ +

V3 的四层闭环

+
+
MODELMLA + fine-grained MoE

少 activated parameters;但跨节点 expert traffic 重。

+
ROUTER最多 4 个节点

限制 IB fan-out,再在节点内经 NVLink 转发。

+
KERNEL20 SM communication

warp specialization 与动态任务分配;这是报告集群的实测配置。

+
SCHEDULEDualPipe overlap

把 A2A 与 attention / MLP / backward 重排进同一时间轴。

+
+ +
+ “V3 不用 TP”是配置事实,不是架构定律 +

+ V3 借助大 EP、ZeRO-1、selective recomputation 与 FP8 把状态放下,避免高频 TP 通信。 + 换硬件、batch、专家布局或上下文长度后,最优并行配置可能改变。 +

+
+
+ +
+

11 KIMI SYSTEMS LINEAGE

+

K2 → K3:从“稳定复用一套并行配置”走向统一执行与存储系统

+ +
+ {kimiSteps.map(([model, scale, mechanism, body], index) => ( +
+
{String(index + 1).padStart(2, "0")}{model}{scale}
+

{mechanism}

{body}

+
+ ))} +
+ +

K2 为什么主动不采用 DualPipe

+
+
+ DUALPIPE GAIN + 更少 bubble + 重 A2A overlap +
+ VS +
+ K2 COST + 2× parameter / gradient memory +
+ +
+ K2 CHOICE + Interleaved 1F1B + extra warmup + WGrad overlap +
+
+ +

+ K2 是 1T total-parameter MoE。报告指出,DualPipe 的额外状态会迫使系统增加 PP 或 EP: + 更大 PP 增加 bubble,更大 EP 提高通信与负载成本。因此团队保留 16 PP / 16 EP / ZeRO-1, + 用更多 warmup micro-batches 覆盖 EP communication,并让 WGrad 与 PP communication 并行。 +

+ +

K3 3T-class 预训练执行图

+
+
ROUTINGMoonEP

在线冗余 expert 规划 → rank perfect balance → static shape

+
ACTIVATIONUnified manager

recompute + block FP8 + local/remote offload

+
GRADIENTPipeline ZeRO-2

GPU double buffer → DP reduce → CPU shards

+
OPTIMIZERP2P Muon

只取 locally owned matrices 的远端 shards

+
MULTIMODALDynamic CP + bubble fill

大图切 patch;大部分 ViT compute 放入 text PP 空隙

+
+
+ +
+

12 INTERACTIVE LAB

+

亲手改变配置,看瓶颈怎样从一张账移动到另一张账

+

+ 推荐依次尝试:在显存账中把 70B 切到 ZeRO-3;在 device mesh 选择“故意冲突”; + 在 pipeline 中比较 1F1B 与 DualPipe 的参数副本;最后把通信 overlap 拉到 95%,观察 bytes 不变、exposed time 下降。 +

+ +
+ +
+

13 MILLION-TOKEN AGENTIC RL

+

到 Agentic RL,训练系统还要管理 KV、环境和跨迭代长尾

+ +
+
01TRAIN

Policy update;model、optimizer 与 gradient 占 GPU/CPU。

+ +
02RESHARD

训练布局转成 inference layout;K2 用 checkpoint engine。

+ +
03ROLLOUT

百万 Token KV、tool latency、partial trajectory 与 sandbox。

+ +
04REWARD

Reference / judge forward;权重可能无法常驻 GPU。

+ +
+ +

K3 的三次“生命周期复用”

+
+
+ KV / WRITE-BACK只在 GPU eviction 时写 CPU +

active decode blocks 留在 GPU;idle reusable prefix 才进入 external pool,KDA state 与 MLA KV 一起管理。

+
+
+ HBM / GRAD BUFFERReference weights 借用 policy gradient storage +

一个 VPP slot 当前 forward,另一个 prefetch 下一 chunk;真实 backward 前再被 gradient 覆盖。

+
+
+ ENV / PAUSE推理等待时释放 sandbox 资源 +

AgentENV 用 Firecracker microVM,支持 incremental checkpoint、resume、fork 与 snapshot。

+
+
+ +
+
CHECKPOINT133 ms

报告最低延迟

+
RESUME49 ms

报告最低延迟

+
MEMORY OVERCOMMITup to 6.5×

真实 workload 报告

+
SANDBOXES51,219,741

K3 训练与评估累计

+
+ +
+ 这些是 K3 报告的生产统计,不是通用 Firecracker benchmark +

+ 系统数字高度依赖镜像、内存 dirty rate、存储层和并发形态。课程保留原始口径,不把最小延迟或最高 overcommit 外推到其他环境。 +

+
+
+ +
+

14 CONFIGURATION PLAYBOOK

+

没有“最好并行策略”,只有当前最先触顶的约束

+ +
+
01单 replica 的模型状态放不下?

先算精确 byte ledger;考虑 ZeRO/FSDP、TP/PP/EP 或 optimizer offload。

+
02参数放下,但 activation OOM?

减 micro-batch;selective recompute、FlashAttention、SP/CP、压缩或 offload。

+
03GPU 忙但 MFU 低?

检查 GEMM shape、kernel fusion、micro-batch、低精度和 launch overhead。

+
04GPU 在等网络?

先定位 collective、频率和拓扑;再谈减少体积、换 group、chunk 或 overlap。

+
05PP 有大块空白?

增加 m、virtual chunks、B/W split 或双向 schedule,同时重算 activation 与参数副本。

+
06MoE 最忙 rank 拖尾?

分开 router balance、rank placement、redundant experts 与 rank 内 GEMM scheduling。

+
07长序列单样本放不下?

按 attention 类型选择 Ulysses、Ring、USP 或 recurrent-state CP;不要只增 DP。

+
08训练能跑但经常失败?

计算 checkpoint 恢复时间、数据确定性、world-size reshard 与环境状态恢复。

+
+ +
+ ONE RULE TO KEEP +

每项优化都要写两句话:它省了什么;它把代价搬到了哪里。

+
+
+ +
+

PRIMARY-SOURCE CHAIN

+

从分布式深度学习到 K3:37 个一手阅读节点

+

+ 这不是按引用数排序的“必读榜”,而是一条问题链。建议先读带有当前瓶颈的节点: + 容量读 ZeRO;层内切分读 Megatron;气泡读 GPipe / ZeroBubble;MoE 执行读 MegaBlocks / DeepEP / MoonEP; + 长序列读 Ulysses / Ring / USP;最后回到 DeepSeek 与 Kimi 的整机协同。 +

+ +
+ {paperChain.map(([year, title, url, note], index) => ( + + {String(index + 1).padStart(2, "0")} + + {title} +

{note}

+
+ ))} +
+ +
+ 证据规则 +

+ 本页机制和数字回查论文、官方技术报告或作者仓库;图均为课程原创简化示意。 + 性能提升只属于论文的模型、集群和基线,不作跨系统排行榜。 +

+
+
+
+
+
+ +