Repository navigation
[graph_trainer] Replace stable_topological_sort with _move_overlap_nodes - #3419
Merged
Merged
Conversation
IvanKobzarev
requested review from
SherlockNoMad,
aditvenk,
sanketpurandare,
tianyu-l,
xmfan and
yiming0416
as code owners
May 22, 2026 16:16
Contributor
|
Can you add a diffing link in summary? similar to https://www.internalfb.com/intern/diffing/?paste_number=2324948763 |
SherlockNoMad
approved these changes
Jun 9, 2026
Contributor
|
IvanKobzarev
force-pushed
the
remove-stable-topo-sort
branch
from
June 10, 2026 09:59
504dc71 to
1674029
Compare
IvanKobzarev
force-pushed
the
remove-stable-topo-sort
branch
from
June 10, 2026 10:04
1674029 to
950b0af
Compare
This was referenced Jun 10, 2026
…des in fsdp_passes The joint manual overlap scheduler used `_stable_topological_sort` after bucketing and reordering. The empty-dependency call after bucketing was redundant, and the reordering call displaced most graph nodes even though only AG/RS chains needed movement. Use upstream `_move_overlap_nodes` for the overlap dependencies so only bucketed collective chains move, keeping the pass composable with downstream graph passes. This depends on PyTorch PR #184711. Test Plan: ```bash SKIP=pyrefly-check,lychee-link-checker python -m pre_commit run --show-diff-on-failure --files torchtitan/experiments/graph_trainer/fsdp_passes.py ``` Not run: full `pyrefly-check` pre-commit hook, because it is configured with `pass_filenames: false` and `--remove-unused-ignores`; running it cleanly requires removing an unused suppression in `torchtitan/distributed/spmd_types.py`, which would expand this diff outside graph_trainer. Not run: graph_trainer debug-model TP=1/TP=8 smoke runs. Local `torch` import currently fails before launch with `undefined symbol: cudaGetDriverEntryPointByVersion, version libcudart.so.12` from the current CUDA runtime/library mismatch. Authored with Claude.
IvanKobzarev
force-pushed
the
remove-stable-topo-sort
branch
from
June 11, 2026 09:45
950b0af to
6b6059d
Compare
IvanKobzarev
pushed a commit
to IvanKobzarev/torchtitan
that referenced
this pull request
Jun 17, 2026
…ch#3248) Squashed from ghstack PR pytorch#3248. Turns on traceable ChunkedCELoss config for deepseek_v3 and qwen3 to match eager ChunkedLoss memory. Requires pytorch#3419 (+ pytorch nightly w/ pytorch#184711) for bitwise loss parity. Original: pytorch#3248 ghstack-source-id: 64b6e2c Pull-Request: pytorch#3614
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.
Replace the two
_stable_topological_sortcalls inJointManualOverlapSchedulerwith_move_overlap_nodesfrom upstream pytorch. This surgically moves only the AG/RS chains instead of re-sorting the entire graph, reducing node displacement from ~97% to ~5% and making the pass composable with downstream graph passes._manual_bucket_collectives: remove the no-op_stable_topological_sort(graph, {})call after bucketing — the graph is already valid aftermanual_bucket_collectives._manual_reorder_graph: replace_stable_topological_sort(graph, overlap_deps)with_move_overlap_nodes(graph, overlap_deps, bucketed_node_types).Depends on pytorch PR #184711.
!!! Land only pytorch PR is in nightly
Authored by Claude.
Before vs. After for dsv3_16b
https://www.internalfb.com/intern/diffing/?before_paste_number=2371069081&after_paste_number=2371069207®ex_remove_pattern=&enable_regex_remove=0&strip_empty_lines=0&line_wrap=0&selected_tab=plain_diff