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

Pipeline Parallelism in Stacked #1

Open
dlwh opened this issue Jun 6, 2023 · 1 comment
Open

Pipeline Parallelism in Stacked #1

dlwh opened this issue Jun 6, 2023 · 1 comment

Comments

@dlwh
Copy link
Member

dlwh commented Jun 6, 2023

I think it's not too bad to implement pipeline parallelism directly in Stacked. The basic idea is that we map the Layers axis of a Stacked to a (new) physical axis (called stage here and in the link), then we reshape our batch into microbatches and push through the pipeline.

Example implementation https://github.com/tensorflow/lingvo/blob/master/lingvo/jax/layers/pipeline.py (which looks a lot like accumulate_gradients_sharded)

The biggest thing that's not clear to me is partitioning of the (macro) batch itself. Easiest thing to do is replicate it across the stage axis, but i think that's not ideal. should take a look at an impl of pipeline parallelism

@dlwh
Copy link
Member Author

dlwh commented Jun 19, 2023

https://github.com/google/praxis/blob/main/praxis/layers/pipeline.py

(Googlers are telling me PP is a waste of time on TPU until you cross node boundary)

@dlwh dlwh transferred this issue from stanford-crfm/levanter Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant