面向 LLM 推理、训练与服务系统的系统化知识库,按“公式 -> 原理 -> 代码 -> 面试表达”四层组织,适合直接放进 GitBook 连续阅读,也适合作为面试前的速查手册。
- 新增 GitBook 目录页:SUMMARY.md
- 统一重写首页和各模块 README,导航结构更清晰
- 新增“公式到源码”对照页:notes/attention/formula-to-code-walkthrough.md
- 修复多处会导致 Markdown / GitBook 公式渲染异常的表格写法
- 增加文档校验脚本:scripts/validate_markdown_math.py
| 你的目标 | 建议入口 | 你会得到什么 |
|---|---|---|
| 30 分钟内速查 | math_dictionary/README.md | 公式、变量定义、张量形状、性能估算 |
| 系统学习推理链路 | notes/README.md | 从注意力、KV Cache 到 serving 的长文笔记 |
| 对照源码理解实现 | src/README.md | NumPy / PyTorch 最小实现与运行入口 |
| 准备面试表达 | mock_interview/README.md | 按主题、公司、行为面试组织的问题库 |
| 按计划推进 | roadmap/README.md | 12 周冲刺和 45 天日程安排 |
- 直接从 SUMMARY.md 打开整站目录,侧边栏层级已经按 GitBook 阅读习惯重新整理。
- 如果你只想看“公式 + 张量形状 + 对应代码”,从 notes/attention/formula-to-code-walkthrough.md 开始。
- 如果你正在排查公式渲染问题,先运行
python scripts/validate_markdown_math.py。
- math_dictionary/README.md:公式索引、推导入口、量级估算。
- math_dictionary/transformer-attention-math.md:Attention、RoPE、LayerNorm、RMSNorm、SwiGLU。
- math_dictionary/flashattention-math.md:在线 Softmax、分块 IO、FA-2 / FA-3。
- math_dictionary/kv-memory.md:KV Cache 显存估算与容量规划。
- math_dictionary/prefill-decode-performance.md:Prefill / Decode 的带宽与时延分析。
- notes/README.md:所有主题笔记的总入口。
- notes/attention/README.md:注意力演进、长上下文、MHA / GQA / MLA / DSA / Linear。
- notes/frameworks/vllm-architecture.md:vLLM 架构拆解。
- notes/training/pretraining-pipeline.md:预训练全链路。
- notes/rl-infra/rl-training-inference-systems.md:RL 训练与推理系统协同。
- src/README.md:最小实现和运行方法。
- src/from_scratch/README.md:from scratch 路线图。
- notebooks/README.md:HTML 讲解稿和 notebook 源文件。
- tests/README.md:测试入口与覆盖范围。
- mock_interview/README.md:按主题、公司、行为问题组织的题库。
- roadmap/README.md:12 周冲刺与 45 天执行节奏。
- benchmarks/README.md:热点、复盘和自测记录。
- math_dictionary/symbols-glossary.md
- math_dictionary/tensor-shapes.md
- math_dictionary/kv-memory.md
- math_dictionary/serving-metrics.md
- mock_interview/by-topic/README.md
- notes/basics/README.md
- notes/attention/README.md
- notes/kv-cache/README.md
- notes/inference/README.md
- notes/distributed/README.md
- notes/serving/README.md
- math_dictionary/transformer-attention-math.md
- notes/attention/formula-to-code-walkthrough.md
- src/attention/mha_gqa.py
- src/attention/rope_rmsnorm.py
- src/attention/flash_attn_sim.py
- 新增公式页时,优先用独立段落的
$$ ... $$,不要把带竖线的公式直接塞进表格。 - 需要在表格里写范数或 KL 时,优先使用
\lVert \cdot \rVert、\parallel、\lvert x \rvert这类写法。 - 每个专题最好同时给出:公式、张量形状、工程结论、对应源码。
- 维护侧边栏时,优先同步更新 SUMMARY.md。
git clone https://github.com/jerry609/LLM-REVIEW.git
cd LLM-REVIEW
pip install torch numpy pytest
python scripts/validate_markdown_math.py
python -m pytest tests -v如果你当前只想阅读,不想跑代码,直接从 SUMMARY.md 或 math_dictionary/README.md 开始即可。