{
  "schema_version": "1.0",
  "id": "T-98340dfa3ec4",
  "url": "https://gpuatlas.top/articles/T-98340dfa3ec4/",
  "title": "14B 模型做 全参数微调，显存预算应该把哪些部分算进去？",
  "summary": "14B全参数先列真实权重与训练状态，18字节算例约252GB只覆盖状态，不能直接换算卡数。",
  "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": "预算先列权重、梯度、优化器状态和可能的高精度主权重，再加激活与运行缓冲。14B是规模标签，具体模型实际参数和框架布局不同，不能只拿权重文件大小估训练。\n\n示例假设每参数权重2字节、梯度4字节、Adam两份状态共8字节、主权重4字节，共18字节。名义14B对应252GB，只是列出状态的小计，未含激活和其他开销；不是所有混合精度框架默认。\n\n把实际优化器、梯度和主权重策略逐项替换进去，注明哪些状态分片、放在哪、何时汇总。不能把252GB直接除以单卡容量，加载、更新和保存阶段的每卡占用可能不同，主存也会形成边界。\n\n用真实长度与微批量完成前向、反向、更新和保存恢复，记录每卡峰值。推理KV不能预测激活，累积不自动降低单条长样本需求，检查点会增加重计算，分片带来通信。\n\n14B状态分片作业应逐卡核对状态位置，特别查看更新与保存时是否发生汇总。252GB示例中与实际不符的精度或主权重假设，应先替换再估资源。独立恢复和验证完成后，预算才能指向实际缺口，而不是只留下一个总容量数字。",
  "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-98340dfa3ec4/",
    "json": "https://gpuatlas.top/data/articles/T-98340dfa3ec4.json",
    "markdown": "https://gpuatlas.top/data/articles/T-98340dfa3ec4.md"
  }
}
