Repository navigation
[spmd_types] switch full_dtensor to LP autograd fn - #3671
Merged
Merged
Conversation
[ghstack-poisoned]
This was referenced Jun 14, 2026
pianpwk
commented
Jun 15, 2026
| Tests loss-parallel cross-entropy loss bitwise parity, with torch.distributed.tensor.parallel.loss_parallel(). | ||
| Tests even/uneven vocab sharding, TP, DP+TP, and IGNORE_INDEX labels. | ||
|
|
||
| Runs _LossParallelCrossEntropy under typing checking: logits S(1)@TP, labels I@TP -> I@TP. |
Contributor
Author
There was a problem hiding this comment.
original test was using 2d logits, switch to [B, L, D] as loss.py is hardcoded for 3d logits
pianpwk
marked this pull request as ready for review
June 15, 2026 16:27
pianpwk
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
June 15, 2026 16:27
[ghstack-poisoned]
tianyu-l
approved these changes
Jun 15, 2026
tianyu-l
left a comment
Contributor
There was a problem hiding this comment.
Is this bitwise E2E with dtensor loss_parallel?
Contributor
Author
I was dumb, that only did it for non-chunked loss path. Now does it for chunked loss too, verified w/ llama3 & qwen3 x (TP, FSDP+TP, CP+TP), SP on/off, loss & grad norm 20 step |
[ghstack-poisoned]
submartingales
pushed a commit
to botcanlearn/torchtitan-upstream
that referenced
this pull request
Jun 16, 2026
ghstack-source-id: a0ccccd Pull Request resolved: pytorch/torchtitan#3671
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.
Moves full_dtensor backend off pytorch's loss_parallel -> our custom autograd fn
Stack from ghstack (oldest at bottom):