Skip to content

Conversation

@IvanKobzarev
Copy link
Contributor

@IvanKobzarev IvanKobzarev commented Oct 10, 2025

Stacked PRs:


Pass to split all_gather prologue and reduce_scatter prologue from fsdp graph

IvanKobzarev added a commit that referenced this pull request Oct 10, 2025
stack-info: PR: #201, branch: IvanKobzarev/stack/9
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 10, 2025
IvanKobzarev added a commit that referenced this pull request Oct 10, 2025
stack-info: PR: #201, branch: IvanKobzarev/stack/9
IvanKobzarev added a commit that referenced this pull request Oct 10, 2025
stack-info: PR: #201, branch: IvanKobzarev/stack/9
@IvanKobzarev IvanKobzarev force-pushed the IvanKobzarev/stack/9 branch 2 times, most recently from 7eb06ad to 0571cef Compare October 10, 2025 16:31
IvanKobzarev added a commit that referenced this pull request Oct 10, 2025
stack-info: PR: #201, branch: IvanKobzarev/stack/9
IvanKobzarev added a commit that referenced this pull request Oct 10, 2025
stack-info: PR: #201, branch: IvanKobzarev/stack/9
@IvanKobzarev IvanKobzarev requested a review from fmassa October 13, 2025 16:16
Comment on lines +26 to +63
if len(n.users) != 1:
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that the partitioner has been changed to that we don't recompute the all-gather collectives in the backward pass.

@sanketpurandare you'll need to keep this in mind for your PR

IvanKobzarev added a commit that referenced this pull request Oct 23, 2025
…dp graph

stack-info: PR: #201, branch: IvanKobzarev/stack/9
@IvanKobzarev IvanKobzarev changed the title Pass to split prefetch fsdp graph Pass to split all_gather prologue and reduce_scatter prologue from fsdp graph Oct 23, 2025
…dp graph

stack-info: PR: #201, branch: IvanKobzarev/stack/9
g_ins = g.find_nodes(op="placeholder")
prefetch_g_outs_map = []

for g_in in g_ins:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing I found a bit confusing when running this locally is that we are currently moving "views of inputs" into the prefetch subgraph. In my local example:

full backward graph: P2013183321
prefetch subgraph: P2013183365
remaining subgraph: P2013183449

you can see that tangents_1 is not an input in the "remaining subgraph", which is surprising because we should not be performing any FSDP collectives directly on tangents_1. And it looks like this is because there is a view(tangents_1) in the main backward, that we end up moving into the prefetch subgraph (technically harmless but confusing).

xmfan pushed a commit that referenced this pull request Oct 29, 2025
…dp graph

stack-info: PR: #201, branch: IvanKobzarev/stack/9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants