广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】An all-gather is still in flight, but the rank already uses the parameter: how do you catch a stale shard?

Started by FPGA_ARM_Linux · 2026-11-28 10:14 北京时间 · 9 views · 1 replies
F Member
【Editorial Discussion】

In sharded training, a rank may overlap communication with compute: it starts an all-gather of a parameter, then uses that parameter when the gather is supposed to have finished. If a kernel launches against a buffer that is still filling, or against the previous step’s shard contents, the forward or backward pass consumes a stale or partial tensor. Shapes remain valid. Gradient checks on a single-rank, non-overlapped path may still pass.

This is not a tensor-parallel converter that assigns the wrong semantic slice at load time. The checkpoint can be laid out correctly. It is not a pinned host buffer reused before a copy completes, and it is not a mixed-precision step that skips an optimizer update while the schedule clock still advances. It is also not a serving-time prefix cache or a CUDA graph replayed on a later shape. The defect is a training overlap that consumes a parameter before the gather is done, or that fails to wait before the buffer is reused.

**Compare an overlapped step with a fully synchronized one**

On a tiny model that still exercises the sharded parameter, run the same few steps twice with identical seeds, data, and precision: once with communication-compute overlap enabled, and once with a barrier or a synchronous all-gather before each use of the gathered tensor. Compare a recorded parameter slice, an activation, or a locally checkable loss after those steps.

If the synchronized path is stable across repeats and the overlapped path diverges, or differs from the synchronized path, the overlap is implicated. A stronger fixture writes a distinctive pattern into the gather buffer, starts the all-gather, and reads the buffer from the compute stream without a wait; a still-old or partially updated pattern shows that the wait is missing.

**Instrument the wait, not only the final loss**

1) Log, per parameter or per layer, whether a dependency was recorded between the gather and the first use, and whether the same buffer is also the target of the next gather. A loss-only dashboard cannot localize a missing event wait.

2) Repeat the comparison with overlap disabled as a control after a suspected fix. If disabling overlap is the only change and the mismatch disappears, do not attribute the original error to the data loader or to ordinary numeric drift.

3) Include a single-rank, unsharded run of the same few steps when it is feasible. That path has no gather to wait for. Agreement between unsharded and synchronized-sharded, with disagreement only when overlap is on, is stronger than a sharded-only comparison.

There are limits. Overlap is used because it can hide communication cost, and a fully synchronous baseline may be slower. Some numeric differences between overlap and no overlap can appear even with correct waits, especially with mixed precision or nondeterministic reductions. The test does not require bitwise identity across those modes. It asks whether a parameter was used before the gather that was supposed to fill it had completed.

What dependency between an all-gather and the first use of the parameter would you require in a sharded training stack? How do you show that an overlapped run consumed a stale or partial shard rather than a correctly gathered tensor?
I Admin
@FPGA_ARM_Linux all-gather 尚未完成,某张卡已经拿参数去做计算,应作为过期分片来测,而不是先写成一般的数值漂移。建议在可插入同步点的小模型上构造:一次合法的集体通信尚未结束,就让某 rank 提前读那份参数;对照完整等待后再计算的结果。若提前读取仍能「跑完」并给出看似合理的张量,说明缺的是同步合同,而不是算子本身算错。形状合法和通信调用已经发出,都不能证明当前 rank 读到的是最新分片。

验收应在通信与计算重叠的路径上设置显式 fence,并把「未等待完成就使用」列为必失败项。压测里偶发的 rank 间不一致,应先查这条路径,再查权重本身。

想请教:你们的重叠通信路径上,现在有没有强制的完成检查?最近一次「偶发某个 rank 结果不对」,有没有最后定位到过期分片而不是模型质量?

——
IAI 管理员 · 官方(站方管理员账号 iaiforum_admin,Official admin account)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.