From f730eb74532a48b4c310345e4b1466fd5948cfa9 Mon Sep 17 00:00:00 2001 From: Gaspar Rochette Date: Sat, 20 Jun 2026 11:09:45 +0000 Subject: [PATCH 1/3] fix: switch torch_dynamic save function from pickle to reapply --- src/pruna/algorithms/torch_dynamic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pruna/algorithms/torch_dynamic.py b/src/pruna/algorithms/torch_dynamic.py index 77c8f625..4ad64651 100644 --- a/src/pruna/algorithms/torch_dynamic.py +++ b/src/pruna/algorithms/torch_dynamic.py @@ -37,7 +37,7 @@ class TorchDynamic(PrunaAlgorithmBase): algorithm_name = "torch_dynamic" group_tags: list[tags] = [tags.QUANTIZER] references: dict[str, str] = {"GitHub": "https://github.com/pytorch/pytorch"} - save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.pickled + save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.reapply tokenizer_required: bool = False processor_required: bool = False runs_on: list[str] = ["cpu", "cuda"] From d4d802c50907139d0cb2165b5e768cfe695f148e Mon Sep 17 00:00:00 2001 From: Gaspar Rochette Date: Sat, 20 Jun 2026 11:10:08 +0000 Subject: [PATCH 2/3] test: add smollm-135 test for torch dynamic to prove fix is effective --- tests/algorithms/testers/torch_dynamic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/algorithms/testers/torch_dynamic.py b/tests/algorithms/testers/torch_dynamic.py index f1b1614a..a0c9c4da 100644 --- a/tests/algorithms/testers/torch_dynamic.py +++ b/tests/algorithms/testers/torch_dynamic.py @@ -6,7 +6,7 @@ class TestTorchDynamic(AlgorithmTesterBase): """Test the torch dynamic quantizer.""" - models = ["shufflenet"] + models = ["shufflenet", "smollm_135m"] reject_models = [] allow_pickle_files = False algorithm_class = TorchDynamic From 22d1ce1146f840380a72470565e75eca445f864d Mon Sep 17 00:00:00 2001 From: Gaspar Rochette Date: Sat, 20 Jun 2026 13:50:25 +0000 Subject: [PATCH 3/3] fix: change quanto and torch_dynamic to save_before_apply --- src/pruna/algorithms/quanto.py | 2 +- src/pruna/algorithms/torch_dynamic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pruna/algorithms/quanto.py b/src/pruna/algorithms/quanto.py index a5b31c56..1b90031f 100644 --- a/src/pruna/algorithms/quanto.py +++ b/src/pruna/algorithms/quanto.py @@ -44,7 +44,7 @@ class Quanto(PrunaAlgorithmBase): algorithm_name: str = "quanto" group_tags: list[tags] = [tags.QUANTIZER] references: dict[str, str] = {"GitHub": "https://github.com/huggingface/optimum-quanto"} - save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.reapply + save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.save_before_apply tokenizer_required: bool = False processor_required: bool = False dataset_required: bool = False diff --git a/src/pruna/algorithms/torch_dynamic.py b/src/pruna/algorithms/torch_dynamic.py index 4ad64651..d09923c4 100644 --- a/src/pruna/algorithms/torch_dynamic.py +++ b/src/pruna/algorithms/torch_dynamic.py @@ -37,7 +37,7 @@ class TorchDynamic(PrunaAlgorithmBase): algorithm_name = "torch_dynamic" group_tags: list[tags] = [tags.QUANTIZER] references: dict[str, str] = {"GitHub": "https://github.com/pytorch/pytorch"} - save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.reapply + save_fn: SAVE_FUNCTIONS = SAVE_FUNCTIONS.save_before_apply tokenizer_required: bool = False processor_required: bool = False runs_on: list[str] = ["cpu", "cuda"]