Skip to content

Commit

Permalink
Release v2.9.0 of NNCF to master
Browse files Browse the repository at this point in the history
  • Loading branch information
KodiaqQ committed Mar 6, 2024
1 parent 17b72c8 commit 1937a97
Show file tree
Hide file tree
Showing 1,585 changed files with 66,194 additions and 1,755,430 deletions.
10 changes: 0 additions & 10 deletions .file-header

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: mypy

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
mypy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8.10
- name: Install NNCF
run: pip install -e .
- name: Install mypy
run: pip install mypy==1.8.0
- name: Run mypy
run: mypy --install-types --config-file=.mypy.ini --non-interactive
9 changes: 9 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[mypy]
files = nncf/common/sparsity
follow_imports = silent
strict = True

# should be removed later
# mypy recommends the following tool as an autofix:
# https://github.com/hauntsaninja/no_implicit_optional
implicit_optional = True
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ repos:
hooks:
- id: markdownlint
args: [--config=.markdownlint.yaml]

19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ install-pre-commit:
install-onnx-test:
pip install -U pip
pip install -e .[onnx]
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=omz-tools&subdirectory=tools/model_tools"
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
pip install -r tests/onnx/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
Expand Down Expand Up @@ -50,14 +52,14 @@ test-examples-onnx:
install-openvino-test:
pip install -U pip
pip install -e .[openvino]
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=omz-tools&subdirectory=tools/model_tools"
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
pip install tensorflow==2.12.0
pip install -r tests/openvino/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt

install-openvino-dev: install-openvino-test install-pre-commit
pip install -r examples/experimental/openvino/bert/requirements.txt
pip install -r examples/experimental/openvino/yolo_v5/requirements.txt
pip install -r examples/post_training_quantization/openvino/mobilenet_v2/requirements.txt
pip install -r examples/post_training_quantization/openvino/anomaly_stfpm_quantize_with_accuracy_control/requirements.txt
pip install -r examples/post_training_quantization/openvino/yolov8/requirements.txt
Expand All @@ -81,6 +83,8 @@ test-examples-openvino:
install-tensorflow-test:
pip install -U pip
pip install -e .[tf]
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=omz-tools&subdirectory=tools/model_tools"
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
pip install -r tests/tensorflow/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
Expand All @@ -105,6 +109,8 @@ test-examples-tensorflow:
install-torch-test:
pip install -U pip
pip install -e .[torch] --index-url https://download.pytorch.org/whl/cu118 --extra-index-url=https://pypi.org/simple # ticket 119128
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=omz-tools&subdirectory=tools/model_tools"
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
pip install -r tests/torch/requirements.txt --index-url https://download.pytorch.org/whl/cu118 --extra-index-url=https://pypi.org/simple
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
Expand Down Expand Up @@ -170,3 +176,12 @@ test-examples:
# Pre commit check
pre-commit:
pre-commit run -a


###############################################################################
# Fuzzing tests
install-fuzz-test: install-common-test
pip install -r tests/cross_fw/sdl/fuzz/requirements.txt

test-fuzz:
python tests/cross_fw/sdl/fuzz/quantize_api.py
77 changes: 36 additions & 41 deletions README.md

Large diffs are not rendered by default.

39 changes: 38 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Release Notes

## New in Release 2.9.0

Post-training Quantization:

- Features:
- (OpenVINO) Added modified AWQ algorithm for 4-bit data-aware weights compression. This algorithm applied only for patterns `MatMul->Multiply->Matmul`. For that `awq` optional parameter has been added to `nncf.compress_weights()` and can be used to minimize accuracy degradation of compressed models (note that this option increases the compression time).
- (ONNX) Introduced support for the ONNX backend in the `nncf.quantize_with_accuracy_control()` method. Users can now perform quantization with accuracy control for `onnx.ModelProto`. By leveraging this feature, users can enhance the accuracy of quantized models while minimizing performance impact.
- (ONNX) Added an example based on the YOLOv8n-seg model for demonstrating the usage of quantization with accuracy control for the ONNX backend.
- (PT) Added SmoothQuant algorithm for PyTorch backend in `nncf.quantize()`.
- (OpenVINO) Added [an example](examples/llm_compression/openvino/tiny_llama_find_hyperparams) with the hyperparameters tuning for the TinyLLama model.
- Introduced the `nncf.AdvancedAccuracyRestorerParameters`.
- Introduced the `subset_size` option for the `nncf.compress_weights()`.
- Introduced `TargetDevice.NPU` as the replacement for `TargetDevice.VPU`.
- Fixes:
- Fixed API Enums serialization/deserialization issue.
- Fixed issue with required arguments for `revert_operations_to_floating_point_precision` method.
- Improvements:
- (ONNX) Aligned statistics collection with OpenVINO and PyTorch backends.
- Extended `nncf.compress_weights()` with Convolution & Embeddings compression in order to reduce memory footprint.
- Deprecations/Removals:
- (OpenVINO) Removed outdated examples with `nncf.quantize()` for BERT and YOLOv5 models.
- (OpenVINO) Removed outdated example with `nncf.quantize_with_accuracy_control()` for SSD MobileNetV1 FPN model.
- (PyTorch) Deprecated the `binarization` algorithm.
- Removed Post-training Optimization Tool as OpenVINO backend.
- Removed Dockerfiles.
- `TargetDevice.VPU` was replaced by `TargetDevice.NPU`.
- Tutorials:
- [Post-Training Optimization of Stable Diffusion v2 Model](https://github.com/openvinotoolkit/openvino_notebooks/tree/main/notebooks/236-stable-diffusion-v2/236-stable-diffusion-v2-text-to-image.ipynb)
- [Post-Training Optimization of DeciDiffusion Model](https://github.com/openvinotoolkit/openvino_notebooks/tree/main/notebooks/259-decidiffusion-image-generation/259-decidiffusion-image-generation.ipynb)
- [Post-Training Optimization of DepthAnything Model](https://github.com/openvinotoolkit/openvino_notebooks/tree/main/notebooks/280-depth-anything/280-depth-anything.ipynb)
- [Post-Training Optimization of Stable Diffusion ControlNet Model](https://github.com/openvinotoolkit/openvino_notebooks/tree/main/notebooks/235-controlnet-stable-diffusion/235-controlnet-stable-diffusion.ipynb)

Compression-aware training:

- Fixes
- (PyTorch) Fixed issue with `NNCFNetworkInterface.get_clean_shallow_copy` missed arguments.

## New in Release 2.8.1

Post-training Quantization:
Expand All @@ -22,7 +59,7 @@ Post-training Quantization:
- (OpenVINO) Changed default OpenVINO opset from 9 to 13.
- Features:
- (OpenVINO) Added 4-bit data-aware weights compression. For that `dataset` optional parameter has been added to `nncf.compress_weights()` and can be used to minimize accuracy degradation of compressed models (note that this option increases the compression time).
- (PyTorch) Added support for PyTorch models with shared weights and custom PyTorch modules in `nncf.compress_weights()`. The weights compression algorithm for PyTorch models is now based on tracing the model graph. The `dataset` parameter is now required in `nncf.compress_weights()` for the compression of PyTorch models.
- (PyTorch) Added support for PyTorch models with shared weights and custom PyTorch modules in nncf.compress_weights(). The weights compression algorithm for PyTorch models is now based on tracing the model graph. The dataset parameter is now required in nncf.compress_weights() for the compression of PyTorch models.
- (Common) Renamed the `nncf.CompressWeightsMode.INT8` to `nncf.CompressWeightsMode.INT8_ASYM` and introduce `nncf.CompressWeightsMode.INT8_SYM` that can be efficiently used with dynamic 8-bit quantization of activations.
The original `nncf.CompressWeightsMode.INT8` enum value is now deprecated.
- (OpenVINO) Added support for quantizing the ScaledDotProductAttention operation from OpenVINO opset 13.
Expand Down
45 changes: 0 additions & 45 deletions docker/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions docker/onnx/openvinoep/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions docker/onnx/openvinoep/build.sh

This file was deleted.

44 changes: 0 additions & 44 deletions docker/tensorflow/gpu/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions docker/torch/cpu/Dockerfile

This file was deleted.

44 changes: 0 additions & 44 deletions docker/torch/gpu/Dockerfile

This file was deleted.

Loading

0 comments on commit 1937a97

Please sign in to comment.