{
  "schema_version": "1.0",
  "id": "T-926c5bb5c45e",
  "url": "https://gpuatlas.top/articles/T-926c5bb5c45e/",
  "title": "32B 模型做 LoRA，显存预算应该把哪些部分算进去？",
  "summary": "32B LoRA先算具体基础驻留，再列适配器状态和激活，多卡与冻结不能单独保证完整训练可用。",
  "language": "zh-Hans",
  "category": {
    "id": "c-19",
    "name": "训练资源估算",
    "url": "https://gpuatlas.top/categories/c-19/"
  },
  "topics": [],
  "body_text": "第一项先算基础权重，并说明实际设备布局。名义32B统一16bit原始数据约64GB，具体参数与精度另核；LoRA通常冻结基础权重，不自动压缩这部分，也不能只相加多卡容量判断。\n\n第二项列适配器参数、梯度与优化器状态，模块覆盖、rank和状态精度决定大小。第三项列反向激活、损失与临时张量及缓冲，受长度、微批量、结构和实现影响，推理KV不能直接替代。\n\n先检查实际可训练参数和训练路径，用真实处理后样本完成前向、反向与更新，记录每卡峰值与主存。只通过加载或很短样本，不能说明日常长文训练可用。\n\n普通数据并行不自动分摊全部基础权重，分片和卸载需核每卡布局与通信。梯度累积不解决单条过长输入，检查点带来重计算，保存汇总也可能产生独立峰值。\n\n32B LoRA若在更新时通过、保存汇总时失败，仍不能作为可完成的训练配置。先对照汇总时的每卡布局与主存，修正这部分预算，再恢复适配器检查独立任务。把通信和重计算计入完整作业，才能比较分片方案是否值得采用。",
  "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"
    },
    {
      "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-926c5bb5c45e/",
    "json": "https://gpuatlas.top/data/articles/T-926c5bb5c45e.json",
    "markdown": "https://gpuatlas.top/data/articles/T-926c5bb5c45e.md"
  }
}
