162 lines
4.5 KiB
YAML
162 lines
4.5 KiB
YAML
ci:
|
|
autofix_prs: true
|
|
autoupdate_schedule: quarterly
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v5.0.0
|
|
hooks:
|
|
- id: end-of-file-fixer
|
|
files: (.*\.(py|md|rst|yaml|yml))$
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/algorithms/fp8_quant/.+
|
|
)$
|
|
- id: check-json
|
|
exclude: |
|
|
(?x)^(
|
|
.vscode/settings_recommended.json
|
|
)$
|
|
- id: check-yaml
|
|
exclude: |
|
|
(?x)^(
|
|
conda_meta/|
|
|
neural_compressor/template/pruning.yaml|
|
|
neural_compressor/adaptor/tensorflow_itex.yaml|
|
|
neural_compressor/adaptor/tensorflow.yaml
|
|
)$
|
|
- id: debug-statements
|
|
- id: file-contents-sorter
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+
|
|
)$
|
|
args: [--unique]
|
|
- id: requirements-txt-fixer
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+
|
|
)$
|
|
- id: trailing-whitespace
|
|
files: (.*\.(py|rst|cmake|yaml|yml))$
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
neural_compressor/torch/utils/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/quantization/.+
|
|
)$
|
|
|
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
|
rev: v1.5.5
|
|
hooks:
|
|
- id: insert-license
|
|
files: |
|
|
(?x)^(
|
|
neural_compressor/.*(py|yaml|yml|sh)
|
|
)$
|
|
args:
|
|
[
|
|
--license-filepath=.github/license_template.txt,
|
|
--use-current-year,
|
|
--detect-license-in-X-top-lines=40,
|
|
--skip-license-insertion-comment=Copyright,
|
|
]
|
|
|
|
- repo: https://github.com/asottile/yesqa
|
|
rev: v1.5.0
|
|
hooks:
|
|
- id: yesqa
|
|
name: Unused noqa
|
|
|
|
- repo: https://github.com/pycqa/isort
|
|
rev: 5.13.2
|
|
hooks:
|
|
- id: isort
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|
|
|
|
- repo: https://github.com/PyCQA/docformatter
|
|
rev: 06907d0
|
|
hooks:
|
|
- id: docformatter
|
|
args: [
|
|
--in-place,
|
|
--wrap-summaries=0, # 0 means disable wrap
|
|
--wrap-descriptions=0, # 0 means disable wrap
|
|
--black,
|
|
--style=google,
|
|
]
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|
|
|
|
- repo: https://github.com/psf/black.git
|
|
rev: 24.10.0
|
|
hooks:
|
|
- id: black
|
|
files: (.*\.py)$
|
|
exclude: |
|
|
(?x)^(
|
|
neural_compressor/conf/config.py|
|
|
neural_compressor/conf/pythonic_config.py|
|
|
examples/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|
|
|
|
- repo: https://github.com/asottile/blacken-docs
|
|
rev: 1.19.1
|
|
hooks:
|
|
- id: blacken-docs
|
|
args: [--line-length=120, --skip-errors]
|
|
additional_dependencies:
|
|
- black==24.10.0
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
docs/source-app|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
rev: v2.3.0
|
|
hooks:
|
|
- id: codespell
|
|
args: [-w]
|
|
additional_dependencies:
|
|
- tomli
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.*(txt|patch)|
|
|
examples/onnxrt/nlp/huggingface_model/text_generation/llama/quantization/ptq_static/prompt.json|
|
|
examples/notebook/dynas/ResNet50_Quantiation_Search_Supernet_NAS.ipynb|
|
|
examples/notebook/dynas/Transformer_LT_Supernet_NAS.ipynb|
|
|
neural_compressor/torch/algorithms/fp8_quant/internal/diffusion_evaluation/SR_evaluation/imagenet1000_clsidx_to_labels.txt|
|
|
neural_compressor/evaluation/hf_eval/datasets/cnn_validation.json|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.8.6
|
|
hooks:
|
|
- id: ruff
|
|
args: [--fix, --exit-non-zero-on-fix, --no-cache]
|
|
exclude: |
|
|
(?x)^(
|
|
examples/.+|
|
|
neural_compressor/torch/algorithms/fp8_quant/.+|
|
|
test/3x/torch/.+
|
|
)$
|