Skip to content

fsdp: assert weight-sync grouping covers the train world#36

Open
zhihengy wants to merge 1 commit into
mainfrom
fix/weight-sync-grouping-assert
Open

fsdp: assert weight-sync grouping covers the train world#36
zhihengy wants to merge 1 commit into
mainfrom
fix/weight-sync-grouping-assert

Conversation

@zhihengy

@zhihengy zhihengy commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

connect_rollout_engines computed its per-engine rank span as raw rollout_num_gpus_per_engine, while rollout.init_rollout_engines sizes engines with min(rollout_num_gpus_per_engine, num_gpus_per_node). For every current single-node config the two coincide — behavior is byte-identical for all existing recipes (Wan / SD3 / Qwen-Image; the qwen OCR e2e in CI exercises this path).

Honest scope statement for the multi-node colocate case (engine TP spanning nodes): neither convention yields a working weight push there — the FromTensor path is CUDA-IPC based and cannot cross nodes, so the old code failed much later inside update_bucket_weights with no indication of cause. The new assert (world == engines × span) turns that into a connect-time failure with the three numbers spelled out. Proper multi-node weight sync needs per-node-shard grouping (using all_rollout_engines, not the deduped list) and its own design — out of scope here; this PR only makes the unsupported case fail loudly instead of mysteriously.

connect_rollout_engines' per-engine rank span silently disagreed with
rollout.init_rollout_engines' (raw rollout_num_gpus_per_engine vs
min(rollout_num_gpus_per_engine, num_gpus_per_node)). For every current
single-node config the two coincide and behavior is unchanged.

For multi-node colocate (engine TP spanning nodes) NEITHER convention
yields a working weight push: the FromTensor path is CUDA-IPC based and
cannot cross nodes, so the old code failed much later inside
update_bucket_weights. The new assert (world == engines x span) makes
such configs fail at connect time with the three numbers spelled out.
Proper multi-node weight sync needs per-node-shard grouping and is out
of scope here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant