Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .azure-pipelines/code-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ pr:
drafts: false
branches:
include:
- master
- master
paths:
include:
- neural_compressor

pool: ICX-16C

Expand Down Expand Up @@ -37,18 +40,6 @@ stages:
codeScanFileName: "pylint"
uploadPath: "lpot-pylint.json"

- stage: PyspellingCodeScan
displayName: Pyspelling Code Scan
dependsOn: []
jobs:
- job: Pyspelling
displayName: Pyspelling
steps:
- template: template/code-scan-template.yml
parameters:
codeScanFileName: "pyspelling"
uploadPath: "lpot_pyspelling.log"

- stage: CopyRight
displayName: CopyRight Code Scan
dependsOn: []
Expand Down
8 changes: 8 additions & 0 deletions .azure-pipelines/scripts/codeScan/pyspelling/lpot_dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2366,3 +2366,11 @@ christmas
dicoo
snowly
syncedreview
ww
EmbedLayerNormalization
FusedConv
GlobalAveragePool
LeakyRelu
ONNXRTAdaptor
QLinearOpsAdaptor
onnxrtadaptor
20 changes: 9 additions & 11 deletions .azure-pipelines/scripts/codeScan/pyspelling/pyspelling.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
#!/bin/bash

source /neural-compressor/.azure-pipelines/scripts/change_color.sh
RESET="echo -en \\E[0m \\n" # close color

mkdir -p /neural-compressor/.azure-pipelines/scripts/codeScan/scanLog
pyspelling_dir="/neural-compressor/.azure-pipelines/scripts/codeScan"
pyspelling_log_dir="/neural-compressor/.azure-pipelines/scripts/codeScan/scanLog"
work_dir="/neural-compressor/.azure-pipelines/scripts/codeScan/pyspelling"
log_dir="$work_dir/../scanLog"
mkdir -p $log_dir

pip install -r /neural-compressor/requirements.txt

sed -i "s|\${VAL_REPO}|$pyspelling_dir|g" $pyspelling_dir/pyspelling/pyspelling_conf.yaml
sed -i "s|\${LPOT_REPO}|/neural-compressor|g" $pyspelling_dir/pyspelling/pyspelling_conf.yaml
sed -i "s|\${DICT_DIR}|$work_dir|g" $work_dir/pyspelling_conf.yaml
sed -i "s|\${REPO_DIR}|/neural-compressor|g" $work_dir/pyspelling_conf.yaml

pyspelling -c $pyspelling_dir/pyspelling/pyspelling_conf.yaml > $pyspelling_log_dir/lpot_pyspelling.log
pyspelling -c $work_dir/pyspelling_conf.yaml > $log_dir/pyspelling.log
exit_code=$?

# code-scan close
RESET="echo -en \\E[0m \\n"

$BOLD_YELLOW && echo "------------------- Current log file output start --------------------------" && $RESET
cat $pyspelling_log_dir/lpot_pyspelling.log
cat $log_dir/pyspelling.log
$BOLD_YELLOW && echo "------------------- Current log file output end ----------------------------" && $RESET


if [ ${exit_code} -ne 0 ] ; then
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and view Pyspelling error details." && $RESET; exit 1
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and view pyspelling error details." && $RESET; exit 1
fi
$BOLD_PURPLE && echo "Congratulations, Pyspelling check passed!" && $LIGHT_PURPLE && echo "You can click on the artifact button to see the log details." && $RESET; exit 0

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ matrix:
d: en_US.ISO8859-15
dictionary:
wordlists:
- ${VAL_REPO}/pyspelling/lpot_dict.txt
output: ${VAL_REPO}/pyspelling/lpot_dict.dic
- ${DICT_DIR}/lpot_dict.txt
output: ${DICT_DIR}/lpot_dict.dic
sources:
- ${LPOT_REPO}/neural_coder/**/*.md
- ${LPOT_REPO}/neural_coder/*.md
- ${REPO_DIR}/docs/*
- ${REPO_DIR}/*.md
- ${REPO_DIR}/examples/**/*.md|!${REPO_DIR}/examples/pytorch/**/huggingface_models/**/*.md
- ${REPO_DIR}/neural_compressor/**/*.md
- ${REPO_DIR}/neural_coder/**/*.md
- ${REPO_DIR}/neural_coder/*.md
26 changes: 26 additions & 0 deletions .azure-pipelines/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
trigger: none

pr:
autoCancel: true
drafts: false
branches:
include:
- master

pool: ICX-16C

variables:
CODE_SCAN_LOG_PATH: ".azure-pipelines/scripts/codeScan/scanLog"

stages:
- stage: PyspellingCodeScan
displayName: Pyspelling Code Scan
dependsOn: []
jobs:
- job: Pyspelling
displayName: Pyspelling
steps:
- template: template/code-scan-template.yml
parameters:
codeScanFileName: "pyspelling"
uploadPath: "pyspelling.log"
2 changes: 1 addition & 1 deletion docs/adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AbcAdaptor(Adaptor):
```

* `quantize` function is used to perform quantization for post-training quantization and quantization-aware training. Quantization processing includes calibration and conversion processing for post-training quantization, while for quantization-aware training, it includes training and conversion processing.
* `evaluate` function is used to run an evaluation on a validation dataset. It is a built-in function, if user wants to use specifical evaluation function, he can pass the evaluation function to quantizer.
* `evaluate` function is used to run an evaluation on a validation dataset. It is a built-in function, if user wants to use specific evaluation function, he can pass the evaluation function to quantizer.
* `query_fw_capability` function is used to run a query framework quantization capability and intersects with the user yaml configuration.
* `query_fused_patterns` function is used to run a query framework graph fusion capability and decide the fusion tuning space.

Expand Down