Repository navigation
Add support for loss parallel - #1546
Merged
Merged
Conversation
IMO we should just add the loss in the model and let autoparallel parallelize it for us
…ssa/enable_loss_parallel
wconstab
approved these changes
Aug 9, 2025
| # in our case, but we can work around it by adding | ||
| # casting the output to a DTensor on a 1d device mesh. | ||
| # We should just use AutoParallel to do this for us, but | ||
| # it would require putting the loss inside the model as well |
Contributor
There was a problem hiding this comment.
I agree that overall we should just put the loss in the model, but I like the approach here for now because it's useful to be as structurally similar to torchtitan as possible for drop-in purposes
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.
IMO we should just add the loss in the model and let autoparallel parallelize it for us. But for now, let's follow how the other models are implemented