aimet_onnx.apply_adaround¶
Note
It is recommended to use onnx-simplifier before adarounding the model.
Top-level API
- aimet_onnx.apply_adaround(sim, inputs, num_iterations=10000, nodes_to_include=None, *, node_names_to_optimize=None)
Optimizes the rounding direction of weights in the QuantizationSimModel to reduce quantization error.
After applying AdaRound to a QuantizationSimModel object, the quantization encodings will be frozen for optimized weights and the sim model will contain updated weight tensors.
- Parameters:
sim (
QuantizationSimModel) – QuantizationSimModel instance to optimizeinputs (
Collection[Dict[str,ndarray]]) – The set of input samples to use during optimization.num_iterations (
int) – Number of optimization steps to take for each layer. Recommended value is 10K for weight bitwidths >= 8-bits, 15K for weight bitwidths < 8 bits.nodes_to_include (
Optional[List[str]]) – List of node names to optimize. If None, all the nodes(under supported types) will be optimized