ai-infra-interview-305

第 70 题:如何处理PP中的负载不均衡?recomputeno-recompute层的分配?

题目

如何处理PP中的负载不均衡?recomputeno-recompute层的分配?


完整讲解

一、PP 负载不均衡的来源

不同 stage 的层数、参数量、计算量不同(如 attention 与 FFN 比例、embed 与 head 数),导致各 stage 的 F/B 时间不一致,快的 stage 等慢的,bubble 或空闲增加。此外,recompute(activation checkpointing)只对部分层做,有 recompute 的 stage backward 时要多一次重算,时间变长,若分配不当会加重不均衡。

二、Recompute 与 no-recompute 的分配

三、其他手段


面试要点


记忆要点

  1. 不均衡 = 各 stage F+B+recompute 时间不一致;按耗时划分 stage。
  2. Recompute 分散到各 stage,避免单 stage 重算过多。
  3. Interleaved + 1F1B + 均衡划分 一起用。
返回模块 返回总览