feat: enable save/load after recovery without additional steps#619
feat: enable save/load after recovery without additional steps#619psyberck wants to merge 8 commits into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 3 high |
🟢 Metrics 12 complexity · 0 duplication
Metric Results Complexity 12 Duplication 0
TIP This summary will be updated as you push new changes. Give us feedback
|
Hi @psyberck! Thank you for your contribution! I've run the tests. Please take a look before we jump into any review :) |
|
Hey @sdiazlor , can you help kindly re-run the tests? There seems some network failures during the tests: |
|
Sure thing! I ran them again :) |
|
This PR has been inactive for 10 days and is now marked as stale. |
simlang
left a comment
There was a problem hiding this comment.
Thanks for looking at this! I left a view requests :)
|
Hi @psyberck! When you have time, could you take a look at the comments? :) |
|
This PR has been inactive for 10 days and is now marked as stale. |
…: get_save_before_smash_dir
…'s weights for "save_before_apply" algos
8975c49 to
81ca7d0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 81ca7d0. Configure here.
| result = self._apply(model, wrapped_config) | ||
|
|
||
| self.post_apply_hook(model, smash_config) | ||
| return result |
There was a problem hiding this comment.
Hook saves pre-apply model
High Severity
post_apply_hook receives the model from before _apply, but PERP recovery can return a different object (e.g. after finetune unwrap or LoRA base_model). refresh_saved_model then rewrites the save-before-smash cache from that stale reference, so save/load can miss recovered weights.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 81ca7d0. Configure here.


Description
Extend save and load to also allow saving and loading after recovery without additional steps.
Related Issue
Fixes #603
Type of Change
Testing
uv run pytest -m "cpu and not slow")For full setup and testing instructions, see the Contributing Guide.
Checklist
Thanks for contributing to Pruna! We're excited to review your work.
New to contributing? Check out our Contributing Guide for everything you need to get started.
First Prune (1-year OSS anniversary)
First Prune marks one year of Pruna’s open-source work. During the initiative window, qualifying merged contributions count toward First Prune. You can earn credits for our performance models via our API.
If you’d like your contribution to count toward First Prune, here’s how it works: