Skip to content

Conversation

@johannaSommer
Copy link
Member

@johannaSommer johannaSommer commented Oct 22, 2025

Description

In this PR we follow up the refactoring from #401 and update all examples with a SmashConfig to the new interface (old one will still be supported though). Additionally, I've added a first version of a Power User guide that describes more advanced features of the package.

Related Issue

None.

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

How Has This Been Tested?

I tested all update code snippets.

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

Additional Notes

None.


Note

Updates docs/tutorials to the new SmashConfig interface and adds a Power User guide; adjusts algorithm customization docs and updates HQQ/pre-smash tests accordingly.

  • Docs:
    • SmashConfig API migration: Examples now pass algorithms as SmashConfig(["algo"]) and hyperparams via SmashConfig({"algo": {...}}); removed group keys/prefixed hyperparams in configure.rst, smash.rst, save_load.rst, evaluate.rst, and tutorials (e.g., docs/tutorials/video_generation.ipynb).
    • Algorithm customization: Switch to PrunaAlgorithmBase, add AlgorithmTag, compatible_before/after, and save_fn; update import paths and testing guidance.
    • New Power User guide: Adds docs/user_manual/power_user.rst covering target_modules, experimental=True, and manual algorithm ordering; removes docs/user_manual/target_modules.rst.
  • Tests:
    • Update HQQ tester to use HQQ, import PrunaModel, fix post-smash hook and hyperparameters.
    • Remove check_algorithm_availability usage/tests; adjust test_pre_smash_routines.py imports accordingly.

Written by Cursor Bugbot for commit a55fb5b. This will update automatically on new commits. Configure here.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@johannaSommer johannaSommer force-pushed the refactor/algorithm-compatibility branch from f2bbf51 to 318f085 Compare October 23, 2025 07:12
Copy link
Member

@davidberenstein1957 davidberenstein1957 left a comment

Choose a reason for hiding this comment

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

LFTM, but some changes and review required. Also, I feel that some of the codeblocks for the notebooks need to be formatted to ensure they fit within one page, so a couple of newlines within the SmashConfig definition, it should be good :)

# Create and configure SmashConfig
smash_config = SmashConfig()
smash_config = SmashConfig(["c_whisper", "whisper_s2t"])
smash_config.add_processor(model_id) # Required for Whisper

Choose a reason for hiding this comment

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

@johannaSommer can't we also simplify this process? i.e. just wrap it underneath the add method, with some type checking to redirect to the correct sub-function i.e. add_processor, add_tokenizer, and add_dataset? Not sure if simple enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes completely agree, we already discussed this in the initial PR review for the actual refactoring. We decided to leave it out of the current PR for now and it's on the roadmap for future refactoring!


## <img src="./docs/assets/images/pruna_cool.png" alt="Pruna Cool" width=20></img> Introduction

Pruna is a model optimization framework built for developers, enabling you to deliver faster, more efficient models with minimal overhead. It provides a comprehensive suite of compression algorithms including [caching](https://docs.pruna.ai/en/stable/compression.html#cachers), [quantization](https://docs.pruna.ai/en/stable/compression.html#quantizers), [pruning](https://docs.pruna.ai/en/stable/compression.html#pruners), [distillation](https://docs.pruna.ai/en/stable/compression.html#distillers) and [compilation](https://docs.pruna.ai/en/stable/compression.html#compilers) techniques to make your models:

Choose a reason for hiding this comment

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

so, we won't have different sections within the compression page anymore? I think it would still be good to redirect to this page, as a way to showcase how many cool algorithms we support.

Choose a reason for hiding this comment

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

Also, if this page does not exist anymore, did we double check if we don't break other redirects?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes you're right, I added this back!

@@ -0,0 +1,160 @@
:title: Power User Guide - Advanced Features in the Pruna package

Choose a reason for hiding this comment

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

I think we still might need to add this page to a toctree somehwere?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, thanks a lot. Will open a PR in the internal repository with this (plus the updated algorithm overview generation)

@johannaSommer johannaSommer force-pushed the refactor/algorithm-compatibility branch from c044269 to bfad161 Compare October 23, 2025 14:37
@johannaSommer johannaSommer force-pushed the refactor/algorithm-compatibility branch from adea603 to fd787f0 Compare November 4, 2025 12:51
Base automatically changed from refactor/algorithm-compatibility to main November 5, 2025 13:28
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