Skip to content

Commit 53b9930

Browse files
committed
merge master
Signed-off-by: zehao-intel <zehao.huang@intel.com>
2 parents ae6651a + c8e4f40 commit 53b9930

File tree

945 files changed

+4926
-147415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

945 files changed

+4926
-147415
lines changed

.azure-pipelines/code-scan-neural-insights.yaml

-59
This file was deleted.

.azure-pipelines/code-scan-neural-solution.yaml

-59
This file was deleted.

.azure-pipelines/docker/Dockerfile.devel

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
3636

3737
RUN ln -sf $(which python3) /usr/bin/python
3838

39-
RUN python -m pip --no-cache-dir install --upgrade pip
39+
RUN python -m pip install pip==24.0
4040
RUN python -m pip install --no-cache-dir setuptools
4141

4242
RUN pip list

.azure-pipelines/model-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ parameters:
5757
- name: PyTorchModelList
5858
type: object
5959
default:
60-
- resnet18
60+
# - resnet18
6161
- resnet18_fx
6262
- name: ONNXModelList
6363
type: object

.azure-pipelines/scripts/codeScan/pydocstyle/pydocstyle.sh

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ log_dir="$work_dir/../scanLog"
1717
mkdir -p $log_dir
1818

1919
scan_path="scan_path.txt"
20-
if [ "${scan_module}" = "neural_solution" ]; then
21-
scan_path="scan_path_neural_solution.txt"
22-
elif [ "${scan_module}" = "neural_insights" ]; then
23-
scan_path="scan_path_neural_insights.txt"
24-
fi
2520

2621
exit_code=0
2722
for line in $(cat ${work_dir}/${scan_path})

.azure-pipelines/scripts/codeScan/pydocstyle/scan_path_neural_insights.txt

-4
This file was deleted.

.azure-pipelines/scripts/codeScan/pydocstyle/scan_path_neural_solution.txt

-4
This file was deleted.

.azure-pipelines/scripts/codeScan/pylint/pylint.sh

+1-16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ apt-get install -y --no-install-recommends --fix-missing \
2020
build-essential
2121

2222
pip install -r /neural-compressor/requirements.txt
23+
pip install -r /neural-compressor/requirements_pt.txt
2324
pip install cmake
2425

2526
pip install torch \
@@ -44,22 +45,6 @@ pip install torch \
4445
pydantic \
4546
protobuf
4647

47-
if [ "${scan_module}" = "neural_solution" ]; then
48-
cd /neural-compressor
49-
python setup.py install
50-
51-
echo "Install Neural Solution ... "
52-
bash /neural-compressor/.azure-pipelines/scripts/install_neural_solution.sh
53-
54-
elif [ "${scan_module}" = "neural_insights" ]; then
55-
cd /neural-compressor
56-
python setup.py install
57-
58-
echo "Install Neural Insights ... "
59-
bash /neural-compressor/.azure-pipelines/scripts/install_neural_insights.sh
60-
61-
fi
62-
6348
echo "[DEBUG] list pipdeptree..."
6449
pip install pipdeptree
6550
pipdeptree

.azure-pipelines/scripts/install_nc.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22

33
echo -e "\n Install Neural Compressor ... "
44
cd /neural-compressor
5-
if [[ $1 = *"3x_pt" ]]; then
5+
if [[ $1 = *"3x_pt"* ]]; then
66
python -m pip install --no-cache-dir -r requirements_pt.txt
77
python setup.py pt bdist_wheel
8-
pip install dist/neural_compressor*.whl --force-reinstall
8+
pip install --no-deps dist/neural_compressor*.whl --force-reinstall
99
elif [[ $1 = *"3x_tf"* ]]; then
1010
python -m pip install --no-cache-dir -r requirements_tf.txt
1111
python setup.py tf bdist_wheel
1212
pip install dist/neural_compressor*.whl --force-reinstall
13-
elif [[ $1 = *"3x_ort" ]]; then
14-
python -m pip install --no-cache-dir -r requirements_ort.txt
15-
python setup.py ort bdist_wheel
16-
pip install dist/neural_compressor*.whl --force-reinstall
1713
else
1814
python -m pip install --no-cache-dir -r requirements.txt
19-
python setup.py 2x bdist_wheel
15+
python setup.py bdist_wheel
2016
pip install dist/neural_compressor*.whl --force-reinstall
2117
fi
2218

.azure-pipelines/scripts/install_neural_insights.sh

-8
This file was deleted.

.azure-pipelines/scripts/install_neural_solution.sh

-27
This file was deleted.

.azure-pipelines/scripts/ut/3x/collect_log_3x.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ git config --global --add safe.directory /neural-compressor
2525
git fetch
2626
git checkout master
2727
rm -rf build dist *egg-info
28-
echo y | pip uninstall neural_compressor_${1}
28+
binary_index="${1%_fp8}"
29+
echo y | pip uninstall neural_compressor_${binary_index}
2930
cd /neural-compressor/.azure-pipelines-pr/scripts && bash install_nc.sh ${1}
3031

3132
coverage erase

.azure-pipelines/scripts/ut/3x/coverage.3x_ort .azure-pipelines/scripts/ut/3x/coverage.3x_pt_fp8

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ branch = True
33

44
[report]
55
include =
6-
*/neural_compressor/common/*
7-
*/neural_compressor/onnxrt/*
6+
*/neural_compressor/torch/algorithms/habana_fp8/*
7+
*/neural_compressor/torch/amp/*
88
exclude_lines =
99
pragma: no cover
1010
raise NotImplementedError

.azure-pipelines/scripts/ut/3x/run_3x_pt.sh

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ inc_path=$(python -c 'import neural_compressor; print(neural_compressor.__path__
1515
cd /neural-compressor/test/3x || exit 1
1616
rm -rf tensorflow
1717
rm -rf onnxrt
18+
rm -rf torch/algorithms/fp8_quant
1819

1920
LOG_DIR=/neural-compressor/log_dir
2021
mkdir -p ${LOG_DIR}

.azure-pipelines/scripts/ut/3x/run_3x_ort.sh .azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#!/bin/bash
22
python -c "import neural_compressor as nc"
3-
test_case="run 3x ONNXRT"
3+
test_case="run 3x Torch Habana FP8"
44
echo "${test_case}"
55

66
# install requirements
77
echo "set up UT env..."
8-
pip install -r /neural-compressor/test/3x/onnxrt/requirements.txt
8+
sed -i '/^intel_extension_for_pytorch/d' /neural-compressor/test/3x/torch/requirements.txt
9+
pip install -r /neural-compressor/test/3x/torch/requirements.txt
10+
pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.16.0
911
pip install pytest-cov
1012
pip install pytest-html
1113
pip list
1214

13-
export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_ort
15+
export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_pt_fp8
1416
inc_path=$(python -c 'import neural_compressor; print(neural_compressor.__path__[0])')
1517
cd /neural-compressor/test/3x || exit 1
16-
rm -rf torch
17-
rm -rf tensorflow
1818

1919
LOG_DIR=/neural-compressor/log_dir
2020
mkdir -p ${LOG_DIR}
21-
ut_log_name=${LOG_DIR}/ut_3x_ort.log
22-
pytest --cov="${inc_path}" -vs --disable-warnings --html=report.html --self-contained-html . 2>&1 | tee -a ${ut_log_name}
21+
ut_log_name=${LOG_DIR}/ut_3x_pt_fp8.log
22+
pytest --cov="${inc_path}" -vs --disable-warnings --html=report.html --self-contained-html torch/algorithms/fp8_quant 2>&1 | tee -a ${ut_log_name}
2323

2424
cp report.html ${LOG_DIR}/
2525

.azure-pipelines/scripts/ut/env_setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ elif [[ $(echo "${test_case}" | grep -c "tf pruning") != 0 ]]; then
9292
fi
9393

9494
if [[ $(echo "${test_case}" | grep -c "api") != 0 ]] || [[ $(echo "${test_case}" | grep -c "adaptor") != 0 ]]; then
95-
pip install auto-round
95+
pip install git+https://github.com/intel/auto-round.git@24b2e74070f2b4e6f26ff069ec75af74cf5b177c
9696
fi
9797

9898
# test deps

.azure-pipelines/scripts/ut/run_basic_others.sh

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ cd /neural-compressor/test || exit 1
1414
find . -name "test*.py" | sed 's,\.\/,coverage run --source='"${lpot_path}"' --append ,g' | sed 's/$/ --verbose/'> run.sh
1515
sed -i '/ adaptor\//d' run.sh
1616
sed -i '/ tfnewapi\//d' run.sh
17-
sed -i '/ neural_coder\//d' run.sh
1817
sed -i '/ itex\//d' run.sh
1918
sed -i '/ pruning_with_pt/d' run.sh
2019
sed -i '/ pruning_with_tf/d' run.sh

.azure-pipelines/scripts/ut/run_itrex.sh

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ source /neural-compressor/.azure-pipelines/scripts/change_color.sh
44
python -c "import neural_compressor as nc;print(nc.version.__version__)"
55
echo "run itrex ut..."
66

7+
# install inc 3x deps
8+
pip install -r /neural-compressor/requirements_pt.txt
9+
710
# prepare itrex
811
git clone https://github.com/intel/intel-extension-for-transformers.git /intel-extension-for-transformers
912
cd /intel-extension-for-transformers && git rev-parse --short HEAD

.azure-pipelines/scripts/ut/run_ncoder.sh

-26
This file was deleted.

0 commit comments

Comments
 (0)