[Feat] Keep FSDP overlap when per-rank graphs diverge in compute - #57
Merged
Merged
Conversation
…name The feature commit deleted benchmark_inputs.py and pointed profiling/__init__.py at materialize_inputs, but the new file was never tracked, so CI failed collection. Co-authored-by: Cursor <cursoragent@cursor.com>
jiahy0825
approved these changes
Aug 17, 2026
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.
🗂️ PR Category
📝 Description
FSDP fullgraph overlap no longer requires per-rank graphs (or profiler key sets) to be identical. Ranks may diverge in pure compute while the NCCL-issuing sequence (weight AG / CP / EP) stays the same. This PR keeps overlap on in that case, instead of aborting the reorder or falling the whole cost table back to analytical.
Reorder: negotiate placement relative to the collective skeleton
snode_issues_collective: functional collectives + custom ops flaggedhas_internal_collective)._negotiate_modepicks one ofidentical/slot/pinned/abortfrom a symmetric all_gather:Profiler: lockstep-measure the key intersection
warm_and_syncmeasures keys present on every rank that also have a stashed snode (same sorted order, fixed iters), then max-reduces.Custom-op materialize-input API (
profiling/materialize_inputs.py)Replay of a custom op first generic-realizes every argument, then optionally runs a same-signature hook to rebuild value-dependent metadata (
cp_split_sizes,cu_seqlens, ...). The hook is no longer(fx_node, realize) -> (args, kwargs):register_materialize_inputs(op_name, fn=None, *, has_internal_collective=False)—fnis optional when only the collective flag is needed.apply_materialize_inputs(hook, args, kwargs)— runs the hook on already-realized args;Nonekeeps the generic realize.get_materialize_inputs_hook/op_has_internal_collective— lookup.magi_register_custom_op(..., has_internal_collective=, materialize_inputs=)wires both at registration time.Tests
identical/slot/pinned/abort) and world=2 mismatch now asserts SLOT + identical final collective sequence.materialize_inputshooks and flag-onlyhas_internal_collective.