Skip to content

Commit

Permalink
Release v2.6.0 of NNCF to master
Browse files Browse the repository at this point in the history
  • Loading branch information
KodiaqQ committed Sep 18, 2023
1 parent f4b73bf commit e396dd4
Show file tree
Hide file tree
Showing 805 changed files with 97,748 additions and 39,533 deletions.
10 changes: 10 additions & 0 deletions .file-header
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright \(c\) (\d{4}|\d{4}-\d{4}) Intel Corporation
# Licensed under the Apache License, Version 2.0 \(the "License"\);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pre-commit autoformatting (isort, black)
de18dbe23246135d3604a8116c3484e98a8ed0cc

# license formatting
34b6b82a746ddac6668c64f012edfe97de090f06
50 changes: 29 additions & 21 deletions .github/action_configs/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,45 @@ dependencies:
- '**/setup.py'

NNCF PT:
- 'examples/torch/**/*'
- 'examples/post_training_quantization/torch/**/*'
- 'nncf/torch/**/*'
- 'tests/torch/**/*'
- 'examples/torch/**/*!(.md)'
- 'examples/post_training_quantization/torch/**/*!(.md)'
- 'nncf/torch/**/*!(.md)'
- 'tests/torch/**/*!(.md)'
- 'nncf/quantization/**/torch_backend.py'

NNCF TF:
- 'examples/tensorflow/**/*'
- 'examples/post_training_quantization/tensorflow/**/*'
- 'nncf/tensorflow/**/*'
- 'tests/tensorflow/**/*'
- 'examples/tensorflow/**/*!(.md)'
- 'examples/post_training_quantization/tensorflow/**/*!(.md)'
- 'nncf/tensorflow/**/*!(.md)'
- 'tests/tensorflow/**/*!(.md)'
- 'nncf/quantization/**/tf_backend.py'

NNCF ONNX:
- 'examples/onnx/**/*'
- 'examples/post_training_quantization/onnx/**/*'
- 'nncf/onnx/**/*'
- 'tests/onnx/**/*'
- 'examples/onnx/**/*!(.md)'
- 'examples/post_training_quantization/onnx/**/*!(.md)'
- 'nncf/onnx/**/*!(.md)'
- 'tests/onnx/**/*!(.md)'
- 'nncf/quantization/**/onnx_backend.py'

NNCF OpenVINO:
- 'examples/openvino/**/*'
- 'examples/post_training_quantization/openvino/**/*'
- 'nncf/openvino/**/*'
- 'tests/openvino/**/*'
- '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)'

documentation:
- '**/README.md'
- '**/*.md'
- 'docs/**/*'

experimental:
- 'nncf/experimental/**/*'
- 'nncf/experimental/**/*!(.md)'

NNCF Common:
- 'examples/common/**/*'
- 'nncf/common/**/*'
- 'tests/common/**/*'
- 'examples/common/**/*!(.md)'
- 'nncf/common/**/*!(.md)'
- 'tests/common/**/*!(.md)'
4 changes: 2 additions & 2 deletions .github/workflows/api_changes_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ref: "refs/pull/${{ github.event.number }}/merge"
compare-api-doc-with-develop:
needs: call-build-api-doc
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
issues: write
steps:
Expand All @@ -40,7 +40,7 @@ jobs:
CHANGED_FILES=$(echo $CHANGED_FILES | tr '\n' ' ')
echo "changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v6
if: ${{ !contains(steps.diff.outputs.changed_files, 'differ') }}
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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_publish_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/workflows/build_schema_page.yml
publish:
needs: [call-build-html-doc, call-build-schema-page]
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout main repo # the github-pages-deploy-action seems to require this step
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_html_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
type: string
jobs:
build-html:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Install NNCF and doc requirements
run: |
pip install -e .
pip install .
pip install -r docs/api/requirements.txt
- name: Build API docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_schema_page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ on:
workflow_call:
jobs:
build-config-schema-html:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build
run: |
pip install json-schema-for-humans
pip install -e .
pip install .
python -c 'import jstyleson; from nncf.config import NNCFConfig; jstyleson.dump(NNCFConfig.schema(), open("./schema.json", "w"), indent=2)'
mkdir schema
generate-schema-doc --deprecated-from-description schema.json schema/index.html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/labeler@v4
with:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/post_pr_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# With the squash-and-merge strategy that we are employing, the final commit that ends up in the develop branch
# after the PR merge has a brand-new commit SHA that is not equal to the SHA of the last commit in the PR.
# This means that the coverage reports uploaded to Codecov in the course of the (yet unmerged) PR checks will not
# be translated to the ultimate commit in the develop and Codecov will show "missing base report" errors in the UI.
# We don't want to re-run the precommits after PR merge via a separate 'on: push' action on the develop branch, so
# instead will grab the latest coverage report artifact from the just-merged PR and upload it as the report for the
# new commit on develop. Note that this will break if the PR is merged before the coverage artifact for the latest
# PR commit is generated.

name: Post-PR merge actions

on:
pull_request_target:
branches:
- develop
types:
- closed

jobs:
upload-coverage:
if: github.event.pull_request.merged == true
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3 # codecov uploader demands that the scanned files be present when uploading
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: dawidd6/action-download-artifact@v2
with:
workflow: precommit.yml
check_artifacts: true
commit: ${{ github.event.pull_request.head.sha }} # this is the latest commit in the PR
name: coverage_xml
- name: Upload coverage report to Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
# github.event.pull_request.merge_commit_sha is the fresh commit in the develop,
# provided that github.event.pull_request.merged == true
./codecov -f ./coverage.xml -t ${{ secrets.CODECOV_TOKEN }} -C ${{ github.event.pull_request.merge_commit_sha }} -B develop -n "codecov-onnx"
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit-linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pre-commit-linters

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

jobs:
pre-commit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8.10
- name: Install pre-commit package
run: make install-pre-commit
- name: Run pre-commit linter suite
run: make pre-commit
33 changes: 33 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: precommit

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

jobs:
onnx:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-python@v3
with:
python-version: 3.8.10
- name: Install NNCF and test requirements
run: make install-onnx-test
- name: Run ONNX precommit test scope
run: make test-onnx
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v3
with:
name: coverage_xml # optional
path: ./coverage.xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-onnx # optional
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:
deploy:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,18 @@ examples/post_training_quantization/onnx/mobilenet_v2/mobilenet_v2_*
examples/post_training_quantization/openvino/mobilenet_v2/mobilenet_v2_*
examples/post_training_quantization/tensorflow/mobilenet_v2/mobilenet_v2_*
examples/post_training_quantization/torch/mobilenet_v2/mobilenet_v2_*
examples/post_training_quantization/torch/ssd300_vgg16/ssd300_vgg16_*
examples/post_training_quantization/openvino/anomaly_stfpm_quantize_with_accuracy_control/stfpm_*
examples/post_training_quantization/openvino/yolov8/yolov8n*
examples/post_training_quantization/openvino/yolov8_quantize_with_accuracy_control/yolov8n*
examples/**/runs/**
examples/**/results/**
compressed_graph.dot
original_graph.dot
datasets/**

# Tests
tests/**/runs/**
tests/**/tmp*/**
open_model_zoo/
nncf-tests.xml
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
line_length = 120
force_single_line = true
profile = black
single_line_exclusions = typing
skip_glob=examples/post_training_quantization/torch/ssd300_vgg16/main.py
9 changes: 9 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Default state for all rules
default: true

MD013: false # Line length
MD033: false # Inline HTML
MD034: false # Bare URL used
MD036: false # Emphasis used instead of a heading
MD037: false # Spaces inside emphasis markers
MD041: false # First line
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default_language_version:
python: python3

repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
files: '^.*\.py'
args: ["--line-length", "120"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
args: [--config=.markdownlint.yaml]
5 changes: 4 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ disable = arguments-differ,

max-line-length = 120
ignore-docstrings = yes
ignored-modules = numpy,torch,cv2,openvino,tensorflow
ignored-modules = numpy,torch,cv2,openvino,tensorflow,optimum,memory_profiler
extension-pkg-whitelist = torch,cv2
init-hook='import sys; sys.setrecursionlimit(8 * sys.getrecursionlimit())' # to avoid https://stackoverflow.com/questions/36496192/pylint-infinite-recursion-in-astriod-package
load-plugins=pylintfileheader
file-header-path=.file-header
file-header-ignore-empty-files=yes

[SIMILARITIES]
ignore-imports = yes
Expand Down
8 changes: 2 additions & 6 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
* @openvinotoolkit/nncf_pytorch-maintainers
* @openvinotoolkit/nncf-maintainers

CODEOWNERS @openvinotoolkit/openvino-admins

# Control 3d party dependencies
requirements.txt @openvino-configuration-mgmt
**/setup.py @openvino-configuration-mgmt
CODEOWNERS @openvinotoolkit/nncf-admins
Loading

0 comments on commit e396dd4

Please sign in to comment.