Broadcast native FLA CP chain state from the group's global owner rank - #920
Conversation
torch.distributed.broadcast takes a global rank as src. _broadcast_chain_final_state passed cp_size - 1 and _suffix_summary_exclusive_and_full passed 0, both CP-group-local indices, which only coincide with global ranks when the context-parallel group is ranks 0..cp_size-1 (TP 1, DP 1). With TP 2 the CP groups are {0, 2} and {1, 3} and the first forward raised 'Global rank 1 is not part of group'; DP x CP fails the same way. Translate through dist.get_global_rank.
Fixes #919.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Gloo regression test on four CPU ranks with CP groups {0,2}/{1,3} (TP 2) and {0,1}/{2,3} (DP 2): _broadcast_chain_final_state must deliver the last group member's state to every member, and _suffix_summary_exclusive_and_full must agree on the full-chain summary across the group. Fails on main with 'Global rank N is not part of group'.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Consolidated review record (automated agent review traffic removed 2026-09-17) Change. Fixes #919: two collectives in Review. Kang routed independent reviews to McCarthy and Minsky; both returned CLEAR for source correctness at Deferred / follow-ups.
|
Fixes #919.
torch.distributed.broadcasttakes a global rank assrc. Two collectives insrc/art/megatron/gdn/fla_cp.pypassed context-parallel-local indices instead:_broadcast_chain_final_stateusedcp_size - 1and_suffix_summary_exclusive_and_fullused0. Those coincide with global ranks only when the CP group isrange(cp_size), i.e. TP 1 and DP 1. With TP 2 on four ranks the CP groups are{0, 2}and{1, 3}, so the first GDN forward raisedValueError: Global rank 1 is not part of group; DP × CP fails the same way for the second group.Change: translate through
dist.get_global_rank(group, local_index)at both sites. No behavior change for TP 1 / DP 1 (the translation is the identity there). The neighbouring_exchange_summaryis untouched:all_to_all_singlesplit lists are group-local by design.Test:
tests/unit/test_fla_cp_group_ranks.pyspawns four gloo CPU ranks with strided ({0,2}/{1,3}) and offset ({0,1}/{2,3}) CP groups and checks that every member receives the last member's chain state and that the full-chain suffix summary agrees across the group. It passes on this branch and fails onmainwith the reported error.GPU validation: in progress on Qwen/Qwen3.8-27B (48 GDN + 16 attention layers), 4×H200, rank-1 LoRA probe forward/backward, with
ART_MEGATRON_TENSOR_MODEL_PARALLEL_SIZE=2 ART_MEGATRON_CONTEXT_PARALLEL_SIZE=2and with DP 2 × CP 2; the same workload failed on the first forward before this change. I will post step timing and peak memory here when the lanes finish.🤖 Generated with Claude Code