mqbench.utils package
Submodules
mqbench.utils.logger
mqbench.utils.registry
mqbench.utils.state
- mqbench.utils.state.enable_all(model)[source]
Enable calibration and quantization for every iter, means min / max can be updated while training. Use for QAT but can not set range.
- mqbench.utils.state.enable_quantization(model, weight_cali_on=False, act_cali_on=False)[source]
We enable all quantization for quantization aware training. But we sometimes remain weight calibration on for update minmax all along. For some hardware, there is no weight quant param to be set, which mean it will calculate min / max for weight. Assume weight scale * 127 > abs(weight).max() after some training. Training scale and deploy scale can be various, so we have to update range every iter.
mqbench.utils.utils
- mqbench.utils.utils.deepcopy_graphmodule(gm: GraphModule)[source]
Rewrite the deepcopy of GraphModule. (Copy its ‘graph’.)
- Parameters:
gm (GraphModule) –
- Returns:
A deepcopied gm.
- Return type:
GraphModule