nncf.common.quantization.statistics#

Classes#

QuantizationStatistics

Contains statistics of the quantization algorithm. These statistics include:

class nncf.common.quantization.statistics.QuantizationStatistics(wq_counter, aq_counter, num_wq_per_bitwidth, num_aq_per_bitwidth, ratio_of_enabled_quantizations)[source]#

Bases: nncf.api.statistics.Statistics

Contains statistics of the quantization algorithm. These statistics include:

  • Information about the share of the quantization, such as:

    • Percentage of symmetric/asymmetric/per-channel/per-tensor weight quantizers relative to the number of placed weight quantizers.

    • Percentage of symmetric/asymmetric/per-channel/per-tensor non-weight quantizers relative to the number of placed non weight quantizers.

    • Percentage of weight quantizers and non-weight quantizers for each precision relative to the number of potential quantizers/placed quantizers.

  • Information about the distribution of the bitwidth of the quantizers.

  • Ratio of enabled quantization.

Note

The maximum possible number of potential quantizers depends on the presence of ignored scopes and the mode of quantizer setup that is used at the time of collecting the metric.

Parameters:
  • wq_counter (QuantizersCounter) – Weight quantizers counter.

  • aq_counter (QuantizersCounter) – Activation quantizers counter.

  • num_wq_per_bitwidth (Dict[int, int]) – Number of weight quantizers per bit width.

  • num_aq_per_bitwidth (Dict[int, int]) – Number of activation quantizers per bit width.

  • ratio_of_enabled_quantizations (float) – Ratio of enabled quantizations.

to_str()[source]#

Returns a representation of the statistics as a human-readable string.

Return type:

str