Repository navigation
[refactor] combine spmd parallelize into pp parallelize, with some other changes - #980
Merged
Merged
Conversation
tianyu-l
force-pushed
the
pp_refactor
branch
2 times, most recently
from
March 19, 2025 03:10
d8409c8 to
9f72ed6
Compare
…experimental configs
fegin
approved these changes
Mar 19, 2025
MaxiBoether
pushed a commit
to eth-easl/torchtitan-mixtera
that referenced
this pull request
Apr 17, 2025
…her changes (pytorch#980) This PR does the following refactoring: 1. combine spmd paralllize into pp parallelize -- now with a TrainSpec `pipelining_fn` is expected to call `parallelize_fn` inside. This is to allow for whole-model compile (which will come soon with a SimpleFSDP experiment). Also marking `pipelining_fn` as optional. 2. update `TrainSpec` to use `build_tokenizer_fn ` instead of `tokenizer_cls`, to facilitate use case like [this](https://github.com/pytorch/torchtitan/pull/919/files#diff-f21036d57ee66cb8307ca425bdb94c54ce0e0fa7d7ca175e2f770b47ef1782ecR109-R111). 3. call `import torchtitan.experiments` in `torchtitan/__init__.py`, so that experiments can register `TrainSpec` and reuse `torchtitan/train.py`. This is the only place where torchtitan core would depend on experiments -- for now requiring experiments to be importable makes sense; we can revisit this assumption later. 4. move LR scheduler code from `optimizer.py` into dedicated `lr_scheduler.py` given the complexity of both. 5. create a new config section called `parallelism` to host all parallelism-related configs, and graduate `experimental` configs to `parallelism` as they have been introduced for a while.
xrsrke
pushed a commit
to NousResearch/torchtitan
that referenced
this pull request
Feb 13, 2026
…her changes (pytorch#980) This PR does the following refactoring: 1. combine spmd paralllize into pp parallelize -- now with a TrainSpec `pipelining_fn` is expected to call `parallelize_fn` inside. This is to allow for whole-model compile (which will come soon with a SimpleFSDP experiment). Also marking `pipelining_fn` as optional. 2. update `TrainSpec` to use `build_tokenizer_fn ` instead of `tokenizer_cls`, to facilitate use case like [this](https://github.com/pytorch/torchtitan/pull/919/files#diff-f21036d57ee66cb8307ca425bdb94c54ce0e0fa7d7ca175e2f770b47ef1782ecR109-R111). 3. call `import torchtitan.experiments` in `torchtitan/__init__.py`, so that experiments can register `TrainSpec` and reuse `torchtitan/train.py`. This is the only place where torchtitan core would depend on experiments -- for now requiring experiments to be importable makes sense; we can revisit this assumption later. 4. move LR scheduler code from `optimizer.py` into dedicated `lr_scheduler.py` given the complexity of both. 5. create a new config section called `parallelism` to host all parallelism-related configs, and graduate `experimental` configs to `parallelism` as they have been introduced for a while.
xrsrke
pushed a commit
to NousResearch/torchtitan
that referenced
this pull request
Feb 25, 2026
…her changes (pytorch#980) This PR does the following refactoring: 1. combine spmd paralllize into pp parallelize -- now with a TrainSpec `pipelining_fn` is expected to call `parallelize_fn` inside. This is to allow for whole-model compile (which will come soon with a SimpleFSDP experiment). Also marking `pipelining_fn` as optional. 2. update `TrainSpec` to use `build_tokenizer_fn ` instead of `tokenizer_cls`, to facilitate use case like [this](https://github.com/pytorch/torchtitan/pull/919/files#diff-f21036d57ee66cb8307ca425bdb94c54ce0e0fa7d7ca175e2f770b47ef1782ecR109-R111). 3. call `import torchtitan.experiments` in `torchtitan/__init__.py`, so that experiments can register `TrainSpec` and reuse `torchtitan/train.py`. This is the only place where torchtitan core would depend on experiments -- for now requiring experiments to be importable makes sense; we can revisit this assumption later. 4. move LR scheduler code from `optimizer.py` into dedicated `lr_scheduler.py` given the complexity of both. 5. create a new config section called `parallelism` to host all parallelism-related configs, and graduate `experimental` configs to `parallelism` as they have been introduced for a while.
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.
This PR does the following refactoring:
pipelining_fnis expected to callparallelize_fninside. This is to allow for whole-model compile (which will come soon with a SimpleFSDP experiment). Also markingpipelining_fnas optional.TrainSpecto usebuild_tokenizer_fninstead oftokenizer_cls, to facilitate use case like this.import torchtitan.experimentsintorchtitan/__init__.py, so that experiments can registerTrainSpecand reusetorchtitan/train.py. This is the only place where torchtitan core would depend on experiments -- for now requiring experiments to be importable makes sense; we can revisit this assumption later.optimizer.pyinto dedicatedlr_scheduler.pygiven the complexity of both.parallelismto host all parallelism-related configs, and graduateexperimentalconfigs toparallelismas they have been introduced for a while.