neural_compressor.compression.pruner.pruners.retrain_free
Retrain free pruner.
Classes
Pruning Pruner. |
Module Contents
- class neural_compressor.compression.pruner.pruners.retrain_free.PytorchRetrainFreePruner(config, modules)[source]
Pruning Pruner. The retrain_free pruner_class is derived from BasePruner. This pruner references the mask search and mask rearrangement strategies in fast retraining free. RetrainFreePruner supports one-shot pruning (same effect as fast retraining free) and iterative pruning. Please refer to A Fast Post-Training Pruning Framework for Transformers
Defines pruning functions called at step begin/end, before/after optimize and epoch begin/end.
Defines the pruning criterion and fixed weight parameters.
Obtain block masks and its grads.
Rearrange block masks.
- Parameters:
modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.
config – A config dict object that contains the pruner information.