AnalysisQuant provides to analysis the sensitivity of each op in the model.
AnalysisQuant provides to analysis the sensitivity of each op in the model.
...
@@ -68,13 +62,8 @@ class AnalysisQuant(object):
...
@@ -68,13 +62,8 @@ class AnalysisQuant(object):
return a batch every time
return a batch every time
save_dir(str, optional): the output dir that stores the analyzed information
save_dir(str, optional): the output dir that stores the analyzed information
checkpoint_name(str, optional): the name of checkpoint file that saves analyzed information and avoids break off while ananlyzing
checkpoint_name(str, optional): the name of checkpoint file that saves analyzed information and avoids break off while ananlyzing
num_histogram_plots: the number histogram plots you want to visilize, the plots will show in four PDF files for both best and worst and for both weight and act ops in the save_dir
ptq_config(dict, optional): the args that can initialize PostTrainingQuantization
quantizable_op_type(list): op types that can be quantized
weight_quantize_type(str): quantization type for weights, support 'abs_max' and 'channel_wise_abs_max'
activation_quantize_type(str): quantization type for activation, now support 'range_abs_max', 'moving_average_abs_max' and 'abs_max'
is_full_quantize(bool): if True, apply quantization to all supported quantizable op type. If False, only apply quantization to the input quantizable_op_type. Default is False.
batch_size(int, optional): the batch size of DataLoader, default is 10
batch_nums(int, optional): the number of calibrate data is 'batch_size*batch_nums'