Repository navigation
fix(compile): capture replayable context parallel collectives - #11
Open
yu-chen-code wants to merge 1 commit into
Open
yu-chen-code wants to merge 1 commit into
yu-chen-code wants to merge 1 commit into
Conversation
yu-chen-code
force-pushed
the
feat-graph-cp-collectives
branch
from
November 9, 2026 11:24
a922f76 to
a063dd2
Compare
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.
What type of PR is this?
/kind feature
What does this PR do / why do we need it:
Refreshed on 2026-11-09 against fork/upstream master
a6be99d3. PR1421 is now merged upstream, so its duplicate prerequisite has been removed. Current head:a063dd2ab0907f86f8cc5d418d547323ae438390; retained feature/dependency commits:a063dd2a. Git range-diff confirms unchanged feature patches. Focused CPU regression on this exact head: 108 JUnit records, 0 failures, 0 errors. The isolated refresh environments now include master-required PEFT 0.21.2 and accelerate 1.13.0; pip check passes. All numerical runs and older source hashes below are pre-refresh evidence. NPU precision training and formal upstream CI were not rerun for this rebase.Make asynchronous CP AllGather and Ulysses sequence-to-head exchanges safe to capture and replay in a joint training graph. The existing eager implementation starts a c10d Work object and waits on it in Python. During capture, that Python wait is not a replayable dependency: the baseline captured successfully but produced an incorrect first-step loss when replayed.
During tracing/compilation, use PyTorch native functional
all_gather_single/all_to_all_single, retain their output tensor in the collective handle, and materialize it withwait_tensorbefore restoring the original layout. Autograd follows the native collective's backward. The existing eager Work path and its tensor math stay unchanged.Allow CP together with graph EP now that these CP exchanges carry explicit graph dependencies. Keep the PP and legacy EP-overlap restrictions. Add focused layout, gradient, wait-lifecycle, and topology tests; update the old CP-rejection expectation.
This change validates the two collective helpers and their composition with FSDP/EP. It does not claim complete DeepSeek-V4.1 DSA attention, compressed-document CP routing, or every CP attention algorithm is graph-ready.
Validation:
torch.equalfor all recorded gradients, parameters and Adam states across four ranks and ten updates.Exact source manifests, commands, before/after tensor receipts and raw failures are retained under T020 runs/20261106-graph-capability-spikes. No formal upstream gate is requested or claimed.
Which issue(s) this PR fixes:
None.
Code review checklist [illustration]: