Skip to content
Open
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
10 changes: 9 additions & 1 deletion .azure-pipelines/docker/Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \

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

ARG USER_ID=1000
ARG GROUP_ID=1000

RUN groupadd -g ${GROUP_ID} hostgroup && \
useradd -m -u ${USER_ID} -g ${GROUP_ID} hostuser

USER hostuser

ENV PATH="/home/hostuser/.local/bin:$PATH"
RUN python -m pip install pip packaging --upgrade
RUN python -m pip install --no-cache-dir setuptools

RUN pip list

WORKDIR /

4 changes: 3 additions & 1 deletion .azure-pipelines/docker/DockerfileCodeScan.devel
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \

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

ARG USER_ID=1000
ARG GROUP_ID=1000

RUN python -m pip install --no-cache-dir \
bandit\
pyspelling\
pydocstyle

WORKDIR /
53 changes: 53 additions & 0 deletions .azure-pipelines/docker/ubuntu-2404.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2025 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG UBUNTU_VER=24.04
FROM ubuntu:${UBUNTU_VER}

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
python3 \
python3-pip \
python3.12-dev \
autoconf \
build-essential \
cmake \
git \
libomp-dev \
numactl \
time \
wget \
bc \
jq \
vim

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

ARG USER_ID=1000
ARG GROUP_ID=1000

RUN groupadd -g ${GROUP_ID} hostgroup && \
useradd -m -u ${USER_ID} -g ${GROUP_ID} hostuser

USER hostuser

ENV PATH="/home/hostuser/.local/bin:$PATH"
RUN pip config set global.break-system-packages true
RUN pip install pip packaging --upgrade
RUN pip install --no-cache-dir setuptools
RUN pip list

WORKDIR /
5 changes: 2 additions & 3 deletions .azure-pipelines/scripts/install_nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

echo -e "##[group]Install Neural Compressor ... "
cd /neural-compressor
pip install cmake==3.31.6
if [[ $1 = *"3x_pt"* ]]; then
python -m pip install --no-cache-dir -r requirements_pt.txt
if [[ $1 = *"3x_pt_fp8"* ]]; then
pip uninstall neural_compressor_3x_pt -y || true
python setup.py pt bdist_wheel
else
echo -e "\n Install torch CPU ... "
pip install torch==2.7.1 torchvision --index-url https://download.pytorch.org/whl/cpu
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/
pip install torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu
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/
python -m pip install --no-cache-dir -r requirements.txt
python setup.py bdist_wheel
fi
Expand Down
5 changes: 2 additions & 3 deletions .azure-pipelines/scripts/models/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ done
SCRIPTS_PATH="/neural-compressor/.azure-pipelines/scripts/models"
log_dir="/neural-compressor/.azure-pipelines/scripts/models"
if [[ "${inc_new_api}" == "3x"* ]]; then
pip install cmake==3.31.6
WORK_SOURCE_DIR="/neural-compressor/examples/${framework}"
git clone https://github.com/intel/intel-extension-for-transformers.git /itrex
cd /itrex
git clone https://github.com/intel/intel-extension-for-transformers.git ~/itrex
cd ~/itrex
pip install -r requirements.txt
pip install -v .
else
Expand Down
62 changes: 0 additions & 62 deletions .azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh

This file was deleted.

30 changes: 2 additions & 28 deletions .azure-pipelines/scripts/models/run_pytorch_models_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,14 @@ new_benchmark=true
inc_new_api=true
benchmark_cmd=""
# ======== set up config for pytorch models ========
if [ "${model}" == "resnet18" ]; then
model_src_dir="image_recognition/torchvision_models/quantization/ptq/cpu/eager"
dataset_location="/tf_dataset2/datasets/mini-imageraw"
input_model=""
yaml="conf.yaml"
strategy="bayesian"
batch_size=1
new_benchmark=false
inc_new_api=false
tuning_cmd="bash run_tuning.sh --topology=resnet18 --dataset_location=${dataset_location} --input_model=${input_model}"
benchmark_cmd="bash run_benchmark.sh --topology=resnet18 --dataset_location=${dataset_location} --mode=benchmark --batch_size=${batch_size} --iters=500"
elif [ "${model}" == "resnet18_fx" ]; then
model_src_dir="image_recognition/torchvision_models/quantization/ptq/cpu/fx/"
dataset_location="/tf_dataset2/datasets/mini-imageraw"
input_model="resnet18"
yaml=""
strategy="basic"
batch_size=1
new_benchmark=true
inc_new_api=true
tuning_cmd="bash run_quant.sh --topology=resnet18 --dataset_location=${dataset_location} --input_model=${input_model}"
benchmark_cmd="bash run_benchmark.sh --topology=resnet18 --dataset_location=${dataset_location} --mode=performance --batch_size=${batch_size} --iters=500"
elif [ "${model}" == "opt_125m_woq_gptq_int4" ]; then
if [ "${model}" == "opt_125m_woq_gptq_int4" ]; then
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
inc_new_api=3x_pt
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_int4"
elif [ "${model}" == "opt_125m_woq_gptq_nf4_dq_bnb" ]; then
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
inc_new_api=3x_pt
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_nf4_dq_bnb"
elif [ "${model}" == "opt_125m_woq_gptq_int4_dq_ggml" ]; then
model_src_dir="nlp/huggingface_models/language-modeling/quantization/weight_only"
inc_new_api=3x_pt
tuning_cmd="bash run_quant.sh --topology=opt_125m_woq_gptq_int4_dq_ggml"
fi

echo "Specify FWs version..."
Expand All @@ -72,7 +46,7 @@ FRAMEWORK="pytorch"
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
if [[ "${inc_new_api}" == "3x"* ]]; then
FRAMEWORK_VERSION="latest"
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${HOME}/.local/lib/:$LD_LIBRARY_PATH
else
FRAMEWORK_VERSION=${pytorch_version}
TORCH_VISION_VERSION=${torchvision_version}
Expand Down
118 changes: 0 additions & 118 deletions .azure-pipelines/scripts/models/run_tensorflow_models_trigger.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .azure-pipelines/scripts/ut/3x/run_3x_pt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "##[section]import check pass"

# install requirements
echo "##[group]set up UT env..."
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${HOME}/.local/lib/:$LD_LIBRARY_PATH
sed -i '/^deepspeed/d' /neural-compressor/test/3x/torch/requirements.txt
pip install -r /neural-compressor/test/3x/torch/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
pip install pytest-cov
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/scripts/ut/3x/run_3x_tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pytest --cov="${inc_path}" --cov-append -vs --disable-warnings --html=report_tf.
# test for tensorflow new api ut
pip uninstall tensorflow -y
pip install /tf_dataset/tf_binary/230928/tensorflow*.whl
pip install cmake==3.31.6
pip install protobuf==3.20.3
pip install horovod==0.27.0
pip list
Expand Down
2 changes: 0 additions & 2 deletions .azure-pipelines/scripts/ut/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ if [[ "${tensorflow_version}" == *"-official" ]]; then
pip install tensorflow==${tensorflow_version%-official}
elif [[ "${tensorflow_version}" == "spr-base" ]]; then
pip install /tf_dataset/tf_binary/230928/tensorflow*.whl
pip install cmake==3.31.6
pip install protobuf==3.20.3
pip install horovod==0.27.0
if [[ $? -ne 0 ]]; then
Expand Down Expand Up @@ -67,7 +66,6 @@ fi

# install special test env requirements
# common deps
pip install cmake==3.31.6
pip install transformers==4.50.0

if [[ $(echo "${test_case}" | grep -c "others") != 0 ]];then
Expand Down
3 changes: 1 addition & 2 deletions .azure-pipelines/scripts/ut/run_basic_adaptor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +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}"
pip install cmake==4.0.0
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${HOME}/.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
Loading
Loading