-
Notifications
You must be signed in to change notification settings - Fork 631
perf(pipeline): implement auto-partition algorithm #2113
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
base: main
Are you sure you want to change the base?
Conversation
1. Improve pipeline performance 2. Auto partition modules
|
Hi @TXacs! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
tianyu-l
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Is it true that the only "real" deltas are
- autopipe.cpp
- pipeline_parallel.py
- profiler.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks interesting -- how much benefit you'd get from having a c++ implementation, compared with a python one?
Yes,actually, |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
|
||
| parts = pipeline( | ||
| mflops_list, | ||
| [i * 3 for i in mflops_list], # Assume backward is 3x forward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it assumed to be 3x?
| # Profile each layer's FLOPS | ||
| mflops_list = [] | ||
| for _, layer in enumerate(model): | ||
| prof = FlopsProfiler(layer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the FlopsProfiler does not estimate the backward flops?
Auto-Partition in torchtitan
Overview
This PR provides an automatic partitioning method that considers the computation cost of embedding layers.
Thsi method involves calculating the floating-point operations (FLOPs) of the embedding layers and constructing an array that incorporates the FLOPs of both the transformer and embedding layers. Subsequently, a heuristic algorithm is employed to identify a balanced pipeline partition.
Solution Architecture
Performance
Hardware configuration: 4x RTX 3090 24GB, pipeline parallelism dimension is 4.
llama3 配置对比
deepseekv3(without moe) 配置对比