nncf icon indicating copy to clipboard operation
nncf copied to clipboard

[QAT][Torch] Migrate statistic collection to `PTStatisticsAggregator`

Open daniil-lyakhov opened this issue 1 year ago • 1 comments

Changes

  • PT QAT statistic collection is using PTStatisticsAggregator to aggregate statistics
  • generate_collectors_for_range_init_statistics_collection function is simplified
  • get_input_shape_and_channel_idx is introduced to remove code duplicates

Reason for changes

Part of activity for QAT migration to PTQ quantization implementation

Related tickets

Tests

Updated accordingly

daniil-lyakhov avatar Jan 10 '24 15:01 daniil-lyakhov

Codecov Report

Attention: 42 lines in your changes are missing coverage. Please review.

Comparison is base (ae721fd) 46.04% compared to head (9a32b7b) 51.58%. Report is 14 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2386      +/-   ##
===========================================
+ Coverage    46.04%   51.58%   +5.54%     
===========================================
  Files          492      492              
  Lines        44678    44563     -115     
===========================================
+ Hits         20570    22986    +2416     
+ Misses       24108    21577    -2531     
Files Coverage Δ
nncf/torch/tensor_statistics/algo.py 53.84% <100.00%> (-1.42%) :arrow_down:
nncf/torch/initialization.py 39.49% <0.00%> (+0.33%) :arrow_up:
...f/quantization/algorithms/min_max/torch_backend.py 0.00% <0.00%> (ø)
nncf/torch/quantization/init_range.py 30.43% <14.28%> (+0.96%) :arrow_up:
nncf/torch/quantization/algo.py 24.58% <22.22%> (+0.38%) :arrow_up:

... and 198 files with indirect coverage changes

Flag Coverage Δ
COMMON 44.85% <0.00%> (+0.02%) :arrow_up:
ONNX 33.82% <19.23%> (+0.04%) :arrow_up:
OPENVINO ?
TENSORFLOW 29.68% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 87.05% <ø> (+17.63%) :arrow_up:
torch 33.15% <19.23%> (+0.11%) :arrow_up:
tensorflow 94.01% <ø> (+94.01%) :arrow_up:
onnx 96.91% <ø> (+0.53%) :arrow_up:
openvino 0.00% <ø> (-90.65%) :arrow_down:
ptq 53.22% <0.00%> (-28.21%) :arrow_down:

codecov[bot] avatar Jan 10 '24 15:01 codecov[bot]

Closed as create_compressed_model is going to be depricated

daniil-lyakhov avatar Apr 03 '24 09:04 daniil-lyakhov