fsdp: assert weight-sync grouping covers the train world#36
Open
zhihengy wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
connect_rollout_enginescomputed its per-engine rank span as rawrollout_num_gpus_per_engine, whilerollout.init_rollout_enginessizes engines withmin(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_weightswith 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 (usingall_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.