Skip to content

[graph_trainer] Adapt custom stages to pipeline forward state - #4994

Closed
sanketpurandare wants to merge 2 commits into
gh/sanketpurandare/48/basefrom
gh/sanketpurandare/48/head
Closed

sanketpurandare wants to merge 2 commits into
gh/sanketpurandare/48/basefrom
gh/sanketpurandare/48/head

Conversation

@sanketpurandare

@sanketpurandare sanketpurandare commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Summary:
PyTorch pipeline stages now track forward-send ownership in
_forward_chunk_states and release sent outputs when their waits complete.
Migrate TorchTitan's custom Kimi stage to that lifecycle instead of the removed
fwd_cache field.

GraphPP uses the upstream state for transport ownership while retaining only
its explicit backward-graph values in a separate stage-owned mapping. Its
backward graphs consume those saved values and received gradients, so remove
the redundant forward-output argument. Register WAIT_REDUCE_GRAD as a no-op:
the explicit reduction graph returns dependency-carrying tensors and never
creates the eager FSDP reduction handle that the upstream wait expects.

Test Plan:

  • The GraphPP runner suite passes with 55 tests at this commit boundary.
  • The combined changed-surface suite passes with 314 tests and 1 skip.
  • Four-rank MXFP8 Dist-MoE GraphPP completes four finite steps.
  • All non-Pyrefly repository hooks pass.

Summary:
PyTorch pipeline stages now track forward-send ownership in
`_forward_chunk_states` and release sent outputs when their waits complete.
Migrate TorchTitan's custom Kimi stage to that lifecycle instead of the removed
`fwd_cache` field.

GraphPP uses the upstream state for transport ownership while retaining only
its explicit backward-graph values in a separate stage-owned mapping. Its
backward graphs consume those saved values and received gradients, so remove
the redundant forward-output argument. Register `WAIT_REDUCE_GRAD` as a no-op:
the explicit reduction graph returns dependency-carrying tensors and never
creates the eager FSDP reduction handle that the upstream wait expects.

Test Plan:
- The GraphPP runner suite passes with 55 tests at this commit boundary.
- The combined changed-surface suite passes with 314 tests and 1 skip.
- Four-rank MXFP8 Dist-MoE GraphPP completes four finite steps.
- All non-Pyrefly repository hooks pass.

[ghstack-poisoned]
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 1, 2026
[ghstack-poisoned]
@sanketpurandare

Copy link
Copy Markdown
Contributor Author

Superseded by #4662

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.

1 participant