scaling-book

jax-mlMIT活跃维护

一本博客风格的短教材,讲怎么在 TPU 上扩展大模型训练与推理,用 roofline 分析帮你算清算力、显存和通信的瓶颈。

Home for "How To Scale Your Model", a short blog-style textbook about scaling LLMs on TPUs

暂无版本1,525star +2 / 7 天218fork同步于 2026-11-10 23:48 UTC

怎么上手

由 README 提炼,执行前请确认
brew install imagemagick ruby
pip install jupyter
git clone https://github.com/jax-ml/scaling-book.git
cd scaling-book
bundle install
bundle exec jekyll serve
硬件要求按 README 说明

README 未说明运行本书所需硬件;本地构建只需 Ruby、ImageMagick 和 Jupyter,不涉及 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Google DeepMind 出的在线教程书,讲清 TPU 上扩展 LLM 的原理与并行策略选择

一本博客风格的短教材,讲怎么在 TPU 上扩展大模型训练与推理,用 roofline 分析帮你算清算力、显存和通信的瓶颈。

核心能力

  • 讲解 TPU 工作原理与 LLM 大规模运行机制
  • 指导训练和推理时挑选并行方案以避开通信瓶颈
  • 提供本地 Jekyll 构建流程预览整本书
  • 附带脚本把各章节合并为单个 Markdown 文件
  • 支持用 pandoc 将合并稿转成 Word 文档

容易踩的坑

本地构建要求 Ruby 至少 3.4.5 且需确保 PATH 中是正确的 Ruby 版本;本地预览默认地址为 http://127.0.0.1:4000/scaling-book,端口 4000 被占用会启动失败;在 GitHub 上贡献代码需先签署 Google CLA

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    How To Scale Your Model

    This book aims to demystify the art of scaling LLMs on TPUs. We try to explain how TPUs work, how LLMs actually run at scale, and how to pick parallelism schemes during training and inference that avoid communication bottlenecks. The book is available at https://jax-ml.github.io/scaling-book.

    Acknowledgments

    This book was written by Jacob Austin, Sholto Douglas, Roy Frostig, Anselm Levskaya, Charlie Chen, Sharad Vikram, Federico Lebron, Peter Choy, Vinay Ramasesh and Albert Webson at Google DeepMind. Many of the ideas were first derived by James Bradbury and Reiner Pope.

    The website uses a Distill-style Jekyll theme created by https://github.com/alshedivat/al-folio and the Distill team. Thank you!

    Running Locally

    To build this repo locally, you will need Ruby, ImageMagick, and Jupyter installed, which for MacOS can be installed with Homebrew using

    brew install imagemagick ruby
    pip install jupyter
    

    After this is installed, you should make sure the correct version of Ruby is found in PATH. You should have at least Ruby 3.4.5 installed. Then you ought to be able to run

    git clone https://github.com/jax-ml/scaling-book.git
    cd scaling-book
    bundle install
    bundle exec jekyll serve
    

    Once you have run jekyll serve successfully, the book will be available at http://127.0.0.1:4000/scaling-book.

    The Github Pages deployment is handled by a GitHub Action that runs automatically on new commits to the main branch.

    Generating a Single Document

    To combine all chapters into a single markdown file with standardized formatting:

    python bin/convert_to_single_md.py
    

    This generates scaling-book-combined.md in the repository root. The script:

    • Strips Jekyll frontmatter
    • Converts {% include figure.liquid %} to standard markdown images
    • Converts internal page links to anchor links
    • Converts inline $$ math to $
    • Strips unsupported LaTeX commands (with warnings)

    To convert the combined markdown to a Word document:

    pandoc scaling-book-combined.md -o scaling-book.docx
    

    Contributing and Contact

    If you see any issues or have questions, please leave a comment on the website itself (powered by Giscus) or in the GitHub discussion. Feel free to send a PR if you want to contribute. You can also email jaaustin [at] google [dot] com.

    To contribute on GitHub you will need to sign a Google "Contributor License Agreement" (CLA). You can do that here: https://cla.developers.google.com/clas.

    Citation

    For attribution in academic contexts, please cite this work as

    Austin et al., "How to Scale Your Model", Google DeepMind, online, 2025.

    BibTeX citation

    @article{scaling-book,
      title = {How to Scale Your Model},
      author = {Austin, Jacob and Douglas, Sholto and Frostig, Roy and Levskaya, Anselm and Chen, Charlie and Vikram, Sharad and Lebron, Federico and Choy, Peter and Ramasesh, Vinay and Webson, Albert and Pope, Reiner},
      publisher = {Google DeepMind},
      howpublished = {Online},
      note = {Retrieved from https://jax-ml.github.io/scaling-book/},
      year = {2025}
    }
    

    dragon

    This book was originally called "How To Scale Your Dragon", after the Dreamworks film, hence the dragon imagery.