Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PT] Extractor for fused convolution #2559

Merged
merged 17 commits into from
Mar 21, 2024

Conversation

AlexanderDokuchaev
Copy link
Collaborator

@AlexanderDokuchaev AlexanderDokuchaev commented Mar 7, 2024

Changes

  • Get layer attributes by args, kwargs for conv, batch_norm, group_norm and linear functions.
  • Extract submodules for FBC for custom conv and batch norm modules.
  • Add model_graph_manager module to works with models with wrapped with trace_parameters=True. (model_analizer.py will be deprecated after finished refactor PTQ to use graph with constant nodes)
  • Moved nncf/quantization/algorithms/weight_compression/torch_backend.py to model_graph_manager

Related tickets

129581

Tests

tests/torch/test_model_graph_manager.py
tests/torch/test_extractor.py

@AlexanderDokuchaev AlexanderDokuchaev requested a review from a team as a code owner March 7, 2024 22:15
@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF Common Pull request that updates NNCF Common NNCF PTQ Pull requests that updates NNCF PTQ labels Mar 7, 2024
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 89.26380% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 84.84%. Comparing base (c5b3df8) to head (906800f).
Report is 27 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2559      +/-   ##
===========================================
- Coverage    90.92%   84.84%   -6.08%     
===========================================
  Files          498      494       -4     
  Lines        45550    45332     -218     
===========================================
- Hits         41415    38464    -2951     
- Misses        4135     6868    +2733     
Files Coverage Δ
nncf/common/graph/layer_attributes.py 96.29% <100.00%> (+0.03%) ⬆️
nncf/common/graph/operator_metatypes.py 93.97% <100.00%> (+0.14%) ⬆️
...ion/algorithms/weight_compression/torch_backend.py 84.00% <100.00%> (-1.09%) ⬇️
nncf/torch/dynamic_graph/wrappers.py 96.55% <100.00%> (+0.44%) ⬆️
nncf/torch/graph/operator_metatypes.py 99.10% <100.00%> (-0.13%) ⬇️
...f/torch/dynamic_graph/layer_attributes_handlers.py 99.36% <98.63%> (-0.64%) ⬇️
nncf/torch/extractor.py 83.95% <83.95%> (ø)
nncf/torch/model_graph_manager.py 84.21% <84.21%> (ø)

... and 83 files with indirect coverage changes

Flag Coverage Δ
COMMON 44.03% <18.75%> (+1.30%) ⬆️
ONNX 34.54% <14.72%> (-0.23%) ⬇️
OPENVINO ∅ <ø> (∅)
TENSORFLOW 29.72% <0.92%> (+0.06%) ⬆️
TORCH 65.87% <89.26%> (-0.14%) ⬇️

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

Components Coverage Δ
common 93.11% <100.00%> (-0.64%) ⬇️
torch 93.48% <89.13%> (+0.04%) ⬆️
tensorflow 93.74% <ø> (-0.22%) ⬇️
onnx 93.05% <ø> (ø)
openvino 25.58% <ø> (-68.49%) ⬇️
ptq 69.67% <100.00%> (-18.07%) ⬇️

nncf/torch/dynamic_graph/wrappers.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Show resolved Hide resolved
@alexsu52 alexsu52 requested a review from andrey-churkin March 8, 2024 11:41
nncf/torch/dynamic_graph/wrappers.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Show resolved Hide resolved
nncf/torch/dynamic_graph/wrappers.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Outdated Show resolved Hide resolved
@daniil-lyakhov daniil-lyakhov self-requested a review March 18, 2024 12:54
Copy link
Collaborator

@daniil-lyakhov daniil-lyakhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, please address my comments

nncf/torch/extractor.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Outdated Show resolved Hide resolved
nncf/torch/extractor.py Outdated Show resolved Hide resolved
nncf/torch/model_graph_manager.py Outdated Show resolved Hide resolved
nncf/torch/model_graph_manager.py Outdated Show resolved Hide resolved
nncf/torch/model_graph_manager.py Outdated Show resolved Hide resolved
nncf/torch/model_graph_manager.py Outdated Show resolved Hide resolved
nncf/torch/model_graph_manager.py Outdated Show resolved Hide resolved
Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, provide e2e results for PyTorch backend.

@AlexanderDokuchaev
Copy link
Collaborator Author

@alexsu52 TriggerBetta/647

Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexsu52 alexsu52 merged commit 81ff8b4 into openvinotoolkit:develop Mar 21, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF Common Pull request that updates NNCF Common NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants