{
  "schema_version": "1.0",
  "id": "T-09111a1ee805",
  "url": "https://gpuatlas.top/articles/T-09111a1ee805/",
  "title": "多卡训练加卡不加速，是通信还是数据加载慢？",
  "summary": "多卡不加速需先统一有效工作量，再沿各rank数据、计算和同步时间定位，不能用卡数预设线性收益。",
  "language": "zh-Hans",
  "category": {
    "id": "c-05",
    "name": "微调与训练",
    "url": "https://gpuatlas.top/categories/c-05/"
  },
  "topics": [
    {
      "id": "task-b96aecbcf0",
      "name": "多卡",
      "kind": "task",
      "description": "需要把模型拆到多张卡，还是各卡独立提供服务？查阅并行方式、通信初始化与利用率问题。",
      "url": "https://gpuatlas.top/topics/task-b96aecbcf0/"
    },
    {
      "id": "task-796e01d5af",
      "name": "训练",
      "kind": "task",
      "description": "模型训练时的资源占用与推理不同。查看优化器、激活值、并行策略和中断恢复相关问题。",
      "url": "https://gpuatlas.top/topics/task-796e01d5af/"
    }
  ],
  "body_text": "多卡训练加卡不加速，通信、数据、负载不均或计算粒度都可能影响。设备更多带来同步与供应要求，不能只按卡数乘单卡速度。\n\n先统一模型、长度、精度和有效工作量。加卡若改变有效batch和步数，应按相同数据量或token、最终质量比较，每步做的事不同，单步秒数不能直接说明效率。\n\n对齐各rank时间，数据到达前是否空闲，计算后是否长时间同步，哪一进程最晚进入下一步。部分卡等待与全部卡缺数据不同，后续集体等待也可能只是一个进程先变慢的结果。\n\n用已处理的代表小数据和真实读取路径对照，保持长度分布，主要差异在供应时再看预处理、CPU、主存与存储。若通信占比高，再核对并行策略、实际互联与同步工作粒度。\n\n若预处理后的小数据明显更快，就沿CPU、主存和存储供应排查；若各rank主要等在同步，再检查并行策略与真实互联。调整不能靠关闭必要同步来换速度。把读取、通信、检查点耗时和有效token一起记下，按达到同一质量的总成本决定是否继续加卡；batch变了还要重查优化效果。",
  "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": "torch-distributed",
      "url": "https://docs.pytorch.org/docs/2.15/distributed.html",
      "retrieved_at": "2026-11-25T10:16:15.738480+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": "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-09111a1ee805/",
    "json": "https://gpuatlas.top/data/articles/T-09111a1ee805.json",
    "markdown": "https://gpuatlas.top/data/articles/T-09111a1ee805.md"
  }
}
