Skip to content

docs: add sustainability benchmarking tutorial - #711

Merged
sdiazlor merged 4 commits into
PrunaAI:mainfrom
zinichakraborty:docs/sustainability-benchmarking-tutorial
Jul 29, 2026
Merged

docs: add sustainability benchmarking tutorial#711
sdiazlor merged 4 commits into
PrunaAI:mainfrom
zinichakraborty:docs/sustainability-benchmarking-tutorial

Conversation

@zinichakraborty

Copy link
Copy Markdown
Contributor

Description

Adds a tutorial notebook demonstrating sustainability benchmarking with the EvaluationAgent: a stable-diffusion-v1-5 baseline is compared against deepcache and torch_compile on total_time, energy_consumed, co2_emissions, and clip_score, using a 10-sample subset of LAION256 on a T4. Includes side-by-side comparison figures and a takeaway on interpreting efficiency gains vs. quality cost (with a pointer to the CMMD tutorial for stricter quality evaluation). Also registers the notebook in docs/tutorials/index.rst.

Related Issue

Fixes #602

Type of Change

  • Documentation update

Testing

  • I added or updated tests covering my changes
  • Existing tests pass locally (uv run pytest -m "cpu and not slow")

No library code is changed, so no unit tests were added. The notebook was executed end-to-end on a Colab T4 (pruna 0.3.4) with all cells completing; outputs are stripped per the convention in the existing tutorials. Comparison figures from the run are attached below for review. ruff check passes on the notebook with the repo config.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code, especially for agent-assisted changes
  • I updated the documentation where necessary

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@zinichakraborty zinichakraborty changed the title Docs/sustainability benchmarking tutorial docs: add sustainability benchmarking tutorial Jul 8, 2026
@begumcig
begumcig self-requested a review July 8, 2026 09:59
@sdiazlor
sdiazlor self-requested a review July 8, 2026 15:38
@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to align the structure and getting started section with this tutorial (https://docs.pruna.ai/en/stable/docs_pruna/tutorials/reasoning_llm.html)? I mean, using the table and referencing the installation page if needed.


Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. Load the model

Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you add a short sentence about this stable-difussion model and why it's used?


Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you add a sentence about deepcache and how would affect sustainability?


Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to show the output?


Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here to explain torch_compile


Reply via ReviewNB

@@ -0,0 +1,433 @@
{

@sdiazlor sdiazlor Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here. Would it be possible to show the output?


Reply via ReviewNB

@sdiazlor sdiazlor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, a really nice tutorial. Just some comments to improve the readability :)

@zinichakraborty
zinichakraborty force-pushed the docs/sustainability-benchmarking-tutorial branch from 590e2bc to 77cf274 Compare July 16, 2026 03:06
@zinichakraborty

Copy link
Copy Markdown
Contributor Author

Made the edits mentioned and added back in the figure outputs. Let me know if there are any other changes I can make!

@begumcig begumcig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is truly amazing work thank you so much @zinichakraborty! I absolutely have no notes, and I think it's super ready to merge.

I noticed that you used 3 for your warm up iterations, have you ever experimented with other numbers? Sometimes with torch.compile, you may need to run the model a bit more to see the full benefits. I think 3 is probably good enough already, and this doesn't affect the clarity of the tutorial at all, but saying incase you will be using these numbers in your work :)

Thank you so much again for the tutorial!! 👑👑👑

@zinichakraborty

Copy link
Copy Markdown
Contributor Author

Thank you I will try this! I set the number low for efficiency, but this is good to know.

@sdiazlor

Copy link
Copy Markdown
Collaborator

@zinichakraborty Thank you so much for the contribution, I'll merge now :)

If you have any feedback using pruna (features, docs, usability, etc.), feel free to share here or on our Discord :)

@sdiazlor
sdiazlor merged commit d9cc437 into PrunaAI:main Jul 29, 2026
6 checks passed
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.

[DOC] Add a tutorial on benchmarking sustainability

3 participants