Skip to content

feat: allow loading models without a smash config#340

Merged
sharpenb merged 10 commits intomainfrom
chore/fix-benchmark
Sep 17, 2025
Merged

feat: allow loading models without a smash config#340
sharpenb merged 10 commits intomainfrom
chore/fix-benchmark

Conversation

@sharpenb
Copy link
Copy Markdown
Member

@sharpenb sharpenb commented Sep 9, 2025

Description

This PR enables to load any diffusers and transformers models even if they do not have smash configs. This is useful for benchmarking of all models regardless if they are wrapped or not with Pruna.

Related Issue

Fixes #(issue number)

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?

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

cursor[bot]

This comment was marked as outdated.

@sharpenb sharpenb changed the title Fix generic loading function for benchmarking fix: generic loading function for benchmarking Sep 9, 2025
@sharpenb sharpenb changed the title fix: generic loading function for benchmarking chore: fix generic loading function for benchmarking Sep 9, 2025
@sharpenb sharpenb changed the title chore: fix generic loading function for benchmarking chore: fix generic loading function Sep 9, 2025
@sharpenb sharpenb requested review from SaboniAmine, gsprochette and johannaSommer and removed request for johannaSommer September 9, 2025 14:55
Copy link
Copy Markdown
Member

@SaboniAmine SaboniAmine left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

Looks good, a single iteration should do it :)

  • I would recommend renaming the PR to something in the line of feat: allow loading models without a smash config.
  • If we decide to add a device_map argument in the loading functions, that can be done in an other PR

Comment thread src/pruna/engine/load.py Outdated
Comment thread src/pruna/engine/load.py Outdated
Comment thread src/pruna/engine/load.py
Comment thread src/pruna/engine/load.py
Comment thread src/pruna/engine/load.py Outdated
@sharpenb sharpenb changed the title chore: fix generic loading function chore: fix generic loading function for benchmarking Sep 11, 2025
@sharpenb sharpenb changed the title chore: fix generic loading function for benchmarking feat: allow loading models without a smash config Sep 11, 2025
cursor[bot]

This comment was marked as outdated.

Comment thread src/pruna/engine/load.py Outdated
Comment thread src/pruna/engine/load.py Outdated
cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for doing all the changes :)

cursor[bot]

This comment was marked as outdated.

@sharpenb sharpenb merged commit 18b81b4 into main Sep 17, 2025
7 checks passed
@sharpenb sharpenb deleted the chore/fix-benchmark branch September 17, 2025 15:43
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