-
Notifications
You must be signed in to change notification settings - Fork 6k
[benchmarks] overhaul benchmarks #11565
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
logger = logging.get_logger(__name__) | ||
|
||
|
||
def benchmark_fn(f, *args, **kwargs): |
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 automatically warms up the model. No need to do it explicitly.
|
||
|
||
if __name__ == "__main__": | ||
scenarios = [ |
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.
Covered the following scenarios:
- Regular BF16 with compilation
- NF4
- Layerwise upcasting
- Group offloading
Added SDXL, Wan (14B), and LTX (13B) on top of Flux: Results
|
Cc: @a-r-r-o-w if you want to add some caching benchmarks (in a later PR), I think that would be really great! |
@DN6 this is ready for a review. This is how the final CSV for this stage looks like: I have confirmed in this run that it works as expected: |
Sounds good, I'll take it up in near future once this PR is in |
What does this PR do?
This PR considerably simplifies how we do benchmarks. Instead of using entire pipeline-level benchmarks across different tasks, we will now ONLY benchmark the diffusion network that is the most compute-intensive part in a standard diffusion workflow.
To make the estimates more realistic, we will make use of pre-trained checkpoints and dummy inputs with reasonable dimensionalities.
I ran
benchmarking_flux.py
on an 80GB A100 on a batch size of 1 and got the following results:By default, all benchmarks will use a batch size of 1, eliminating CFG.
How to add your benchmark?
Adding benchmarks for a new model class (
SanaTransformer2DModel
, for example) boils down to the following:This is what
benchmarking_flux.py
does. More modularization can be shipped afterward.Idea would be to merge this PR with pre-configured benchmarks for a few popular models and open others to the community.
TODOs
Utilities:
@DN6 could you give the approach a quick look? I can then work on resolving the TODOs.