{
  "schema_version": "1.0",
  "id": "T-2b1c5b884e23",
  "url": "https://gpuatlas.top/articles/T-2b1c5b884e23/",
  "title": "给 Qwen3 32B 做 QLoRA，怎么估算自己显存够不够？",
  "summary": "Qwen3 32B QLoRA按32.8B实际规模及训练状态预算，理想16.4GB基础权重之外仍需激活和缓冲。",
  "language": "zh-Hans",
  "category": {
    "id": "c-18",
    "name": "模型微调",
    "url": "https://gpuatlas.top/categories/c-18/"
  },
  "topics": [
    {
      "id": "model-3387ea7659",
      "name": "Qwen3",
      "kind": "model",
      "description": "从小模型到更大参数档位，按显卡搭配查看 Qwen3 的运行条件，并查找长文本微调与适配器验证问题。",
      "url": "https://gpuatlas.top/topics/model-3387ea7659/"
    }
  ],
  "body_text": "给Qwen3 32B做QLoRA，首先要确定实际使用的低位训练路径。模型约32.8B参数，统一按4bit计算的原始权重约16.4GB，即约15.27GiB；元数据、未量化层和实际布局尚未计入，训练总显存还要继续往上算。\n\n基础通常冻结，适配器仍需参数、梯度和优化器状态，模块、rank与精度影响大小。长度、微批量和实现影响反向激活与缓冲，推理KV不能替代这一部分，不能只靠文件可加载作判断。\n\n按支持流程准备并核可训练参数，用真实处理后样本完成前向、反向与更新，记录阶段峰值。模板、截断和回答损失范围一起检查，短样本通过不能推广到目标长文。\n\n基础不足先核精度布局，反向不足再比较微批量、长度组织、检查点或受支持分片。梯度累积不消除单条过长需求，重计算、通信、主存和保存汇总都要计入完整流程。\n\n多卡或分片方案完成更新后，还要确认适配器能保存，并在新进程正确恢复。恢复后用独立任务比较原基础和适配器的回答，若训练通过却恢复失败，预算仍未覆盖完整流程。保留各卡布局与这次失败阶段，下一次调整分片时才有依据，而不是照搬其他32B训练截图。",
  "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": "qwen3-32b",
      "url": "https://huggingface.co/Qwen/Qwen3-32B/raw/main/README.md",
      "retrieved_at": "2026-11-25T10:43:11.065868+00:00"
    },
    {
      "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-2b1c5b884e23/",
    "json": "https://gpuatlas.top/data/articles/T-2b1c5b884e23.json",
    "markdown": "https://gpuatlas.top/data/articles/T-2b1c5b884e23.md"
  }
}
