Skip to content

Commit

Permalink
Update CI framework versions and README badge for release 3.1.1 (#2058)
Browse files Browse the repository at this point in the history
Signed-off-by: Sun, Xuehao <[email protected]>
  • Loading branch information
XuehaoSun authored Nov 26, 2024
1 parent 64c2f34 commit 2b4c824
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/scripts/fwk_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export tensorflow_version='2.15.0-official'
export pytorch_version='2.5.1+cpu'
export torchvision_version='0.20.1'
export ipex_version='2.5.0+cpu'
export onnx_version='1.16.0'
export onnxruntime_version='1.18.0'
export onnx_version='1.17.0'
export onnxruntime_version='1.20.0'
export mxnet_version='1.9.1'
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/install_nc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

echo -e "\n Install Neural Compressor ... "
echo -e "##[group]Install Neural Compressor ... "
cd /neural-compressor
if [[ $1 = *"3x_pt"* ]]; then
python -m pip install --no-cache-dir -r requirements_pt.txt
Expand All @@ -27,4 +27,5 @@ else
fi

echo -e "\n pip list after install Neural Compressor ... "
echo "##[endgroup]"
pip list
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/ut/3x/run_3x_pt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ test_case="run 3x Torch"
echo "${test_case}"

# install requirements
echo "set up UT env..."
echo "##[group]set up UT env..."
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
pip install -r /neural-compressor/test/3x/torch/requirements.txt
pip install pytest-cov
pip install pytest-html
echo "##[endgroup]"
pip list

export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_pt
Expand Down
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_case="run 3x Torch Habana FP8"
echo "${test_case}"

# install requirements
echo "set up UT env..."
echo "##[group]set up UT env..."
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
sed -i '/^intel_extension_for_pytorch/d' /neural-compressor/test/3x/torch/requirements.txt
sed -i '/^auto_round/d' /neural-compressor/test/3x/torch/requirements.txt
Expand All @@ -13,6 +13,7 @@ pip install -r /neural-compressor/test/3x/torch/requirements.txt
pip install pytest-cov
pip install pytest-html
pip install pytest-html-merger
echo "##[endgroup]"
pip list

export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_pt_fp8
Expand Down
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/ut/3x/run_3x_tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ test_case="run 3x TensorFlow"
echo "${test_case}"

# install requirements
echo "set up UT env..."
echo "##[group]set up UT env..."
pip install -r /neural-compressor/test/3x/tensorflow/requirements.txt
pip install pytest-cov
pip install pytest-html
pip install pytest-html-merger
echo "##[endgroup]"
pip list

export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_tf
Expand Down
6 changes: 4 additions & 2 deletions .azure-pipelines/scripts/ut/collect_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ coverage_log_base="/neural-compressor/log_dir/coverage_log_base"
coverage_compare="/neural-compressor/log_dir/coverage_compare.html"
cd /neural-compressor/log_dir

$BOLD_YELLOW && echo "collect coverage for PR branch" && $RESET
$BOLD_YELLOW && echo "##[group]collect coverage for PR branch" && $RESET
mkdir -p coverage_PR
cp ut_*_coverage/.coverage.* ./coverage_PR/

Expand All @@ -28,8 +28,9 @@ git checkout master
rm -rf build dist *egg-info
echo y | pip uninstall neural-compressor
cd /neural-compressor/.azure-pipelines-pr/scripts && bash install_nc.sh
echo "##[endgroup]"

$BOLD_YELLOW && echo "collect coverage for baseline" && $RESET
$BOLD_YELLOW && echo "##[group]collect coverage for baseline" && $RESET
coverage erase
cd /neural-compressor/log_dir
mkdir -p coverage_base
Expand All @@ -43,6 +44,7 @@ coverage report -m --rcfile=${COVERAGE_RCFILE} | tee ${coverage_log_base}
coverage html -d log_dir/coverage_base/htmlcov --rcfile=${COVERAGE_RCFILE}
coverage xml -o log_dir/coverage_base/coverage.xml --rcfile=${COVERAGE_RCFILE}
ls -l log_dir/coverage_base/htmlcov
echo "##[endgroup]"

get_coverage_data() {
# Input argument
Expand Down
5 changes: 3 additions & 2 deletions .azure-pipelines/scripts/ut/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "onnxruntime version is $onnxruntime_version"
echo "mxnet version is $mxnet_version"

test_case=$1
echo "========= test case is ${test_case}"
echo -e "##[group]test case is ${test_case}"

if [[ "${tensorflow_version}" == *"-official" ]]; then
pip install tensorflow==${tensorflow_version%-official}
Expand Down Expand Up @@ -100,6 +100,8 @@ pip install coverage
pip install pytest
pip install pytest-html

echo "##[endgroup]"

pip list
echo "[DEBUG] list pipdeptree..."
pip install pipdeptree
Expand All @@ -112,4 +114,3 @@ if [[ $(echo "${test_case}" | grep -c "run basic api") != 0 ]] || [[ $(echo "${t
find . -name "test*.py" | xargs sed -i 's/import tensorflow.compat.v1 as tf/import torch; import tensorflow.compat.v1 as tf/g'
find . -name "test*.py" | xargs sed -i 's/from tensorflow import keras/import torch; from tensorflow import keras/g'
fi

1 change: 1 addition & 0 deletions .azure-pipelines/scripts/ut/run_basic_adaptor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh $1

echo "set up UT env..."
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/coverage.file
lpot_path=$(python -c 'import neural_compressor; import os; print(os.path.dirname(neural_compressor.__file__))')
cd /neural-compressor/test || exit 1
Expand Down
4 changes: 4 additions & 0 deletions .azure-pipelines/ut-3x-pt-fp8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ stages:
&& bash ut/3x/collect_log_3x.sh 3x_pt_fp8"
displayName: "Collect UT Coverage"
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: $(Build.SourcesDirectory)/log_dir/coverage_PR/coverage.xml

- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
inputs:
Expand Down
4 changes: 4 additions & 0 deletions .azure-pipelines/ut-3x-pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ stages:
&& bash ut/3x/collect_log_3x.sh 3x_pt"
displayName: "Collect UT Coverage"
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: $(Build.SourcesDirectory)/log_dir/coverage_PR/coverage.xml

- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
inputs:
Expand Down
4 changes: 4 additions & 0 deletions .azure-pipelines/ut-3x-tf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ stages:
&& bash ut/3x/collect_log_3x.sh 3x_tf"
displayName: "Collect UT Coverage"
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: $(Build.SourcesDirectory)/log_dir/coverage_PR/coverage.xml

- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
inputs:
Expand Down
4 changes: 4 additions & 0 deletions .azure-pipelines/ut-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ stages:
&& bash ut/collect_log.sh"
displayName: "Collect UT Coverage"
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: $(Build.SourcesDirectory)/log_dir/coverage_PR/coverage.xml

- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
inputs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Intel® Neural Compressor
<h3> An open-source Python library supporting popular model compression techniques on all mainstream deep learning frameworks (TensorFlow, PyTorch, and ONNX Runtime)</h3>

[![python](https://img.shields.io/badge/python-3.8%2B-blue)](https://github.com/intel/neural-compressor)
[![version](https://img.shields.io/badge/release-3.0-green)](https://github.com/intel/neural-compressor/releases)
[![version](https://img.shields.io/badge/release-3.1.1-green)](https://github.com/intel/neural-compressor/releases)
[![license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/intel/neural-compressor/blob/master/LICENSE)
[![coverage](https://img.shields.io/badge/coverage-85%25-green)](https://github.com/intel/neural-compressor)
[![Downloads](https://static.pepy.tech/personalized-badge/neural-compressor?period=total&units=international_system&left_color=grey&right_color=green&left_text=downloads)](https://pepy.tech/project/neural-compressor)
Expand Down

0 comments on commit 2b4c824

Please sign in to comment.