{
  "generatedAt": "2026-08-31T15:34:19.816645+00:00",
  "environment": {
    "python": "3.12.13",
    "torch": "2.13.0+cpu",
    "cudaAvailable": false,
    "cudaRuntime": null
  },
  "summary": {
    "lessons": 74,
    "syntaxChecked": 74,
    "cpuExecuted": 39,
    "hardwareOrContextRequired": 35,
    "failed": 0,
    "projectsPassed": 3
  },
  "lessons": [
    {
      "chapter": "python-and-installation",
      "title": "只学够用的 Python：变量、函数、容器与循环",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "epoch=1/3 loss=1.20\nepoch=2/3 loss=0.80\nepoch=3/3 loss=0.50\nmean loss: 0.8333333333333334"
    },
    {
      "chapter": "python-and-installation",
      "title": "NumPy 到 Tensor：先理解数组再理解框架",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "shape: (3, 4) torch.Size([3, 4])\ncolumn mean: tensor([4., 5., 6., 7.])\nshared value: 99.0"
    },
    {
      "chapter": "python-and-installation",
      "title": "按机器安装 PyTorch，并读懂 CUDA 版本",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "PyTorch: 2.13.0+cpu\nCUDA available: False\nwheel CUDA runtime: None\n当前走 CPU 路径；这不是安装失败。"
    },
    {
      "chapter": "first-tensor",
      "title": "先搭一个不容易坏的 PyTorch 环境",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "2.13.0+cpu\nCUDA available: False\nCUDA runtime: None\ndevice count: 0"
    },
    {
      "chapter": "first-tensor",
      "title": "Tensor 到底是什么",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([]) 0 torch.float32 cpu\ntorch.Size([2, 3]) 2 torch.int64 cpu\ntorch.Size([2, 3, 16]) 3 torch.float32 cpu"
    },
    {
      "chapter": "first-tensor",
      "title": "创建、复制与共享内存",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([99.,  2.,  3.])\ntensor([1., 2., 3.])"
    },
    {
      "chapter": "first-tensor",
      "title": "dtype 为什么会影响速度、显存和精度",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.float32 4.0 MiB\ntorch.float16 2.0 MiB\ntorch.bfloat16 2.0 MiB"
    },
    {
      "chapter": "first-tensor",
      "title": "CPU、CUDA 与设备无关代码",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "cpu"
    },
    {
      "chapter": "first-tensor",
      "title": "随机数、种子与可复现边界",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([0.8823, 0.9150, 0.3829])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "用 shape 推理，而不是靠试错",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([2, 5, 16])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "索引、切片与布尔选择",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([ 0,  2,  4,  6,  8, 10])\ntensor([[ 0, -1,  2, -1],\n        [ 4, -1,  6, -1],\n        [ 8, -1, 10, -1]])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "reshape、view、transpose 与 contiguous",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "False\ntorch.Size([2, 12]) torch.Size([2, 12])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "广播机制与隐形内存",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([2, 4, 8, 8])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "矩阵乘法、bmm 与 einsum",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "True torch.Size([2, 4, 6, 6])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "数值稳定：softmax、logsumexp 与归一化",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([nan, nan, nan])\ntensor([0.0900, 0.2447, 0.6652])\ntensor([0.0900, 0.2447, 0.6652])"
    },
    {
      "chapter": "tensor-shapes",
      "title": "原地操作、别名与内存安全",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([2., 2., 2.])"
    },
    {
      "chapter": "autograd",
      "title": "动态计算图如何记录运算",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor(14.)"
    },
    {
      "chapter": "autograd",
      "title": "叶子 Tensor、grad_fn 与 retain_grad",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "True False\ntensor([8., 8., 8.]) tensor([4., 4., 4.])"
    },
    {
      "chapter": "autograd",
      "title": "为什么每步都要清空梯度",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor(6.)\ntensor(3.)"
    },
    {
      "chapter": "autograd",
      "title": "停止梯度：no_grad、inference_mode 与 detach",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "False False False"
    },
    {
      "chapter": "autograd",
      "title": "梯度钩子与调试梯度流",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "grad norm: 1.2476768493652344"
    },
    {
      "chapter": "autograd",
      "title": "自定义 autograd Function 何时需要",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor(12.)"
    },
    {
      "chapter": "modules-and-training",
      "title": "nn.Module 不只是一个 Python 类",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    },
    {
      "chapter": "modules-and-training",
      "title": "forward、call 与训练/评估模式",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([0., 2., 2., 2., 0., 0., 0., 0.])\ntensor([1., 1., 1., 1., 1., 1., 1., 1.])\ntensor([1., 1., 1., 1., 1., 1., 1., 1.])"
    },
    {
      "chapter": "modules-and-training",
      "title": "选择损失函数并检查输入约定",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "2.6925745010375977"
    },
    {
      "chapter": "modules-and-training",
      "title": "优化器、参数组与权重衰减",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    },
    {
      "chapter": "modules-and-training",
      "title": "写对一个最小训练循环",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "modules-and-training",
      "title": "学习率调度与 warmup",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "modules-and-training",
      "title": "checkpoint：保存的不只是模型权重",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "data-pipeline",
      "title": "Dataset 与 DataLoader 各管什么",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "[tensor([71., 65., 22.,  7., 78., 35., 27., 68.]), tensor([143., 131.,  45.,  15., 157.,  71.,  55., 137.])]"
    },
    {
      "chapter": "data-pipeline",
      "title": "collate_fn 与变长序列 padding",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "{'input_ids': tensor([[2, 5, 8],\n        [4, 9, 0]]), 'attention_mask': tensor([[ True,  True,  True],\n        [ True,  True, False]])}"
    },
    {
      "chapter": "data-pipeline",
      "title": "shuffle、Sampler 与数据顺序",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    },
    {
      "chapter": "data-pipeline",
      "title": "多进程加载、pin_memory 与 non_blocking",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "data-pipeline",
      "title": "IterableDataset 与流式语料",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    },
    {
      "chapter": "data-pipeline",
      "title": "数据划分、污染与可复现检查",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "Embedding：把 token id 变成向量",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([2, 3, 128])"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "单头缩放点积注意力",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([5, 5]) torch.Size([5, 8]) tensor([1.0000, 1.0000, 1.0000, 1.0000, 1.0000])"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "多头注意力的拆分与合并",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([2, 6, 32])"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "因果掩码为什么放在 softmax 前",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([[1.0000, 0.0000, 0.0000, 0.0000, 0.0000],\n        [0.8308, 0.1692, 0.0000, 0.0000, 0.0000],\n        [0.1161, 0.2881, 0.5959, 0.0000, 0.0000],\n        [0.0753, 0.0281, 0.6629, 0.2337, 0.0000],\n        [0.1484, 0.0297, 0.2392, 0.4515, 0.1312]]) tensor([[[1.0000, 1.0000, 1.0000, 1.0000, 1.0000],\n         [1.0000, 1.0000, 1.0000, 1.0000, 1.0000]]])"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "残差、LayerNorm 与 Pre-Norm",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "位置编码与 RoPE 的接口直觉",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "torch.Size([2, 4, 8, 16])"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "用 scaled_dot_product_attention 获得融合内核",
      "kind": "需要 CUDA",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "transformer-from-scratch",
      "title": "组装一个 Decoder Block 并数清参数",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "stable-training",
      "title": "初始化如何影响信号与梯度",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "1.0068525075912476 0.6379854083061218"
    },
    {
      "chapter": "stable-training",
      "title": "AMP：autocast 与 GradScaler 分工",
      "kind": "需要 CUDA",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "stable-training",
      "title": "梯度累积如何模拟更大 batch",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "stable-training",
      "title": "梯度裁剪解决什么、不解决什么",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "stable-training",
      "title": "系统定位 NaN 与 Inf",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "stable-training",
      "title": "最小可复现实验与训练监控",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "先定义正确的性能指标",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "用 PyTorch Profiler 找真正瓶颈",
      "kind": "伪代码／接口示意",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "显存到底花在哪里",
      "kind": "需要 CUDA",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "激活检查点：用计算换显存",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "torch.compile 能优化什么",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "performance",
      "title": "减少同步、拷贝与 Python 开销",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "先建立 rank、world size 与进程组概念",
      "kind": "需要多卡",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "集合通信：all-reduce 与 reduce-scatter",
      "kind": "需要多卡",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "DistributedDataParallel 的正确骨架",
      "kind": "需要多卡",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "FSDP2 为什么能训练更大模型",
      "kind": "伪代码／接口示意",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "Tensor Parallel 与二维并行",
      "kind": "伪代码／接口示意",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "distributed",
      "title": "分布式挂起与排错清单",
      "kind": "伪代码／接口示意",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "Transformers：从 Tokenizer 到预训练模型",
      "kind": "需要额外依赖",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "Datasets：可复现的数据加载与 map",
      "kind": "需要额外依赖",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "Accelerate：让训练循环适配设备与分布式",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "PEFT：用官方库完成 LoRA 微调",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "torchao：训练到推理的原生量化入口",
      "kind": "需要 CUDA",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "llm-ecosystem",
      "title": "TorchTitan：阅读官方大规模预训练配方",
      "kind": "伪代码／接口示意",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "把文本变成 next-token 训练样本",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": "tensor([ 7, 10, 13,  0,  6,  1,  4,  5]) tensor([10, 13,  0,  6,  1,  4,  5,  2])"
    },
    {
      "chapter": "mini-llm-project",
      "title": "搭建最小 Decoder-only Language Model",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "训练、验证与过拟合一个小批次",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "自回归生成、温度与 top-k",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "KV Cache 为什么能加速解码",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "用 LoRA 思想做参数高效微调",
      "kind": "承接上一节",
      "syntax": "passed",
      "runtime": "hardware-or-context-required"
    },
    {
      "chapter": "mini-llm-project",
      "title": "把项目整理成算法岗可讲述的证据",
      "kind": "可独立运行",
      "syntax": "passed",
      "runtime": "cpu-verified",
      "output": ""
    }
  ],
  "projects": {
    "classifier": {
      "passed": true,
      "returnCode": 0,
      "output": "epoch=01 val_loss=0.6765 val_acc=0.549\nepoch=02 val_loss=0.6616 val_acc=0.539\nepoch=03 val_loss=0.6438 val_acc=0.627\nepoch=04 val_loss=0.6256 val_acc=0.706\nepoch=05 val_loss=0.6038 val_acc=0.765",
      "error": ""
    },
    "decoderBlock": {
      "passed": true,
      "returnCode": 0,
      "output": "shape=(2, 12, 64) parameters=49728 causal_check=passed device=cpu",
      "error": ""
    },
    "miniLm": {
      "passed": true,
      "returnCode": 0,
      "output": "step=0001 loss=42.6537\nstep=0002 loss=40.1690\nstep=0003 loss=36.2320\nstep=0004 loss=32.7453\nstep=0005 loss=26.8343\ngenerated: 云云云云云云",
      "error": ""
    }
  }
}
