{
  "schema_version": "1.0",
  "id": "T-3b1df2c6e5e9",
  "url": "https://gpuatlas.top/articles/T-3b1df2c6e5e9/",
  "title": "14B 模型做 LoRA，显存预算应该把哪些部分算进去？",
  "summary": "14B LoRA先预算完整基础权重，再列适配器训练状态和激活，rank小也不能单独保证显存够用。",
  "language": "zh-Hans",
  "category": {
    "id": "c-19",
    "name": "训练资源估算",
    "url": "https://gpuatlas.top/categories/c-19/"
  },
  "topics": [],
  "body_text": "第一项是实际基础权重。名义14B统一16bit原始数据约28GB，具体参数、精度与加载路径另核；LoRA通常冻结基础，不自动压缩它，不能把适配器文件很小当作整个训练轻量。\n\n第二项是新增适配器参数、梯度和优化器状态，目标模块、rank及状态精度决定大小。第三项是反向激活、损失与临时张量及缓冲，受结构、长度、微批量和实现影响，推理KV不能直接替代。\n\n先核实际可训练参数，用真实处理后样本完成前向、反向与更新，分别观察峰值。不同14B模型层数与模块可能不同，不能只看规模标签就沿用另一模型预算。\n\n若基础驻留已超预算，先研究支持的精度或布局；若加载通过而反向失败，再比较微批量、长度与检查点。梯度累积不解决单条过长需求，重计算和分片通信需加入完整时间，保存汇总也要测试。\n\n若14B基础能加载、长样本反向却超预算，就保存该样本对应的模块、rank与阶段峰值，先定位激活或训练状态的缺口。调整后的方案还要完成适配器保存与独立恢复，再检查目标题质量，不能只凭低rank或加载截图确认资源够用。",
  "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": "peft-quantization",
      "url": "https://raw.githubusercontent.com/huggingface/peft/main/docs/source/developer_guides/quantization.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "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"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-3b1df2c6e5e9/",
    "json": "https://gpuatlas.top/data/articles/T-3b1df2c6e5e9.json",
    "markdown": "https://gpuatlas.top/data/articles/T-3b1df2c6e5e9.md"
  }
}
