Skip to content

Commit 9389cf4

Browse files
Update CI version (#2324)
Signed-off-by: Sun, Xuehao <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a03e6d0 commit 9389cf4

24 files changed

+187
-401
lines changed

.azure-pipelines/docker/Dockerfile.devel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ 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+
ARG USER_ID=1000
40+
ARG GROUP_ID=1000
41+
42+
RUN groupadd -g ${GROUP_ID} hostgroup && \
43+
useradd -m -u ${USER_ID} -g ${GROUP_ID} hostuser
44+
45+
USER hostuser
46+
47+
ENV PATH="/home/hostuser/.local/bin:$PATH"
3948
RUN python -m pip install pip packaging --upgrade
4049
RUN python -m pip install --no-cache-dir setuptools
4150

4251
RUN pip list
4352

4453
WORKDIR /
45-

.azure-pipelines/docker/DockerfileCodeScan.devel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
3030

3131
RUN ln -sf $(which python3) /usr/bin/python
3232

33+
ARG USER_ID=1000
34+
ARG GROUP_ID=1000
35+
3336
RUN python -m pip install --no-cache-dir \
3437
bandit\
35-
pyspelling\
3638
pydocstyle
3739

3840
WORKDIR /
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#
2+
# Copyright (c) 2025 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
ARG UBUNTU_VER=24.04
16+
FROM ubuntu:${UBUNTU_VER}
17+
18+
# See http://bugs.python.org/issue19846
19+
ENV LANG C.UTF-8
20+
21+
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
22+
python3 \
23+
python3-pip \
24+
python3.12-dev \
25+
autoconf \
26+
build-essential \
27+
cmake \
28+
git \
29+
libomp-dev \
30+
numactl \
31+
time \
32+
wget \
33+
bc \
34+
jq \
35+
vim
36+
37+
RUN ln -sf $(which python3) /usr/bin/python
38+
39+
ARG USER_ID=1000
40+
ARG GROUP_ID=1000
41+
42+
RUN groupadd -g ${GROUP_ID} hostgroup && \
43+
useradd -m -u ${USER_ID} -g ${GROUP_ID} hostuser
44+
45+
USER hostuser
46+
47+
ENV PATH="/home/hostuser/.local/bin:$PATH"
48+
RUN pip config set global.break-system-packages true
49+
RUN pip install pip packaging --upgrade
50+
RUN pip install --no-cache-dir setuptools
51+
RUN pip list
52+
53+
WORKDIR /

.azure-pipelines/scripts/install_nc.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
echo -e "##[group]Install Neural Compressor ... "
44
cd /neural-compressor
5-
pip install cmake==3.31.6
65
if [[ $1 = *"3x_pt"* ]]; then
76
python -m pip install --no-cache-dir -r requirements_pt.txt
87
if [[ $1 = *"3x_pt_fp8"* ]]; then
98
pip uninstall neural_compressor_3x_pt -y || true
109
python setup.py pt bdist_wheel
1110
else
1211
echo -e "\n Install torch CPU ... "
13-
pip install torch==2.7.1 torchvision --index-url https://download.pytorch.org/whl/cpu
14-
python -m pip install intel-extension-for-pytorch==2.7.0 oneccl_bind_pt --index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
12+
pip install torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu
13+
python -m pip install intel-extension-for-pytorch==2.8.0 oneccl_bind_pt --index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
1514
python -m pip install --no-cache-dir -r requirements.txt
1615
python setup.py bdist_wheel
1716
fi

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

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,7 @@ done
4949

5050
SCRIPTS_PATH="/neural-compressor/.azure-pipelines/scripts/models"
5151
log_dir="/neural-compressor/.azure-pipelines/scripts/models"
52-
if [[ "${inc_new_api}" == "3x"* ]]; then
53-
pip install cmake==3.31.6
54-
WORK_SOURCE_DIR="/neural-compressor/examples/${framework}"
55-
# git clone https://github.com/intel/intel-extension-for-transformers.git /itrex
56-
# cd /itrex
57-
# pip install -r requirements.txt
58-
# pip install -v .
59-
else
60-
WORK_SOURCE_DIR="/neural-compressor/examples/deprecated/${framework}"
61-
fi
52+
WORK_SOURCE_DIR="/neural-compressor/examples/${framework}"
6253

6354
$BOLD_YELLOW && echo "processing ${framework}-${fwk_ver}-${model}" && $RESET
6455

@@ -72,34 +63,16 @@ else
7263
fi
7364

7465
$BOLD_YELLOW && echo "====== install requirements ======" && $RESET
75-
/bin/bash /neural-compressor/.azure-pipelines/scripts/install_nc.sh ${inc_new_api}
76-
77-
mkdir -p ${WORK_SOURCE_DIR}
78-
cd ${WORK_SOURCE_DIR}
79-
if [[ "${inc_new_api}" == "false" ]]; then
80-
echo "copy old api examples to workspace..."
81-
git clone -b old_api_examples https://github.com/intel/neural-compressor.git old-lpot-models
82-
cd old-lpot-models
83-
git branch
84-
cd -
85-
rm -rf ${model_src_dir}
86-
mkdir -p ${model_src_dir}
87-
cp -r old-lpot-models/examples/${framework}/${model_src_dir} ${WORK_SOURCE_DIR}/${model_src_dir}/../
88-
fi
66+
cd /neural-compressor
67+
bash /neural-compressor/.azure-pipelines/scripts/install_nc.sh ${inc_new_api}
8968

90-
cd ${model_src_dir}
69+
cd ${WORK_SOURCE_DIR}/${model_src_dir}
9170

9271
if [[ "${fwk_ver}" != "latest" ]]; then
9372
pip install ruamel.yaml==0.17.40
9473
pip install psutil
9574
pip install protobuf==4.23.4
96-
if [[ "${framework}" == "tensorflow" ]]; then
97-
if [[ "${fwk_ver}" == *"-official" ]]; then
98-
pip install tensorflow==${fwk_ver%-official}
99-
else
100-
pip install intel-tensorflow==${fwk_ver}
101-
fi
102-
elif [[ "${framework}" == "pytorch" ]]; then
75+
if [[ "${framework}" == "pytorch" ]]; then
10376
pip install torch==${fwk_ver} --index-url https://download.pytorch.org/whl/cpu
10477
pip install torchvision==${torch_vision_ver} --index-url https://download.pytorch.org/whl/cpu
10578
elif [[ "${framework}" == "onnxrt" ]]; then
@@ -113,10 +86,6 @@ if [ -f "requirements.txt" ]; then
11386
if [ "${framework}" == "onnxrt" ]; then
11487
sed -i '/^onnx>=/d;/^onnx==/d;/^onnxruntime>=/d;/^onnxruntime==/d' requirements.txt
11588
fi
116-
if [ "${framework}" == "tensorflow" ]; then
117-
sed -i '/tensorflow==/d;/tensorflow$/d' requirements.txt
118-
sed -i '/^intel-tensorflow/d' requirements.txt
119-
fi
12089
if [ "${framework}" == "pytorch" ]; then
12190
sed -i '/torch==/d;/torch$/d;/torchvision==/d;/torchvision$/d' requirements.txt
12291
fi
@@ -130,19 +99,3 @@ if [ -f "requirements.txt" ]; then
13099
else
131100
$BOLD_RED && echo "Not found requirements.txt file." && $RESET
132101
fi
133-
134-
if [[ "${inc_new_api}" == "false" ]]; then
135-
$BOLD_YELLOW && echo "======== update yaml config ========" && $RESET
136-
$BOLD_YELLOW && echo -e "\nPrint origin yaml..." && $RESET
137-
cat ${yaml}
138-
python ${SCRIPTS_PATH}/update_yaml_config.py \
139-
--yaml=${yaml} \
140-
--framework=${framework} \
141-
--dataset_location=${dataset_location} \
142-
--batch_size=${batch_size} \
143-
--strategy=${strategy} \
144-
--new_benchmark=${new_benchmark} \
145-
--multi_instance='true'
146-
$BOLD_YELLOW && echo -e "\nPrint updated yaml... " && $RESET
147-
cat ${yaml}
148-
fi

.azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,14 @@ new_benchmark=true
3030
inc_new_api=true
3131
benchmark_cmd=""
3232
# ======== set up config for pytorch models ========
33-
if [ "${model}" == "resnet18" ]; then
34-
model_src_dir="image_recognition/torchvision_models/quantization/ptq/cpu/eager"
35-
dataset_location="/tf_dataset2/datasets/mini-imageraw"
36-
input_model=""
37-
yaml="conf.yaml"
38-
strategy="bayesian"
39-
batch_size=1
40-
new_benchmark=false
41-
inc_new_api=false
42-
tuning_cmd="bash run_tuning.sh --topology=resnet18 --dataset_location=${dataset_location} --input_model=${input_model}"
43-
benchmark_cmd="bash run_benchmark.sh --topology=resnet18 --dataset_location=${dataset_location} --mode=benchmark --batch_size=${batch_size} --iters=500"
44-
elif [ "${model}" == "resnet18_fx" ]; then
45-
model_src_dir="image_recognition/torchvision_models/quantization/ptq/cpu/fx/"
46-
dataset_location="/tf_dataset2/datasets/mini-imageraw"
47-
input_model="resnet18"
48-
yaml=""
49-
strategy="basic"
50-
batch_size=1
51-
new_benchmark=true
52-
inc_new_api=true
53-
tuning_cmd="bash run_quant.sh --topology=resnet18 --dataset_location=${dataset_location} --input_model=${input_model}"
54-
benchmark_cmd="bash run_benchmark.sh --topology=resnet18 --dataset_location=${dataset_location} --mode=performance --batch_size=${batch_size} --iters=500"
55-
elif [ "${model}" == "opt_125m_woq_gptq_int4" ]; then
33+
if [ "${model}" == "opt_125m_woq_gptq_int4" ]; then
5634
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
5735
inc_new_api=3x_pt
5836
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_int4"
5937
elif [ "${model}" == "opt_125m_woq_gptq_nf4_dq_bnb" ]; then
6038
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
6139
inc_new_api=3x_pt
6240
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_nf4_dq_bnb"
63-
elif [ "${model}" == "opt_125m_woq_gptq_int4_dq_ggml" ]; then
64-
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
65-
inc_new_api=3x_pt
66-
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_int4_dq_ggml"
6741
fi
6842

6943
echo "Specify FWs version..."
@@ -72,7 +46,7 @@ FRAMEWORK="pytorch"
7246
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
7347
if [[ "${inc_new_api}" == "3x"* ]]; then
7448
FRAMEWORK_VERSION="latest"
75-
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
49+
export LD_LIBRARY_PATH=${HOME}/.local/lib/:$LD_LIBRARY_PATH
7650
else
7751
FRAMEWORK_VERSION=${pytorch_version}
7852
TORCH_VISION_VERSION=${torchvision_version}

0 commit comments

Comments
 (0)