diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index fbb7b8c4e57..4d021f440ba 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -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 / - diff --git a/.azure-pipelines/docker/DockerfileCodeScan.devel b/.azure-pipelines/docker/DockerfileCodeScan.devel index 611fe02e235..26b743ff295 100644 --- a/.azure-pipelines/docker/DockerfileCodeScan.devel +++ b/.azure-pipelines/docker/DockerfileCodeScan.devel @@ -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 / diff --git a/.azure-pipelines/docker/ubuntu-2404.devel b/.azure-pipelines/docker/ubuntu-2404.devel new file mode 100644 index 00000000000..d279adf93fc --- /dev/null +++ b/.azure-pipelines/docker/ubuntu-2404.devel @@ -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 / diff --git a/.azure-pipelines/scripts/install_nc.sh b/.azure-pipelines/scripts/install_nc.sh index 8f9f8c0499e..8f6f7b4800b 100644 --- a/.azure-pipelines/scripts/install_nc.sh +++ b/.azure-pipelines/scripts/install_nc.sh @@ -2,7 +2,6 @@ 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 @@ -10,8 +9,8 @@ if [[ $1 = *"3x_pt"* ]]; then 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 diff --git a/.azure-pipelines/scripts/models/env_setup.sh b/.azure-pipelines/scripts/models/env_setup.sh index 0182b2781c9..852019466b1 100644 --- a/.azure-pipelines/scripts/models/env_setup.sh +++ b/.azure-pipelines/scripts/models/env_setup.sh @@ -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 diff --git a/.azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh b/.azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh deleted file mode 100644 index d48a115bea5..00000000000 --- a/.azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -set -eo pipefail -# get parameters -PATTERN='[-a-zA-Z0-9_]*=' - -for i in "$@" -do - case $i in - --model=*) - model=`echo $i | sed "s/${PATTERN}//"`;; - --mode=*) - mode=`echo $i | sed "s/${PATTERN}//"`;; - --USE_TUNE_ACC=*) - USE_TUNE_ACC=`echo $i | sed "s/${PATTERN}//"`;; - --PERF_STABLE_CHECK=*) - PERF_STABLE_CHECK=`echo $i | sed "s/${PATTERN}//"`;; - --BUILD_BUILDID=*) - BUILD_BUILDID=`echo $i | sed "s/${PATTERN}//"`;; - *) - echo "Parameter $i not recognized."; exit 1;; - esac -done - -echo "specify FWs version..." -source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest' -FRAMEWORK="onnxrt" -FRAMEWORK_VERSION=${onnxruntime_version} - -inc_new_api=false -# ======== set up config for onnxrt models ======== -if [ "${model}" == "resnet50-v1-12" ]; then - model_src_dir="image_recognition/onnx_model_zoo/resnet50/quantization/ptq_static" - dataset_location="/tf_dataset2/datasets/imagenet/ImagenetRaw/ImagenetRaw_small_5000/ILSVRC2012_img_val" - input_model="/tf_dataset2/models/onnx/resnet50-v1-12/resnet50-v1-12.onnx" - yaml="resnet50_v1_5.yaml" - strategy="basic" - batch_size=1 - new_benchmark=true - inc_new_api=true - tuning_cmd="bash run_quant.sh --input_model=${input_model} --dataset_location=${dataset_location}" - benchmark_cmd="bash run_benchmark.sh --config=${yaml} --mode=performance --dataset_location=${dataset_location}" -fi - - -/bin/bash run_model_trigger_common.sh \ - --yaml=${yaml} \ - --framework=${FRAMEWORK} \ - --fwk_ver=${FRAMEWORK_VERSION} \ - --model=${model} \ - --model_src_dir=${model_src_dir} \ - --dataset_location=${dataset_location} \ - --input_model=${input_model} \ - --batch_size=${batch_size} \ - --strategy=${strategy} \ - --new_benchmark=${new_benchmark} \ - --tuning_cmd="${tuning_cmd}" \ - --benchmark_cmd="${benchmark_cmd}" \ - --inc_new_api="${inc_new_api}" \ - --mode=${mode} \ - --USE_TUNE_ACC=${USE_TUNE_ACC} \ - --PERF_STABLE_CHECK=${PERF_STABLE_CHECK} \ - --BUILD_BUILDID=${BUILD_BUILDID} \ No newline at end of file diff --git a/.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh b/.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh index c5627cc7c00..16e1f2c9189 100644 --- a/.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh +++ b/.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh @@ -30,29 +30,7 @@ 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" @@ -60,10 +38,6 @@ 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..." @@ -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} diff --git a/.azure-pipelines/scripts/models/run_tensorflow_models_trigger.sh b/.azure-pipelines/scripts/models/run_tensorflow_models_trigger.sh deleted file mode 100644 index 505fad4a6e5..00000000000 --- a/.azure-pipelines/scripts/models/run_tensorflow_models_trigger.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -set -eo pipefail -# get parameters -PATTERN='[-a-zA-Z0-9_]*=' - -for i in "$@" -do - case $i in - --model=*) - model=`echo $i | sed "s/${PATTERN}//"`;; - --mode=*) - mode=`echo $i | sed "s/${PATTERN}//"`;; - --USE_TUNE_ACC=*) - USE_TUNE_ACC=`echo $i | sed "s/${PATTERN}//"`;; - --PERF_STABLE_CHECK=*) - PERF_STABLE_CHECK=`echo $i | sed "s/${PATTERN}//"`;; - --BUILD_BUILDID=*) - BUILD_BUILDID=`echo $i | sed "s/${PATTERN}//"`;; - *) - echo "Parameter $i not recognized."; exit 1;; - esac -done - -echo "specify FWs version..." -source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest' -FRAMEWORK="tensorflow" -FRAMEWORK_VERSION=${tensorflow_version} - -inc_new_api=false -# ======== set up config for tensorflow models ======== -if [ "${model}" == "resnet50v1.5" ]; then - model_src_dir="image_recognition/tensorflow_models/resnet50_v1_5/quantization/ptq" - dataset_location="/tf_dataset/dataset/TF_mini_imagenet" - input_model="/tf_dataset/pre-trained-models/resnet50v1_5/fp32/resnet50_v1.pb" - new_benchmark=true - inc_new_api=true - tuning_cmd="bash run_quant.sh --dataset_location=${dataset_location} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --dataset_location=${dataset_location} --batch_size=1 --mode=performance" -elif [ "${model}" == "ssd_resnet50_v1" ];then - model_src_dir="object_detection/tensorflow_models/ssd_resnet50_v1/quantization/ptq" - dataset_location="/tf_dataset/tensorflow/mini-coco-100.record" - input_model="/tf_dataset/pre-train-model-oob/object_detection/ssd_resnet50_v1/frozen_inference_graph.pb" - new_benchmark=true - inc_new_api=true - tuning_cmd="bash run_quant.sh --dataset_location=${dataset_location} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --dataset_location=${dataset_location} --batch_size=1 --mode=performance" -elif [ "${model}" == "ssd_mobilenet_v1_ckpt" ];then - model_src_dir="object_detection/tensorflow_models/ssd_mobilenet_v1/quantization/ptq" - dataset_location="/tf_dataset/tensorflow/mini-coco-100.record" - input_model="/tf_dataset/pre-train-model-oob/object_detection/ssd_mobilenet_v1" - new_benchmark=true - inc_new_api=true - tuning_cmd="bash run_quant.sh --dataset_location=${dataset_location} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --dataset_location=${dataset_location} --batch_size=1 --mode=performance" -elif [ "${model}" == "inception_v1" ]; then - model_src_dir="image_recognition/tensorflow_models/quantization/ptq" - dataset_location="/tf_dataset/dataset/TF_mini_imagenet" - input_model="/tf_dataset/pre-train-model-slim/pbfile/frozen_pb/frozen_inception_v1.pb" - yaml="inception_v1.yaml" - strategy="basic" - batch_size=1 - new_benchmark=true - tuning_cmd="bash run_tuning.sh --config=${yaml} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --config=${yaml} --mode=performance" -elif [ "${model}" == "darknet19" ]; then - model_src_dir="oob_models/quantization/ptq" - dataset_location="" - input_model="/tf_dataset/tensorflow/tf_oob_models/ov/all_tf_models/PublicInHouse/classification/darknet19/darknet19.pb" - yaml="config.yaml" - strategy="basic" - batch_size=1 - new_benchmark=false - inc_new_api=true - tuning_cmd="bash run_quant.sh --topology=${model} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --topology=${model} --mode=performance --batch_size=1 --iters=500" -elif [ "${model}" == "densenet-121" ]; then - model_src_dir="oob_models/quantization/ptq" - dataset_location="" - input_model="/tf_dataset/tensorflow/tf_oob_models/ov/all_tf_models/classification/densenet/121/tf/densenet-121.pb" - yaml="config.yaml" - strategy="basic" - batch_size=1 - new_benchmark=false - inc_new_api=true - tuning_cmd="bash run_quant.sh --topology=${model} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --topology=${model} --mode=performance --batch_size=1 --iters=500" -elif [ "${model}" == "resnet-101" ]; then - model_src_dir="oob_models/quantization/ptq" - dataset_location="" - input_model="/tf_dataset/tensorflow/tf_oob_models/ov/all_tf_models/classification/resnet/v1/101/tf/resnet-101.pb" - yaml="config.yaml" - strategy="basic" - batch_size=1 - new_benchmark=false - inc_new_api=true - tuning_cmd="bash run_quant.sh --topology=${model} --input_model=${input_model}" - benchmark_cmd="bash run_benchmark.sh --topology=${model} --mode=performance --batch_size=1 --iters=500" -fi - - -/bin/bash run_model_trigger_common.sh \ - --yaml=${yaml} \ - --framework=${FRAMEWORK} \ - --fwk_ver=${FRAMEWORK_VERSION} \ - --model=${model} \ - --model_src_dir=${model_src_dir} \ - --dataset_location=${dataset_location} \ - --input_model=${input_model} \ - --batch_size=${batch_size} \ - --strategy=${strategy} \ - --new_benchmark=${new_benchmark} \ - --tuning_cmd="${tuning_cmd}" \ - --benchmark_cmd="${benchmark_cmd}" \ - --inc_new_api="${inc_new_api}" \ - --mode=${mode} \ - --USE_TUNE_ACC=${USE_TUNE_ACC} \ - --PERF_STABLE_CHECK=${PERF_STABLE_CHECK} \ - --BUILD_BUILDID=${BUILD_BUILDID} diff --git a/.azure-pipelines/scripts/ut/3x/run_3x_pt.sh b/.azure-pipelines/scripts/ut/3x/run_3x_pt.sh index d9199111378..089aea116a0 100644 --- a/.azure-pipelines/scripts/ut/3x/run_3x_pt.sh +++ b/.azure-pipelines/scripts/ut/3x/run_3x_pt.sh @@ -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 diff --git a/.azure-pipelines/scripts/ut/3x/run_3x_tf.sh b/.azure-pipelines/scripts/ut/3x/run_3x_tf.sh index 60986e4cf60..317b261be4d 100644 --- a/.azure-pipelines/scripts/ut/3x/run_3x_tf.sh +++ b/.azure-pipelines/scripts/ut/3x/run_3x_tf.sh @@ -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 diff --git a/.azure-pipelines/scripts/ut/env_setup.sh b/.azure-pipelines/scripts/ut/env_setup.sh index c4eed7f0779..f12ee6efa07 100644 --- a/.azure-pipelines/scripts/ut/env_setup.sh +++ b/.azure-pipelines/scripts/ut/env_setup.sh @@ -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 @@ -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 diff --git a/.azure-pipelines/scripts/ut/run_basic_adaptor.sh b/.azure-pipelines/scripts/ut/run_basic_adaptor.sh index 3f05474effa..0ed1d9c8255 100644 --- a/.azure-pipelines/scripts/ut/run_basic_adaptor.sh +++ b/.azure-pipelines/scripts/ut/run_basic_adaptor.sh @@ -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 diff --git a/.azure-pipelines/template/code-scan-template.yml b/.azure-pipelines/template/code-scan-template.yml index b8d121b4991..0aeb5389d06 100644 --- a/.azure-pipelines/template/code-scan-template.yml +++ b/.azure-pipelines/template/code-scan-template.yml @@ -38,5 +38,6 @@ steps: inputs: targetType: "inline" script: | - docker exec ${{ parameters.codeScanContainerName }} bash -c "rm -fr /neural-compressor/* && rm -fr /neural-compressor/.* || true" + docker stop ${{ parameters.codeScanContainerName }} + docker rm -vf ${{ parameters.codeScanContainerName }} || true displayName: "Docker clean up" diff --git a/.azure-pipelines/template/docker-template.yml b/.azure-pipelines/template/docker-template.yml index a7625fc4d60..25d143bd8d5 100644 --- a/.azure-pipelines/template/docker-template.yml +++ b/.azure-pipelines/template/docker-template.yml @@ -63,7 +63,8 @@ steps: - script: | docker image prune -a -f if [[ ! $(docker images | grep -i ${{ parameters.repoName }}:${{ parameters.repoTag }}) ]]; then - docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/${{parameters.dockerFileName}}.devel -t ${{ parameters.repoName }}:${{ parameters.repoTag }} . + docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) \ + -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/${{parameters.dockerFileName}}.devel -t ${{ parameters.repoName }}:${{ parameters.repoTag }} . fi docker images | grep -i ${{ parameters.repoName }} if [[ $? -ne 0 ]]; then @@ -74,7 +75,7 @@ steps: - ${{ if eq(parameters.imageSource, 'pull') }}: - script: | - docker pull vault.habana.ai/gaudi-docker/1.22.0/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest + docker pull vault.habana.ai/gaudi-docker/1.22.1/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest displayName: "Pull habana docker image" - script: | @@ -95,7 +96,7 @@ steps: else docker run -dit --disable-content-trust --privileged --name=${{ parameters.containerName }} --shm-size="2g" \ --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host \ - -v ${BUILD_SOURCESDIRECTORY}:/neural-compressor vault.habana.ai/gaudi-docker/1.22.0/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest + -v ${BUILD_SOURCESDIRECTORY}:/neural-compressor vault.habana.ai/gaudi-docker/1.22.1/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest docker exec ${{ parameters.containerName }} bash -c "ln -sf \$(which python3) /usr/bin/python" fi echo "Show the container list after docker run ... " diff --git a/.azure-pipelines/template/model-template.yml b/.azure-pipelines/template/model-template.yml index 20fdd1a8cba..e8a6755bf2f 100644 --- a/.azure-pipelines/template/model-template.yml +++ b/.azure-pipelines/template/model-template.yml @@ -18,7 +18,7 @@ steps: parameters: dockerConfigName: "commonDockerConfig" repoName: "neural-compressor" - repoTag: "py310" + repoTag: "py312" dockerFileName: "Dockerfile" containerName: ${{ parameters.modelContainerName }} @@ -77,4 +77,6 @@ steps: targetType: "inline" script: | docker exec ${{ parameters.modelContainerName }} bash -c "rm -fr /neural-compressor/* && rm -fr /neural-compressor/.* || true" + docker stop ${{ parameters.modelContainerName }} + docker rm -vf ${{ parameters.modelContainerName }} || true displayName: "Docker clean up" diff --git a/.azure-pipelines/template/ut-template.yml b/.azure-pipelines/template/ut-template.yml index d8908d22a35..f083e4a3bca 100644 --- a/.azure-pipelines/template/ut-template.yml +++ b/.azure-pipelines/template/ut-template.yml @@ -2,6 +2,9 @@ parameters: - name: dockerConfigName type: string default: "commonDockerConfig" + - name: dockerFileName + type: string + default: "Dockerfile" - name: repo type: string default: "https://github.com/intel/neural-compressor" @@ -27,7 +30,7 @@ steps: dockerConfigName: ${{ parameters.dockerConfigName }} repoName: "neural-compressor" repoTag: "py310" - dockerFileName: "Dockerfile" + dockerFileName: "${{ parameters.dockerFileName }}" containerName: ${{ parameters.utContainerName }} repo: ${{ parameters.repo }} imageSource: ${{ parameters.imageSource }} @@ -58,4 +61,6 @@ steps: targetType: "inline" script: | docker exec ${{ parameters.utContainerName }} bash -c "rm -fr /neural-compressor/* && rm -fr /neural-compressor/.* || true" + docker stop ${{ parameters.utContainerName }} + docker rm -vf ${{ parameters.utContainerName }} || true displayName: "Docker clean up" diff --git a/.azure-pipelines/ut-3x-pt.yml b/.azure-pipelines/ut-3x-pt.yml index 68083d3a2c6..2b8ccf7069f 100644 --- a/.azure-pipelines/ut-3x-pt.yml +++ b/.azure-pipelines/ut-3x-pt.yml @@ -25,7 +25,7 @@ pool: ICX-16C variables: IMAGE_NAME: "neural-compressor" - IMAGE_TAG: "py310" + IMAGE_TAG: "py312" UPLOAD_PATH: $(Build.SourcesDirectory)/log_dir DOWNLOAD_PATH: $(Build.SourcesDirectory)/log_dir ARTIFACT_NAME: "UT_coverage_report_3x_pt" @@ -42,6 +42,7 @@ stages: - template: template/ut-template.yml parameters: dockerConfigName: "commonDockerConfig" + dockerFileName: "ubuntu-2404" utScriptFileName: "3x/run_3x_pt" uploadPath: $(UPLOAD_PATH) utArtifact: "ut_3x" @@ -57,6 +58,7 @@ stages: - template: template/ut-template.yml parameters: dockerConfigName: "gitCloneDockerConfig" + dockerFileName: "ubuntu-2404" utScriptFileName: "3x/run_3x_pt" uploadPath: $(UPLOAD_PATH) utArtifact: "ut_3x_baseline" @@ -72,7 +74,8 @@ stages: steps: - script: | if [[ ! $(docker images | grep -i ${IMAGE_NAME}:${IMAGE_TAG}) ]]; then - docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} . + docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) \ + -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/ubuntu-2404.devel -t ${IMAGE_NAME}:${IMAGE_TAG} . fi docker images | grep -i ${IMAGE_NAME} if [[ $? -ne 0 ]]; then diff --git a/.azure-pipelines/ut-3x-tf.yml b/.azure-pipelines/ut-3x-tf.yml index d2733b1149b..17d17d8f678 100644 --- a/.azure-pipelines/ut-3x-tf.yml +++ b/.azure-pipelines/ut-3x-tf.yml @@ -69,7 +69,8 @@ stages: steps: - script: | if [[ ! $(docker images | grep -i ${IMAGE_NAME}:${IMAGE_TAG}) ]]; then - docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} . + docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) \ + -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} . fi docker images | grep -i ${IMAGE_NAME} if [[ $? -ne 0 ]]; then diff --git a/.github/workflows/check-stale-issue.yml b/.github/workflows/check-stale-issue.yml index 6af25375328..2aae86025ce 100644 --- a/.github/workflows/check-stale-issue.yml +++ b/.github/workflows/check-stale-issue.yml @@ -7,6 +7,7 @@ permissions: on: schedule: - cron: "30 22 * * *" + workflow_dispatch: jobs: stale: @@ -14,6 +15,7 @@ jobs: steps: - uses: actions/stale@v10 with: + start-date: '2020-01-01T00:00:00Z' days-before-issue-stale: 60 days-before-issue-close: 7 stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days." diff --git a/README.md b/README.md index 7831990f6ea..a91220d8f4d 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ To try on Intel Gaudi2, docker image with Gaudi Software Stack is recommended, p Run a container with an interactive shell, [more info](https://docs.habana.ai/en/latest/Installation_Guide/Additional_Installation/Docker_Installation.html#docker-installation) ``` -docker run -it --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host vault.habana.ai/gaudi-docker/1.22.0/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest +docker run -it --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host vault.habana.ai/gaudi-docker/1.22.1/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest ``` > Note: Since Habana software >= 1.21.0, `PT_HPU_LAZY_MODE=0` is the default setting. However, most low-precision functions (such as `convert_from_uint4`) do not support this setting. Therefore, we recommend setting `PT_HPU_LAZY_MODE=1` to maintain compatibility. diff --git a/neural_compressor/version.py b/neural_compressor/version.py index 6f857d8faca..732a1dd612c 100644 --- a/neural_compressor/version.py +++ b/neural_compressor/version.py @@ -15,4 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. """IntelĀ® Neural Compressor: An open-source Python library supporting popular model compression techniques.""" -__version__ = "3.6" +__version__ = "3.7"