fix: preserve custom algorithm order across reload - #749
Open
DevChiniwala wants to merge 1 commit into
Open
DevChiniwala wants to merge 1 commit into
DevChiniwala wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve explicit algorithm ordering across SmashConfig save/load and reload-time resmashing.
Root cause
SmashConfig._algorithm_orderwas an in-memory-only preference. It was not serialized, andresmash()passed the original full order even after disabling algorithms that should not be reapplied. Duplicate names were also accepted by the set-based validation.Fix
algorithm_order.resmash().Validation
pytest --basetemp check-tmp-pr-final tests/config/test_smash_config_serialization.py tests/engine/test_save.py::test_save_pruna_model_path_types -q— 5 passed.algorithm_orderwas loaded successfully and cleared stale ordering.ruff check src/pruna/config/smash_config.py src/pruna/engine/load.py tests/config/test_smash_config_serialization.py— passed.ty check src/pruna/config/smash_config.py src/pruna/engine/load.py— passed.GPU validation was not required; this change protects configuration and reload state.
AI assistance disclosure
This contribution was developed with AI assistance. The implementation, tests, and validation were reviewed against the repository code and executed locally.