Skip to content

Commit

Permalink
Release v2.13.0 of NNCF to master
Browse files Browse the repository at this point in the history
  • Loading branch information
KodiaqQ committed Sep 19, 2024
1 parent af5e8ff commit e0939f6
Show file tree
Hide file tree
Showing 258 changed files with 35,319 additions and 1,404 deletions.
92 changes: 62 additions & 30 deletions .github/action_configs/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,81 @@
# See help here: https://github.com/marketplace/actions/labeler

dependencies:
- 'requirements.txt'
- '**/setup.py'
- any:
- changed-files:
- any-glob-to-any-file:
- 'requirements.txt'
- '**/setup.py'

NNCF PT:
- 'examples/torch/**/*!(.md)'
- 'examples/post_training_quantization/torch/**/*!(.md)'
- 'nncf/torch/**/*!(.md)'
- 'tests/torch/**/*!(.md)'
- 'nncf/quantization/**/torch_backend.py'
- any:
- changed-files:
- any-glob-to-any-file:
- 'examples/torch/**/*!(.md)'
- 'examples/post_training_quantization/torch/**/*!(.md)'
- 'nncf/torch/**/*!(.md)'
- 'tests/torch/**/*!(.md)'
- 'nncf/quantization/**/torch_backend.py'

NNCF TF:
- 'examples/tensorflow/**/*!(.md)'
- 'examples/post_training_quantization/tensorflow/**/*!(.md)'
- 'nncf/tensorflow/**/*!(.md)'
- 'tests/tensorflow/**/*!(.md)'
- 'nncf/quantization/**/tf_backend.py'
- any:
- changed-files:
- any-glob-to-any-file:
- 'examples/tensorflow/**/*!(.md)'
- 'examples/post_training_quantization/tensorflow/**/*!(.md)'
- 'nncf/tensorflow/**/*!(.md)'
- 'tests/tensorflow/**/*!(.md)'
- 'nncf/quantization/**/tf_backend.py'

NNCF ONNX:
- 'examples/onnx/**/*!(.md)'
- 'examples/post_training_quantization/onnx/**/*!(.md)'
- 'nncf/onnx/**/*!(.md)'
- 'tests/onnx/**/*!(.md)'
- 'nncf/quantization/**/onnx_backend.py'
- any:
- changed-files:
- any-glob-to-any-file:
- 'examples/onnx/**/*!(.md)'
- 'examples/post_training_quantization/onnx/**/*!(.md)'
- 'nncf/onnx/**/*!(.md)'
- 'tests/onnx/**/*!(.md)'
- 'nncf/quantization/**/onnx_backend.py'

NNCF OpenVINO:
- 'examples/openvino/**/*!(.md)'
- 'examples/post_training_quantization/openvino/**/*!(.md)'
- 'nncf/openvino/**/*!(.md)'
- 'tests/openvino/**/*!(.md)'
- 'nncf/quantization/**/openvino_backend.py'
- any:
- changed-files:
- any-glob-to-any-file:
- 'examples/openvino/**/*!(.md)'
- 'examples/post_training_quantization/openvino/**/*!(.md)'
- 'nncf/openvino/**/*!(.md)'
- 'tests/openvino/**/*!(.md)'
- 'nncf/quantization/**/openvino_backend.py'

NNCF PTQ:
- 'nncf/quantization/**/*!(.md)'
- 'tests/post_training/**/*!(.md)'
- any:
- changed-files:
- any-glob-to-any-file:
- 'nncf/quantization/**/*!(.md)'
- 'tests/post_training/**/*!(.md)'

documentation:
- '**/*.md'
- 'docs/**/*'
- any:
- changed-files:
- any-glob-to-any-file:
- '**/*.md'
- 'docs/**/*'

experimental:
- 'nncf/experimental/**/*!(.md)'
- any:
- changed-files:
- any-glob-to-any-file:
- 'nncf/experimental/**/*!(.md)'

NNCF Common:
- 'examples/common/**/*!(.md)'
- 'nncf/common/**/*!(.md)'
- 'tests/common/**/*!(.md)'
- any:
- changed-files:
- any-glob-to-any-file:
- 'examples/common/**/*!(.md)'
- 'nncf/common/**/*!(.md)'
- 'tests/common/**/*!(.md)'

release target:
- any:
- base-branch:
- '^release_v*'
53 changes: 20 additions & 33 deletions .github/workflows/api_changes_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: API changes check
permissions: read-all

on:
pull_request_target:
pull_request:
branches:
- develop

Expand Down Expand Up @@ -41,37 +41,24 @@ jobs:
echo ${CHANGED_FILES}
CHANGED_FILES=$(echo $CHANGED_FILES | tr '\n' ' ')
echo "changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ !(contains(steps.diff.outputs.changed_files, 'differ')) && contains(github.event.pull_request.labels.*.name, 'API') }}
with:
github-token: ${{ secrets.ADD_LABELS_WITH_REST_API }}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: "API"
})
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
- name: Add label
if: ${{ contains(steps.diff.outputs.changed_files, 'differ') }}
run: |
echo '{"pr_number": "${{ github.event.pull_request.number }}", "action": "add"}' > api_status.json
- name: Remove label
if: ${{ !(contains(steps.diff.outputs.changed_files, 'differ')) && contains(github.event.pull_request.labels.*.name, 'API') }}
run: |
echo '{"pr_number": "${{ github.event.pull_request.number }}", "action": "remove"}' > api_status.json
- name: No change label
if: ${{ !(contains(steps.diff.outputs.changed_files, 'differ')) && !contains(github.event.pull_request.labels.*.name, 'API') }}
run: |
echo '{"pr_number": "${{ github.event.pull_request.number }}", "action": "none"}' > api_status.json
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.ADD_LABELS_WITH_REST_API }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["API"]
})
- name: Add release label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ contains(github.event.pull_request.base.ref, 'release_v') }}
with:
github-token: ${{ secrets.ADD_LABELS_WITH_REST_API }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["release_target"]
})
name: api_status
path: api_status.json
61 changes: 61 additions & 0 deletions .github/workflows/api_set_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Set API label
permissions: read-all

on:
workflow_run:
workflows: ["API changes check"]
types:
- completed

jobs:
update_labels:
runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: api_status

- name: Get api_status
run: cat api_status.json

- name: Set output value
id: status
run: |
echo "action=$(cat api_status.json | jq -r .action)" >> $GITHUB_OUTPUT
echo "pr_number=$(cat api_status.json | jq -r .pr_number)" >> $GITHUB_OUTPUT
- name: Print outputs
run: echo ${{ steps.status.outputs.action }} ${{ steps.status.outputs.pr_number }}

- name: Add label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ steps.status.outputs.action == 'add' }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
github.rest.issues.addLabels({
issue_number: ${{ steps.status.outputs.pr_number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["API"]
})
- name: Remove label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ steps.status.outputs.action == 'remove' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.removeLabel({
issue_number: ${{ steps.status.outputs.pr_number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: "API"
})
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-20.04
steps:
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: '.github/action_configs/labeler.yml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post_pr_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Post-PR merge actions
permissions: read-all

on:
pull_request_target:
pull_request:
branches:
- develop
types:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,18 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
name: coverage_tensorflow
flags: TENSORFLOW
tools:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
lfs: true
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.8.18
cache: pip
- name: Install NNCF and test requirements
run: |
pip install -r tests/tools/requirements.txt
- name: Run tools precommit test scope
run: PYTHONPATH=./ pytest -ra tests/tools
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ graft nncf/torch/extensions
graft nncf/common/hardware/configs
include LICENSE
include licensing/third-party-programs.txt
include docs/PyPiPublishing.md
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ test-torch:
pytest ${COVERAGE_ARGS} tests/torch -m "not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH} $(DATA_ARG)

test-torch-cpu:
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} tests/torch -ra -m "not cuda and not weekly and not nightly and not models_hub"
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} tests/torch -ra -m "not cuda and not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH}

test-torch-cuda:
pytest ${COVERAGE_ARGS} tests/torch -ra -m "cuda and not weekly and not nightly and not models_hub"
pytest ${COVERAGE_ARGS} tests/torch -ra -m "cuda and not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH}

test-torch-nightly:
pytest ${COVERAGE_ARGS} tests/torch -m nightly --junitxml ${JUNITXML_PATH} $(DATA_ARG)
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[Usage](#usage)
[Tutorials and Samples](#demos-tutorials-and-samples)
[Third-party integration](#third-party-repository-integration)
[NNCF Model Zoo](./docs/ModelZoo.md)
[Model Zoo](./docs/ModelZoo.md)

[![GitHub Release](https://img.shields.io/github/v/release/openvinotoolkit/nncf?color=green)](https://github.com/openvinotoolkit/nncf/releases)
[![Website](https://img.shields.io/website?up_color=blue&up_message=docs&url=https%3A%2F%2Fdocs.openvino.ai%2Flatest%2Fopenvino_docs_model_optimization_guide.html)](https://docs.openvino.ai/nncf)
Expand Down Expand Up @@ -37,6 +37,7 @@ learning frameworks.
| :------------------------------------------------------------------------------------------------------- | :-------: | :-------: | :-----------: | :-----------: |
| [Post-Training Quantization](./docs/usage/post_training_compression/post_training_quantization/Usage.md) | Supported | Supported | Supported | Supported |
| [Weights Compression](./docs/usage/post_training_compression/weights_compression/Usage.md) | Supported | Supported | Not supported | Not supported |
| [Activation Sparsity](./nncf/experimental/torch/sparsify_activations/ActivationSparsity.md) | Not supported | Experimental |Not supported| Not supported |

### Training-Time Compression Algorithms

Expand Down Expand Up @@ -351,7 +352,6 @@ A list of notebooks demonstrating OpenVINO conversion and inference together wit
| Demo Model | Compression Algorithm | Backend | Domain |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------:|:---------:|:--------------------------------------------------------------------:|
| [YOLOv8](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/yolov8-optimization)<br>[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/latest/notebooks/yolov8-optimization/yolov8-object-detection.ipynb) | Post-Training Quantization | OpenVINO | Object Detection,<br>KeyPoint Detection,<br>Instance Segmentation |
| [YOLOv7](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/yolov7-optimization) | Post-Training Quantization | OpenVINO | Object Detection |
| [EfficientSAM](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/efficient-sam) | Post-Training Quantization | OpenVINO | Image Segmentation |
| [Segment Anything Model](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/segment-anything) | Post-Training Quantization | OpenVINO | Image Segmentation |
| [OneFormer](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/oneformer-segmentation) | Post-Training Quantization | OpenVINO | Image Segmentation |
Expand All @@ -370,7 +370,6 @@ A list of notebooks demonstrating OpenVINO conversion and inference together wit
| [Grammar Error Correction](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/grammar-correction) | Post-Training Quantization | OpenVINO | NLP, Grammar Correction |
| [LLM Instruction Following](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/llm-question-answering) | Weight Compression | OpenVINO | NLP, Instruction Following |
| [Dolly 2.0](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/dolly-2-instruction-following) | Weight Compression | OpenVINO | NLP, Instruction Following |
| [Stable-Zephyr-3b](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/stable-zephyr-3b-chatbot) | Weight Compression | OpenVINO | NLP, Chat Bot |
| [LLM Chat Bots](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/llm-chatbot) | Weight Compression | OpenVINO | NLP, Chat Bot |

### Post-Training Quantization Examples
Expand Down Expand Up @@ -440,12 +439,12 @@ conda install -c conda-forge nncf
- Ubuntu\* 18.04 or later (64-bit)
- Python\* 3.8 or later
- Supported frameworks:
- PyTorch\* >=2.2, <2.4
- PyTorch\* >=2.3, <2.5
- TensorFlow\* >=2.8.4, <=2.15.1
- ONNX\* ==1.16.0
- OpenVINO\* >=2022.3.0

This repository is tested on Python* 3.8.10, PyTorch* 2.3.0 (NVidia CUDA\* Toolkit 12.1) and TensorFlow* 2.12.1 (NVidia CUDA\* Toolkit 11.8).
This repository is tested on Python* 3.8.10, PyTorch* 2.4.0 (NVidia CUDA\* Toolkit 12.1) and TensorFlow* 2.12.1 (NVidia CUDA\* Toolkit 11.8).

## NNCF Compressed NNCF Model Zoo

Expand Down
Loading

0 comments on commit e0939f6

Please sign in to comment.