{
  "schema_version": "1.0",
  "id": "T-986b2e36671a",
  "url": "https://gpuatlas.top/articles/T-986b2e36671a/",
  "title": "32B 模型做 QLoRA，显存预算应该把哪些部分算进去？",
  "summary": "32B QLoRA预算包含基础驻留、适配器状态、激活与每卡开销，理想16GB权重只是筛选起点。",
  "language": "zh-Hans",
  "category": {
    "id": "c-19",
    "name": "训练资源估算",
    "url": "https://gpuatlas.top/categories/c-19/"
  },
  "topics": [],
  "body_text": "先分基础权重、适配器训练状态、激活和运行开销。名义32B统一4bit原始数据约16GB，只是理想算术；实际参数、元数据和未量化层改变驻留，不能把它当训练总显存。\n\n基础权重通常冻结，但适配器仍需参数、梯度和优化器状态，模块覆盖、rank及精度共同影响需求。长度、微批量和注意力实现影响激活，这些部分不会自动按基础权重位宽压缩。\n\n按实际支持流程准备模型，核对可训练参数，用真实处理后样本完成前向、反向和更新，记录每卡阶段峰值。推理加载成功不能证明反向、保存和恢复可用，目标任务的长度必须进入验收。\n\n多卡不能只相加容量，普通副本不自动减少每卡全部基础权重。分片、卸载和检查点分别核设备布局、主存、通信和重计算，梯度累积不消除单条过长输入，保存汇总另测。\n\n32B QLoRA预算中最容易漏掉的，是低位加载通过之后的反向与保存阶段。用目标任务的真实长度走完这两步，再恢复适配器检查独立答案；哪一步失败，就对照相应每卡布局定位。约16GB原始权重只能帮助初筛，不能替代这份流程记录。",
  "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-986b2e36671a/",
    "json": "https://gpuatlas.top/data/articles/T-986b2e36671a.json",
    "markdown": "https://gpuatlas.top/data/articles/T-986b2e36671a.md"
  }
}
