Skip to content

Commit

Permalink
Release v2.5.0 of NNCF to master
Browse files Browse the repository at this point in the history
  • Loading branch information
KodiaqQ committed Jun 6, 2023
1 parent 6f5510f commit f4b73bf
Show file tree
Hide file tree
Showing 1,623 changed files with 2,082,717 additions and 71,907 deletions.
6 changes: 5 additions & 1 deletion .github/labeler.yml → .github/action_configs/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ dependencies:

NNCF PT:
- 'examples/torch/**/*'
- 'examples/post_training_quantization/torch/**/*'
- 'nncf/torch/**/*'
- 'tests/torch/**/*'

NNCF TF:
- 'examples/tensorflow/**/*'
- 'examples/post_training_quantization/tensorflow/**/*'
- 'nncf/tensorflow/**/*'
- 'tests/tensorflow/**/*'

NNCF ONNX:
- 'examples/onnx/**/*'
- 'nncf/onxx/**/*'
- 'examples/post_training_quantization/onnx/**/*'
- 'nncf/onnx/**/*'
- 'tests/onnx/**/*'

NNCF OpenVINO:
- 'examples/openvino/**/*'
- 'examples/post_training_quantization/openvino/**/*'
- 'nncf/openvino/**/*'
- 'tests/openvino/**/*'

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/api_changes_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: API changes check
on:
pull_request_target:
branches:
- develop

env:
API_DOC_HTML_ROOT_RELATIVE_PATH: autoapi

concurrency:
group: ci-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
call-build-api-doc:
uses: ./.github/workflows/build_html_doc.yml
with:
ref: "refs/pull/${{ github.event.number }}/merge"
compare-api-doc-with-develop:
needs: call-build-api-doc
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Download built HTML doc as artifact from previous step
uses: alehechka/download-tartifact@v2
with:
name: html_doc_artifact
- name: Checkout latest doc_pages branch tip
uses: actions/checkout@v3
with:
ref: doc_pages
path: previous_doc_state
- name: Get changed file names in API doc path
id: diff
run: |
cd html_build/html/$API_DOC_HTML_ROOT_RELATIVE_PATH
CHANGED_FILES=$(find . -name "*.html" -exec diff -qrBZ {} $GITHUB_WORKSPACE/previous_doc_state/$API_DOC_HTML_ROOT_RELATIVE_PATH/{} \;)
echo ${CHANGED_FILES}
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') }}
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@v6
if: ${{ contains(steps.diff.outputs.changed_files, 'differ') }}
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"]
})
43 changes: 43 additions & 0 deletions .github/workflows/build_and_publish_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build complete docs and publish to GH Pages
on:
push:
branches:
- develop

env:
GH_PAGES_BRANCH: doc_pages

concurrency:
group: ci-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: write
jobs:
call-build-html-doc:
uses: ./.github/workflows/build_html_doc.yml
with:
ref: ${{ github.ref }}
call-build-schema-page:
uses: ./.github/workflows/build_schema_page.yml
publish:
needs: [call-build-html-doc, call-build-schema-page]
runs-on: ubuntu-latest
steps:
- name: Checkout main repo # the github-pages-deploy-action seems to require this step
uses: actions/checkout@v3
- name: Download HTML doc build artifact
uses: alehechka/download-tartifact@v2
with:
name: html_doc_artifact
- name: Download schema doc build artifact
uses: alehechka/download-tartifact@v2
with:
name: schema_doc_artifact
path: html_build/html
- name: Publish built docs on Github Pages branch ${{ env.GH_PAGES_BRANCH }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: html_build/html
token: ${{ secrets.PUSH_TO_GH_PAGES_BRANCH }}
branch: ${{ env.GH_PAGES_BRANCH }}
27 changes: 27 additions & 0 deletions .github/workflows/build_html_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: HTML documentation build
on:
workflow_call:
inputs:
ref:
required: true
type: string
jobs:
build-html:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Install NNCF and doc requirements
run: |
pip install -e .
pip install -r docs/api/requirements.txt
- name: Build API docs
run: |
sphinx-build -M html docs/api/source html_build
- name: Upload built HTMLs as job artifact
uses: alehechka/upload-tartifact@v2
with:
name: html_doc_artifact
path: html_build/html
28 changes: 10 additions & 18 deletions .github/workflows/build_schema_page.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
name: Config schema HTML build
on:
push:
branches:
- develop
- test_for_doc_build_trigger
paths:
- nncf/config/**
permissions:
contents: write
workflow_call:
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
build-config-schema-html:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
- name: Install and Build
run: |
pip install json-schema-for-humans
pip install -e .
python -c 'import jstyleson; from nncf.config import NNCFConfig; jstyleson.dump(NNCFConfig.schema(), open("./schema.json", "w"), indent=2)'
mkdir schema_html_build
generate-schema-doc --deprecated-from-description schema.json schema_html_build/index.html
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
mkdir schema
generate-schema-doc --deprecated-from-description schema.json schema/index.html
- name: Upload result as artifact
uses: alehechka/upload-tartifact@v2
with:
folder: schema_html_build # The folder the action should deploy.
token: ${{ secrets.PUSH_TO_GH_PAGES_BRANCH }}
branch: doc_pages
name: schema_doc_artifact
path: schema
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Pull Request Labeler"
on: [pull_request_target]

jobs:
triage:
set-label:
permissions:
contents: read
pull-requests: write
Expand All @@ -11,5 +11,5 @@ jobs:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: '.github/labeler.yml'
configuration-path: '.github/action_configs/labeler.yml'
sync-labels: true
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2023 Intel Corporation
# Copyright (c) 2023 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
Expand All @@ -13,7 +13,7 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
name: Publish release Python package to PyPI

on:
release:
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,21 @@ ENV/
# snapshots
*.tar

# object detection eval results
examples/torch/object_detection/eval/

# VSCode
.vscode/

# NNCF debug
nncf_debug/

# NNCF examples
examples/torch/object_detection/eval/
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/**/runs/**
examples/**/results/**

# Tests
tests/**/runs/**
open_model_zoo/
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ pylint-onnx
## Binary files
Please refrain from adding huge binary files into the repository. If binary files have to be added, mark these to use Git LFS via the [.gitattributes](./.gitattributes) file.

## Model identifiers
When adding model configs and checkpoints to be showcased in NNCF's sample script, follow the format for naming these files:
1. The base name must be the same for the NNCF config file, AC config file, checkpoint file (PT/ONNX/OV) or checkpoint folder (TF), and other associated artifacts.
2. This name should be composed with the following format: `{model_name}_{dataset_name}` for FP32 models, `{topology_name}_{dataset_name}_{compression_algorithms_applied}`. The format may be extended if there are multiple models with the same topology, dataset and compression algos applied, which only differ in something else such as exact value of achieved sparsity. Align the naming of the new checkpoints with the existing ones.
3. Additional human-readable information on the model such as expected metrics and compression algorithm specifics (e.g. level of pruning/sparsity, per-tensor/per-channel quantizer configuration etc.) should be stored in a registry file (`tests/torch/sota_checkpoints_eval.json` for PT, `tests/tensorflow/sota_checkpoints_eval.json` for TF)
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install-onnx-dev: install-onnx-test
pip install pylint==$(PYLINT_VERSION)

test-onnx:
pytest tests/onnx --junitxml ${JUNITXML_PATH}
pytest tests/onnx $(DATA_ARG) --junitxml ${JUNITXML_PATH}

ONNX_PYFILES := $(shell find examples/post_training_quantization/onnx -type f -name "*.py")
pylint-onnx:
Expand All @@ -43,16 +43,18 @@ install-openvino-test:
pip install -r tests/cross_fw/install/requirements.txt
pip install -r examples/experimental/openvino/bert/requirements.txt
pip install -r examples/experimental/openvino/yolo_v5/requirements.txt
pip install git+https://github.com/openvinotoolkit/open_model_zoo.git@dcbf53280a95dae3c6538689bafe760470f08ec2#subdirectory=tools/model_tools

install-openvino-dev: install-openvino-test
pip install pylint==$(PYLINT_VERSION)

test-openvino:
pytest tests/openvino --junitxml ${JUNITXML_PATH}
pytest tests/openvino $(DATA_ARG) --junitxml ${JUNITXML_PATH}

pylint-openvino:
pylint --rcfile .pylintrc \
nncf/openvino/ \
nncf/experimental/openvino/ \
tests/openvino/ \
examples/experimental/openvino/

Expand Down
Loading

0 comments on commit f4b73bf

Please sign in to comment.