Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subclass torch.distributed.pipelining.PipelineStage for PFO #131

Open
jaywonchung opened this issue Oct 13, 2024 · 0 comments
Open

Subclass torch.distributed.pipelining.PipelineStage for PFO #131

jaywonchung opened this issue Oct 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jaywonchung
Copy link
Member

jaywonchung commented Oct 13, 2024

PyTorch 2.4 has a new API for pipeline parallelism, which includes PipelineStage. With this, we can subclass PipelineStage and override forward_one_chunk and backward_one_chunk, where each will first set the GPU's frequency using the async frequency controller and run actual forward/backward.
In case users already have an instance of PipelineStage (manual splitting) or _PipelineStage (automatic splitting with pipeline), we can provide a static method on our PipelineStage subclass that melts the user's pipeline stage into ours.

POC can be done on TorchTitan's train.py without having to modify TorchTitan.

@jaywonchung jaywonchung added the enhancement New feature or request label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant