[JAX] Support axes orthogonal to EP in ep_bootstrap via mesh-derived domain grouping#3226
[JAX] Support axes orthogonal to EP in ep_bootstrap via mesh-derived domain grouping#3226phu0ngng wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes
Confidence Score: 5/5Safe to merge — the new mesh-driven domain grouping is correct for all axis layouts, the old dp-only path is a strict special case, and the tightened world_size validation makes mismatches explicit. The core change replaces a simple arithmetic assumption with a general mesh traversal that handles any number of orthogonal axes. The single-process unit test exercises a concrete 4x2 mesh and asserts ndom inside the loop. No existing call sites are broken because the new path is a superset of the old one. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant P as Process (rank r)
participant D as _ep_domain_for_rank
participant N as libnccl
participant G as _allgather_uid (all ranks)
participant B as set_ep_bootstrap_params
P->>D: mesh, ep_resource, rank
D-->>P: root_rank, rank_within_group, num_domains
alt "rank_within_group == 0"
P->>N: ncclGetUniqueId()
N-->>P: uid_bytes (128 B)
else
P->>P: "uid_bytes = zeros(128)"
end
P->>G: uid_arr (local 128 B)
G-->>P: all_uids[world_size x 128]
P->>P: "uid_bytes = all_uids[root_rank]"
P->>B: uid_bytes, ep_size, rank_within_group
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant P as Process (rank r)
participant D as _ep_domain_for_rank
participant N as libnccl
participant G as _allgather_uid (all ranks)
participant B as set_ep_bootstrap_params
P->>D: mesh, ep_resource, rank
D-->>P: root_rank, rank_within_group, num_domains
alt "rank_within_group == 0"
P->>N: ncclGetUniqueId()
N-->>P: uid_bytes (128 B)
else
P->>P: "uid_bytes = zeros(128)"
end
P->>G: uid_arr (local 128 B)
G-->>P: all_uids[world_size x 128]
P->>P: "uid_bytes = all_uids[root_rank]"
P->>B: uid_bytes, ep_size, rank_within_group
Reviews (3): Last reviewed commit: "[JAX] Support axes orthogonal to EP in e..." | Re-trigger Greptile |
…domain grouping Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
|
/te-ci JAX L1 |
Support axes orthogonal to EP in ep_bootstrap via mesh-derived domain grouping
Type of change
Checklist: