Skip to content

Enable Llama4 SPMD type integration - #3551

Closed
pianpwk wants to merge 3 commits into
gh/pianpwk/28/basefrom
gh/pianpwk/28/head
Closed

pianpwk wants to merge 3 commits into
gh/pianpwk/28/basefrom
gh/pianpwk/28/head

Conversation

[ghstack-poisoned]
[ghstack-poisoned]
pianpwk added a commit that referenced this pull request Jun 5, 2026
ghstack-source-id: 5ba31e4
Pull Request resolved: #3551
[ghstack-poisoned]
pianpwk added a commit that referenced this pull request Jun 5, 2026
ghstack-source-id: d65dc6f
Pull Request resolved: #3551
pianpwk added a commit that referenced this pull request Jun 5, 2026
ghstack-source-id: d65dc6f
Pull Request resolved: #3551
pianpwk added a commit that referenced this pull request Jun 5, 2026
Adds the spmd_types integration to titan part-by-part, starting from
replacing the `torch.distributed.tensor.parallel.loss_parallel()`
DTensor-based context manager with a manually written
`_LossParallelCrossEntropy` custom autograd function.

Written to support uneven sharding (on last rank), IGNORE_INDEX,
verified bitwise against loss_parallel() in test cases. The PR adds
spmd_types requirement to titan, as it includes typecheck_forward &
testing.

Not yet wired into the training path - the later stack will wire it for
the spmd backend path, but likely leaves DTensor & plain-tensor on the
loss_parallel() path for now.

Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.12.0)
(oldest at bottom):
* #3551
* #3550
* #3278
* #3472
* #3468
* #3471
* #3253
* #3501
* #3466
* __->__ #3467
@tianyu-l tianyu-l closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants