{
  "schema_version": "1.0",
  "id": "T-9d5588177ab9",
  "url": "https://gpuatlas.top/articles/T-9d5588177ab9/",
  "title": "8B 模型做 全参数微调，显存预算应该把哪些部分算进去？",
  "summary": "8B全参数先核真实状态精度，18字节假设约144GB仅为状态小计，激活与保存峰值需独立观察。",
  "language": "zh-Hans",
  "category": {
    "id": "c-19",
    "name": "训练资源估算",
    "url": "https://gpuatlas.top/categories/c-19/"
  },
  "topics": [
    {
      "id": "task-e33d9598da",
      "name": "微调",
      "kind": "task",
      "description": "让模型适应自己的任务，从训练方式、样本和显存预算入手，最后验证适配器是否真正起效。",
      "url": "https://gpuatlas.top/topics/task-e33d9598da/"
    }
  ],
  "body_text": "先列权重、梯度、优化器状态和可能的主权重，再加激活与运行缓冲。8B只是规模标签，实际参数、精度和框架布局会改变预算，不能只拿权重文件判断训练。\n\n一个明确假设：每参数权重2字节、梯度4字节、Adam两份状态共8字节、主权重4字节，共18字节。名义8B对应144GB，只覆盖列出的状态，不含激活和其他开销；这不是所有混合精度框架默认。\n\n对照实际配置逐项替换，记录状态在哪、是否分片、何时汇总。不能把144GB直接除以单卡容量就宣布够用，主存、每卡布局和通信也可能决定边界。\n\n用真实长度与微批量完成前向、反向、更新和保存恢复，记录阶段峰值。推理KV不能预测激活，梯度累积不自动降低单条长样本需求，检查点增加重计算，分片会引入通信。\n\n将8B作业实际使用的梯度、Adam状态与主权重精度填回预算，再观察更新和保存阶段是否按预期分布。若实际布局不同，先修正144GB示例所依赖的假设。恢复后用独立题检查质量，并将通信与重计算计入作业时间，才有依据选择资源。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "transformers-training-memory",
      "url": "https://raw.githubusercontent.com/huggingface/transformers/main/docs/source/en/model_memory_anatomy.md",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    },
    {
      "id": "torch-checkpoint",
      "url": "https://docs.pytorch.org/docs/2.15/checkpoint.html",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    },
    {
      "id": "deepspeed-zero",
      "url": "https://deepspeed.readthedocs.io/en/latest/zero3.html",
      "retrieved_at": "2026-11-25T10:21:36.176985+00:00"
    },
    {
      "id": "torch-fsdp",
      "url": "https://docs.pytorch.org/docs/2.15/fsdp.html",
      "retrieved_at": "2026-11-25T10:21:36.176985+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-9d5588177ab9/",
    "json": "https://gpuatlas.top/data/articles/T-9d5588177ab9.json",
    "markdown": "https://gpuatlas.top/data/articles/T-9d5588177ab9.md"
  }
}
