{
  "schema_version": "1.0",
  "id": "T-b2bd2f8d01ff",
  "url": "https://gpuatlas.top/articles/T-b2bd2f8d01ff/",
  "title": "给 Gemma 3 27B 做 QLoRA，怎么估算自己显存够不够？",
  "summary": "Gemma 3 27B QLoRA先核混合图文训练路径，再列基础、适配器和激活，理想13.5GB并非训练总量。",
  "language": "zh-Hans",
  "category": {
    "id": "c-18",
    "name": "模型微调",
    "url": "https://gpuatlas.top/categories/c-18/"
  },
  "topics": [
    {
      "id": "model-6bfe1186af",
      "name": "Gemma 3",
      "kind": "model",
      "description": "按 Gemma 3 的具体模型大小查显卡搭配，分清权重占用、上下文开销和额外运行空间。",
      "url": "https://gpuatlas.top/topics/model-6bfe1186af/"
    }
  ],
  "body_text": "先核纯文本或图文训练路径及前向、反向和保存支持。Gemma 3 27B带视觉组件与62层混合注意力，推理可用不能直接证明当前低位训练实现完整。\n\n名义27B统一4bit原始数据约13.5GB，即约12.57GiB，实际参数、视觉、元数据与未量化层另核。QLoRA还需适配器状态、激活和缓冲，不能用这个小计给显存门槛。\n\n明确冻结范围、目标模块、rank、精度和优化器，检查实际可训练参数。图像处理和样本长度会改变峰值，纯文本短样本不能替真实图文。按支持流程准备，用真实数据完成前向、反向与更新。\n\n记录失败阶段：基础不足先查精度布局，反向不足再比微批量、长度、检查点或受支持分片。梯度累积不消除单条过长需求，重计算、通信、主存与保存汇总都要纳入完整流程。\n\n估算完不要停在一次更新。保存并恢复Gemma 3 27B适配器后，用目标图文样本检查回答，再以独立文本题检查通用能力的退步。把保存阶段的峰值与图像处理条件一并留存，才能判断候选资源是否覆盖从训练到交付的完整路径。",
  "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": "gemma3-official",
      "url": "https://raw.githubusercontent.com/google-gemma/docs/main/docs/models/gemma-3/index.md",
      "retrieved_at": "2026-11-25T11:28:43.769677+00:00"
    },
    {
      "id": "gemma3-config-code",
      "url": "https://raw.githubusercontent.com/google/gemma_pytorch/main/gemma/config.py",
      "retrieved_at": "2026-11-25T11:31:21.126309+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"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-b2bd2f8d01ff/",
    "json": "https://gpuatlas.top/data/articles/T-b2bd2f8d01ff.json",
    "markdown": "https://gpuatlas.top/data/articles/T-b2bd2f8d01ff.md"
  }
}
