dmx.compressor.layer_reconstruction.LayerReconstructionMixin

class dmx.compressor.layer_reconstruction.LayerReconstructionMixin(*args, **kwargs)

This mixin equips DmxModule with layer-reconstruction functionalities. Layer-reconstruction is any post-training process by which certain module parameters are fitted to optimize a local objective, usually by passing data (input activations) through the module. Examples are traditional static activation calibration, static SmoothQuant calibration, Optimal Brain Compression, etc.

__init__(*args, **kwargs) None

Methods

__init__(*args, **kwargs)

calibrating_quantizers(hyperparams)

calibrating_smoothquant(hyperparams)

enable_approximation_function_tuning(state, ...)

enable_optimal_brain_compression(state, ...)

enable_quantizer_calib(state, hyperparams)

enable_smoothquant_calib(state, hyperparams)

optimal_brain_compressing(hyperparams)

slanc_tuning(hyperparams)

tuning_approximation_function(hyperparams)

update_smoothquant_scale(input)