{
  "schema_version": "1.0",
  "id": "T-796389f0a5aa",
  "url": "https://gpuatlas.top/articles/T-796389f0a5aa/",
  "title": "70B 模型做 全参数微调，长文本和大 batch 应该先保哪个？",
  "summary": "70B全参数微调先保必要证据与答案，固定有效长度后再调微批量和并行，大批量收益必须用验证任务判断。",
  "language": "zh-Hans",
  "category": {
    "id": "c-19",
    "name": "训练资源估算",
    "url": "https://gpuatlas.top/categories/c-19/"
  },
  "topics": [
    {
      "id": "task-e33d9598da",
      "name": "微调",
      "kind": "task",
      "description": "让模型适应自己的任务，从训练方式、样本和显存预算入手，最后验证适配器是否真正起效。",
      "url": "https://gpuatlas.top/topics/task-e33d9598da/"
    },
    {
      "id": "task-a7bab8d8aa",
      "name": "长文本",
      "kind": "task",
      "description": "长文本训练会增加哪些中间开销？查看序列长度与 batch 的取舍，避免只按模型权重估算显存。",
      "url": "https://gpuatlas.top/topics/task-a7bab8d8aa/"
    }
  ],
  "body_text": "先保任务确实需要的有效上下文，再安排批量。70B全参数更新的权重状态和反向激活都可能占较大空间，推理能加载或集群总容量足够，不能证明训练长度与批量可以同时拉高。\n\n查看处理后token、模板、历史、回答、截断、填充和打包，确保关键材料与答案仍在有效损失范围。短任务盲目拉长可能浪费资源，长任务过度截断则改变真正的学习目标。\n\n固定必要长度，以小微批量完成前向、反向和更新，记录每卡阶段峰值，再逐档增加。梯度累积可调整有效批量，但不能让单条过长样本自动装下；学习率、归一化与数据分布也需一起核对。\n\n检查点、分片和卸载按实际支持分别测试，记录重计算、通信、主存与完整时间。加载、更新和保存可能有不同状态布局，稳定训练的一步截图不能代表全部流程，保存恢复也要通过。\n\n70B全参数训练恢复必要长度后，先核每卡在哪个阶段到达边界，再决定是减微批量、用受支持检查点还是调整分片。增加批量的候选方案还要对照独立验证，确认没有用质量退步换吞吐。保存恢复和完整作业时间通过，才有理由扩大日常训练规模。",
  "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": "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": "llamafactory-data-args",
      "url": "https://raw.githubusercontent.com/hiyouga/LLaMA-Factory/main/src/llamafactory/hparams/data_args.py",
      "retrieved_at": "2026-11-25T11:04:14.292936+00:00"
    },
    {
      "id": "deepspeed-zero",
      "url": "https://deepspeed.readthedocs.io/en/latest/zero3.html",
      "retrieved_at": "2026-11-25T10:21:36.176985+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-796389f0a5aa/",
    "json": "https://gpuatlas.top/data/articles/T-796389f0a5aa.json",
    "markdown": "https://gpuatlas.top/data/articles/T-796389f0a5aa.md"
  }
}
