Skip to content

docs: add diffusers tutorial draft#151

Closed
nifleisch wants to merge 2 commits intomainfrom
docs/add-diffusers-tutorial
Closed

docs: add diffusers tutorial draft#151
nifleisch wants to merge 2 commits intomainfrom
docs/add-diffusers-tutorial

Conversation

@nifleisch
Copy link
Copy Markdown
Collaborator

Description

I added a tutorial that shows the performance of our optimization engine for diffusers pipes. Right now, I only have FLUX as an example, but I already prepared similar plots for SDXL and SD. If you like it, we could use it as the tutorial for the Hugging Face Diffusers documentation.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@davidberenstein1957
Copy link
Copy Markdown
Member

@nifleisch, looks fantastic and super useful to get a general understanding of optimising diffuser models. Are these intended to be examples or educational tutorials? As discussed last week, I think it would be better to have some dedicated tutorials like #126, so I would propose merging the efforts or creating a section "Advanced Tutorials" but happy to hear your thoughts :)

@nifleisch
Copy link
Copy Markdown
Collaborator Author

@nifleisch, looks fantastic and super useful to get a general understanding of optimising diffuser models. Are these intended to be examples or educational tutorials? As discussed last week, I think it would be better to have some dedicated tutorials like #126, so I would propose merging the efforts or creating a section "Advanced Tutorials" but happy to hear your thoughts :)

I completely agree—this doesn’t really belong in our educational tutorials. I created this notebook because I believe the algorithms available in Pruna yield really impressive results that we haven’t yet communicated. I made most of the plots in preparation for my talk at our Efficiency Meetup so I thought they would also make a nice tutorial. Perhaps we should publish it as a blog post instead of adding it to our documentation tutorials. Alternatively, we could include it as the Pruna-specific tutorial in the Diffusers optimization docs. Most of their acceleration guides mainly report benchmark results (e.g. https://huggingface.co/docs/diffusers/en/optimization/para_attn), so this tutorial would fit in there nicely.

Copy link
Copy Markdown
Member

@sharpenb sharpenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice tutorial! Some comments:

  • Add legend for grey lines for compiler and quantizer plots
  • Add more methods on diffusers_combination plot
  • As part of external docs, the title "Pruna" is good but we should probably cahnge it when putting it in our docs.
  • The subtitles "Flux.1 [dev]" are a bit redundant. Let's switch the first subitle for sthg like "Compress Flux.1 [dev]" and remove the others.
  • E.g. in "You can choose between 3 cachers", we should make clear that this is for the open-source pruna.
  • In each algo family, it would be nice to explicitly show the share structure i.e. "Intuition:", "Code:", "Evaluation:"
  • Some closing words with maybe relevant links could be nice at the end of the tutorial.

@davidberenstein1957
Copy link
Copy Markdown
Member

@nifleisch this would also fit nicely here https://github.com/huggingface/cookbook

@nifleisch nifleisch closed this Jun 18, 2025
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

Successfully merging this pull request may close these issues.

3 participants