Skip to content

Commit dd27e44

Browse files
committed
Release v2.0.1 of NNCF to master
1 parent 6673fc0 commit dd27e44

File tree

323 files changed

+6380
-33720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+6380
-33720
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.png filter=lfs diff=lfs merge=lfs -text
2+
*.jpg filter=lfs diff=lfs merge=lfs -text
23
*.pb filter=lfs diff=lfs merge=lfs -text
34

45
* text=auto eol=lf

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# See help here: https://github.com/marketplace/actions/labeler
2+
3+
dependencies:
4+
- '*requirements*'
5+
- '*setup.py'

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Changes
2+
3+
<!--- What was changed (briefly), how to reproduce (if applicable), what the reviewers should focus on -->
4+
5+
### Reason for changes
6+
7+
<!--- Why should the change be applied -->
8+
9+
### Related tickets
10+
11+
<!--- Post the numerical ID of the ticket, if available -->
12+
13+
### Tests
14+
15+
<!--- How was the correctness of changes tested and whether new tests were added -->

.github/workflows/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Pull Request Labeler"
2+
on: [pull_request_target]
3+
4+
jobs:
5+
triage:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/labeler@v3
9+
with:
10+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
11+
sync-labels: true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ See [third_party_integration](./third_party_integration) for examples of code mo
141141
- Ubuntu\* 18.04 or later (64-bit)
142142
- Python\* 3.6.2 or later
143143
- Supported frameworks:
144-
- PyTorch\* >=1.5.0, <=1.8.1 (1.8.0 not supported)
145-
- TensorFlow\* 2.4.2
144+
- PyTorch\* >=1.5.0, <=1.9.1 (1.8.0 not supported)
145+
- TensorFlow\* 2.4.3
146146

147-
This repository is tested on Python* 3.6.2+, PyTorch* 1.8.1 (NVidia CUDA\* Toolkit 10.2) and TensorFlow* 2.4.2 (NVidia CUDA\* Toolkit 11.0).
147+
This repository is tested on Python* 3.6.2+, PyTorch* 1.9.1 (NVidia CUDA\* Toolkit 10.2) and TensorFlow* 2.4.3 (NVidia CUDA\* Toolkit 11.0).
148148

149149
## Installation
150150
We suggest to install or use the package in the [Python virtual environment](https://docs.python.org/3/tutorial/venv.html).

ReleaseNotes.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ samples distributed with the code. The samples demonstrate the usage of compres
77
public models and datasets for three different use cases: Image Classification, Object Detection,
88
and Semantic Segmentation.
99

10+
## New in Release 2.0.1
11+
Target version updates:
12+
- Bump target framework versions to PyTorch 1.9.1 and TensorFlow 2.4.3
13+
- Increased target HuggingFace transformers version for the integration patch to 4.9.1
14+
15+
Bugfixes:
16+
- Fixed statistic collection for the algo mixing scenario
17+
- Increased pruning algorithm robustness in cases of a disconnected NNCF graph
18+
- Fixed the fatality of NNCF graph PNG rendering failures
19+
- Fixed README command lines
20+
- (PyTorch) Fixed a bug with quantizing shared weights multiple times
21+
- (PyTorch) Fixed knowledge distillation failures in CPU-only and DataParallel scenarios
22+
- (PyTorch) Fixed sparsity application for torch.nn.Embedding and EmbeddingBag modules
23+
- (PyTorch) Added GroupNorm + ReLU as a fusable pattern
24+
- (TensorFlow) Fixed gamma fusion handling for pruning TF BatchNorm
25+
- (PyTorch) Fixed pruning for models where operations have multiple convolution predecessors
26+
- (PyTorch) Fixed NNCFNetwork wrapper so that `self` in the calls to the wrapped model refer to the wrapper NNCFNetwork object and not to the wrapped model
27+
- (PyTorch) Fixed tracing of `view` operations to handle shape arguments with the `torch.Tensor` type
28+
- (PyTorch) Added matmul ops to be considered for fusing
29+
- (PyTorch, TensorFlow) Fixed tensorboard logging for accuracy-aware scenarios
30+
- (PyTorch, TensorFlow) Fixed FLOPS calculation for grouped convolutions
31+
- (PyTorch) Fixed knowledge distillation failures for tensors of unsupported shapes - will ignore output tensors with unsupported shapes now instead of crashing.
32+
1033
## New in Release 2.0:
1134
- Added TensorFlow 2.4.2 support - NNCF can now be used to apply the compression algorithms to models originally trained in TensorFlow.
1235
NNCF with TensorFlow backend supports the following features:

docs/Usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,4 @@ model = training_loop.run(model,
342342
validate_fn=validate_fn,
343343
configure_optimizers_fn=configure_optimizers_fn)
344344
```
345-
The above call executes the acccuracy-aware adaptive compression training loop and return the compressed model with the maximal found compression rate and satisfying the defined accuracy drop criteria. For more details on how to use the accuracy-aware training loop functionality of NNCF, please refer to its [documentation](./accuracy_aware_model_training/TrainingLoop.md).
345+
The above call executes the acccuracy-aware adaptive compression training loop and return the compressed model with the maximal found compression rate and satisfying the defined accuracy drop criteria. For more details on how to use the accuracy-aware training loop functionality of NNCF, please refer to its [documentation](./accuracy_aware_model_training/AdaptiveCompressionTraining.md).

docs/accuracy_aware_model_training/AdaptiveCompressionTraining.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Accuracy-aware training loop in NNCF
22

3-
To launch the adaptive compression training loop, the user is expected to define several function related to model training, validation and optimizer creation (see [the usage documentation](./docs/Usage.md#accuracy-aware-model-training) for more details) and pass them to the run method of an `AdaptiveCompressionTrainingLoop` instance. The training loop logic inside of the `AdaptiveCompressionTrainingLoop` is framework-agnostic, while all of the framework specifics are encapsulated inside of corresponding `Runner` objects, which are created and called inside the training loop. The adaptive compression training loop is generally aimed at automatically searching for the optimal compression rate in the model, with the parameters of the search algorithm specified in the configuration file as follows:
3+
To launch the adaptive compression training loop, the user is expected to define several function related to model training, validation and optimizer creation (see [the usage documentation](../Usage.md#accuracy-aware-model-training) for more details) and pass them to the run method of an `AdaptiveCompressionTrainingLoop` instance. The training loop logic inside of the `AdaptiveCompressionTrainingLoop` is framework-agnostic, while all of the framework specifics are encapsulated inside of corresponding `Runner` objects, which are created and called inside the training loop. The adaptive compression training loop is generally aimed at automatically searching for the optimal compression rate in the model, with the parameters of the search algorithm specified in the configuration file as follows:
44
```
55
"compression": [
66
{

docs/compression_algorithms/Sparsity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ sparsity and filter pruning algorithms. It can be enabled by setting a non-zero
5252
"sparsity_target_epoch": 3, // Index of the epoch from which the sparsity level of the model will be equal to spatsity_target value
5353
"sparsity_freeze_epoch": 50, // Index of the epoch from which the sparsity mask will be frozen and no longer trained
5454
"multistep_steps": [10, 20], // A list of scheduler steps at which to transition to the next scheduled sparsity level (multistep scheduler only).
55-
"multistep_sparsity_levels": [0.2, 0.5] //Levels of sparsity to use at each step of the scheduler as specified in the 'multistep_steps' attribute. The firstsparsity level will be applied immediately, so the length of this list should be larger than the length of the 'steps' by one."
55+
"multistep_sparsity_levels": [0.2, 0.5, 0.7] // Levels of sparsity to use at each step of the scheduler as specified in the 'multistep_steps' attribute. The first sparsity level will be applied immediately, so the length of this list should be larger than the length of the 'steps' by one. The last sparsity level will function as the ultimate sparsity target, overriding the "sparsity_target" setting if it is present.
5656
},
5757
5858
// A list of model control flow graph node scopes to be ignored for this operation - functions as a 'denylist'. Optional.
@@ -88,7 +88,7 @@ The magnitude sparsity method implements a naive approach that is based on the a
8888
"sparsity_target_epoch": 3, // Index of the epoch from which the sparsity level of the model will be equal to spatsity_target value
8989
"sparsity_freeze_epoch": 50, // Index of the epoch from which the sparsity mask will be frozen and no longer trained
9090
"multistep_steps": [10, 20], // A list of scheduler steps at which to transition to the next scheduled sparsity level (multistep scheduler only).
91-
"multistep_sparsity_levels": [0.2, 0.5] //Levels of sparsity to use at each step of the scheduler as specified in the 'multistep_steps' attribute. The firstsparsity level will be applied immediately, so the length of this list should be larger than the length of the 'steps' by one."
91+
"multistep_sparsity_levels": [0.2, 0.5, 0.7] // Levels of sparsity to use at each step of the scheduler as specified in the 'multistep_steps' attribute. The first sparsity level will be applied immediately, so the length of this list should be larger than the length of the 'steps' by one. The last sparsity level will function as the ultimate sparsity target, overriding the "sparsity_target" setting if it is present.
9292
},
9393
9494
// A list of model control flow graph node scopes to be ignored for this operation - functions as a 'denylist'. Optional.

examples/tensorflow/classification/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ To export a model to the OpenVINO IR and run it using the Intel® Deep Learning
119119
|MobileNet V3 small|INT8 (per-channel, symmetric for weights; per-tensor, asymmetric for activations) |ImageNet|67.7 (0.68)|[mobilenet_v3_small_imagenet_int8.json](configs/quantization/mobilenet_v3_small_imagenet_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/mobilenet_v3_small_int8_w_sym_ch_half_a_asym_t.tar.gz)|
120120
|MobileNet V3 small|INT8 (per-channel, symmetric for weights; per-tensor, asymmetric for activations) + Sparsity 42% (RB)|ImageNet|67.7 (0.68)|[mobilenet_v3_small_imagenet_rb_sparsity_int8.json](configs/sparsity_quantization/mobilenet_v3_small_imagenet_rb_sparsity_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/mobilenet_v3_small_int8_w_sym_ch_half_a_asym_t_rb_sparsity_42.tar.gz)|
121121
|MobileNet V3 large|INT8 (per-channel, symmetric for weights; per-tensor, asymmetric for activations) |ImageNet|75.0 (0.81)|[mobilenet_v3_large_imagenet_int8.json](configs/quantization/mobilenet_v3_large_imagenet_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/mobilenet_v3_large_int8_w_sym_ch_half_a_asym_t.tar.gz)|
122-
|MobileNet V3 large|INT8 (per-channel, symmetric for weights; per-tensor, asymmetric for activations) + Sparsity 42% (RB)|ImageNet|75.15 (0.66)|[mobilenet_v3_large_imagenet_rb_sparsity_int8.json](configs/sparsity_quantization/mobilenet_v3_large_imagenet_rb_sparsity_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/mobilenet_v3_large_int8_w_sym_ch_half_a_asym_t_sparsity_42.tar.gz)|
122+
|MobileNet V3 large|INT8 (per-channel, symmetric for weights; per-tensor, asymmetric for activations) + Sparsity 42% (RB)|ImageNet|75.15 (0.66)|[mobilenet_v3_large_imagenet_rb_sparsity_int8.json](configs/sparsity_quantization/mobilenet_v3_large_imagenet_rb_sparsity_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/mobilenet_v3_large_int8_w_sym_ch_half_a_asym_t_rb_sparsity_42.tar.gz)|
123123
|ResNet50|INT8 (per-tensor, symmetric for weights; per-tensor, symmetric for activations)|ImageNet|75.0 (0.04)|[resnet50_imagenet_int8.json](configs/quantization/resnet50_imagenet_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/resnet50_int8_w_sym_t_half_a_sym_t.tar.gz)|
124124
|ResNet50|Sparsity 80% (RB)|ImageNet|74.36 (0.68)|[resnet50_imagenet_rb_sparsity.json](configs/sparsity/resnet50_imagenet_rb_sparsity.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/resnet50_rb_sparsity_80.tar.gz)|
125125
|ResNet50|INT8 (per-tensor, symmetric for weights; per-tensor, symmetric for activations) + Sparsity 65% (RB)|ImageNet|74.3 (0.74)|[resnet50_imagenet_rb_sparsity_int8.json](configs/sparsity_quantization/resnet50_imagenet_rb_sparsity_int8.json)|[Link](https://storage.openvinotoolkit.org/repositories/nncf/models/v2.0.0/tensorflow/resnet50_int8_w_sym_t_half_a_sym_t_rb_sparsity_65.tar.gz)|

0 commit comments

Comments
 (0)