fix(distributed): synchronize tensor-parallel replicas - #3822
Open
yuhezhang-ai wants to merge 1 commit into
Open
fix(distributed): synchronize tensor-parallel replicas#3822yuhezhang-ai wants to merge 1 commit into
yuhezhang-ai wants to merge 1 commit into
Conversation
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
yuhezhang-ai
marked this pull request as ready for review
September 5, 2026 17:51
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 does this PR do?
Synchronize parameters that remain replicated across tensor-parallel ranks, both after model construction/loading and once per optimizer update.
Changelog
Before your PR is "Ready for review"
Pre checks:
Test evidence
ruff format .(804 files unchanged)ruff check --fix .pytest tests/unit_tests/distributed/test_tp_replicas.py tests/unit_tests/training/test_train_utils.py tests/unit_tests/distributed/test_qwen3_5_tp_and_grad_sync.py -q(48 passed, 3 skipped)pytest tests/unit_tests/_transformers/test_infrastructure.py tests/unit_tests/distributed/test_parallelizer.py -q(200 passed)pytest tests/unit_tests/moe/test_parallelizer.py -q(91 passed)1.8148e-3, within the4.1175e-3tolerance, and decreased on later steps.Performance
In these short four-step 8-GPU probes, PEFT averaged 27.70 s/step versus 27.57 s/step before the fix (+0.5%), while full SFT averaged 35.00 s/step versus 34.27 s/step (+2.1%). The fix coalesces replicated gradients into bounded buffers, but full SFT necessarily communicates the parameters that the current TP plan leaves replicated.
Additional Information