Repository navigation
Conversation
…o-batches The distributed Linear tests use 2D inputs, so the sequence-parallel all-gathers never see the [seq, micro-batch, hidden] layout. With the NVFP4 recipe, a 2.21.0 pre-release (d77ef88) crashed in the backward all-gather of a row-parallel Linear at micro-batch 1 and 3 (NVIDIA#3720), while these tests passed. NVIDIA#3628 fixed the shape bookkeeping on main and release_v2.21. Add column- and row-parallel cases with 3D inputs and micro-batches of 1 and 3. Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
0z5a
marked this pull request as ready for review
November 1, 2026 21:01
Contributor
[Low impact] The PR appears safe to merge. SummaryAdds sequence-parallel
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "[PyTorch] Test sequence-parallel Linear ..." · Reviewed by Greptile |
This branch has not been deployed
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.
Description
The distributed
Lineartests inrun_numerics.pyonly use 2D inputs, so the sequence-parallel all-gathers never see the[seq, micro-batch, hidden]layout. #3720 shows what that misses. With the NVFP4 recipe, the 2.21.0 pre-released77ef88ccrashed in the backward all-gather of a row-parallelLinearwith sequence parallelism when the micro-batch was 1, and the existing tests passed on it. #3628 later fixed the shape bookkeeping on main and onrelease_v2.21.This PR adds a test for that layout. It is test-only.
Related: #3720, #3628
Type of change
Changes
tests/pytorch/distributed/run_numerics.py:test_linear_3d_inputruns a sequence-parallelte.Linear, column- and row-parallel, on[seq, micro-batch, hidden]inputs with micro-batch 1 and 3. The sequence hasWORLD_SIZE * SEQ_LENtokens, so every rank holdsSEQ_LENof them in the sequence-parallel layout. The test compares the output and the input gradient with a single-GPULinear, using the existing helpers and tolerances. It runs for every recipe thattest_numerics.pyparametrizes.Testing
Two B300 GPUs (sm_103), TE built for
103a, torch 2.14.1+cu130, cuDNN 9.24:test_linear_3d_input, NVFP4d77ef88c(2.21.0 pre-release from #3720)swap_first_dims("Input is not allocated"); row-parallel, micro-batch 3 inCheckScaleTensorShape(columnwise_scale_inv.shape == expected). Both column-parallel cases pass, and so does the existingtest_linear.7457e47d(v2.21.0, includes #3628)63451d6bOn main with this PR,
tests/pytorch/distributed/test_numerics.pypasses for all six parametrizations (None, fp8, mxfp8, fp8_cs, fp8_block_scaling, nvfp4): 6 passed. Black 24.4.2 with the repository's pre-commit options leaves the file unchanged.Checklist: