Skip to content

Commit

Permalink
Update framework versions for CI (#1462)
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <suyue.chen@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
  • Loading branch information
chensuyue committed Dec 22, 2023
1 parent 9d41a7d commit 6c78dfe
Show file tree
Hide file tree
Showing 29 changed files with 105 additions and 1,134 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/model-test.yml
Expand Up @@ -155,9 +155,9 @@ stages:
patterns: "**/*_tuning_info.log"
path: $(OUT_SCRIPT_PATH)
- task: UsePythonVersion@0
displayName: "Use Python 3.8"
displayName: "Use Python 3.10"
inputs:
versionSpec: "3.8"
versionSpec: "3.10"
- script: |
cd ${OUT_SCRIPT_PATH}
mkdir generated
Expand Down
27 changes: 27 additions & 0 deletions .azure-pipelines/scripts/fwk_version.sh
@@ -0,0 +1,27 @@
#!/bin/bash

echo "export FWs version..."
test_mode=$1

if [ "$test_mode" == "coverage" ] || [ "$test_mode" == "latest" ]; then
export tensorflow_version='2.14.0'
export pytorch_version='2.1.0+cpu'
export torchvision_version='0.16.0+cpu'
export ipex_version='2.1.0+cpu'
export onnx_version='1.14.1'
export onnxruntime_version='1.16.3'
export mxnet_version='1.9.1'
else
export tensorflow_version='2.13.0'
export pytorch_version='2.0.1+cpu'
export torchvision_version='0.15.2+cpu'
export ipex_version='2.0.1+cpu'
export onnx_version='1.14.1'
export onnxruntime_version='1.15.1'
export mxnet_version='1.9.1'
fi





4 changes: 3 additions & 1 deletion .azure-pipelines/scripts/models/run_mxnet_models_trigger.sh
Expand Up @@ -21,8 +21,10 @@ do
esac
done

echo "specify FWs version..."
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
FRAMEWORK="mxnet"
FRAMEWORK_VERSION="1.9.1"
FRAMEWORK_VERSION=${mxnet_version}

inc_new_api=false
# ======== set up config for mxnet models ========
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines/scripts/models/run_onnxrt_models_trigger.sh
Expand Up @@ -21,8 +21,10 @@ do
esac
done

echo "specify FWs version..."
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
FRAMEWORK="onnxrt"
FRAMEWORK_VERSION="1.15.1"
FRAMEWORK_VERSION=${onnxruntime_version}

inc_new_api=false
# ======== set up config for onnxrt models ========
Expand Down
6 changes: 4 additions & 2 deletions .azure-pipelines/scripts/models/run_pytorch_models_trigger.sh
Expand Up @@ -21,9 +21,11 @@ do
esac
done

echo "specify FWs version..."
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
FRAMEWORK="pytorch"
FRAMEWORK_VERSION="2.0.1+cpu"
TORCH_VISION_VERSION="0.15.2+cpu"
FRAMEWORK_VERSION=${pytorch_version}
TORCH_VISION_VERSION=${torchvision_version}

inc_new_api=false
# ======== set up config for pytorch models ========
Expand Down
Expand Up @@ -21,8 +21,10 @@ do
esac
done

echo "specify FWs version..."
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
FRAMEWORK="tensorflow"
FRAMEWORK_VERSION="2.13.0"
FRAMEWORK_VERSION=${tensorflow_version}

inc_new_api=false
# ======== set up config for tensorflow models ========
Expand Down
26 changes: 17 additions & 9 deletions .azure-pipelines/scripts/ut/env_setup.sh
Expand Up @@ -48,19 +48,15 @@ if [[ "${torchvision_version}" != "" ]]; then
pip install torchvision==${torchvision_version} -f https://download.pytorch.org/whl/torch_stable.html
fi

if [[ "${ipex_version}" == "1.13.0+cpu" ]]; then
ipex_whl="https://github.com/intel/intel-extension-for-pytorch/releases/download/v1.13.0%2Bcpu/intel_extension_for_pytorch-1.13.0-cp310-cp310-manylinux2014_x86_64.whl"
pip install $ipex_whl
elif [[ "${ipex_version}" == "2.0.0+cpu" ]]; then
if [[ "${ipex_version}" == "2.0.0+cpu" ]]; then
ipex_whl="https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/intel_extension_for_pytorch-2.0.0%2Bcpu-cp310-cp310-linux_x86_64.whl"
pip install $ipex_whl
elif [[ "${ipex_version}" == "2.0.1+cpu" ]]; then
ipex_whl="https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/intel_extension_for_pytorch-2.0.100%2Bcpu-cp310-cp310-linux_x86_64.whl"
pip install $ipex_whl
elif [[ "${ipex_version}" == "2.1.0" ]]; then
pip install /tf_dataset/pt_binary/ww32/torch-*.whl
pip install /tf_dataset/pt_binary/ww32/torchvision-*.whl
pip install /tf_dataset/pt_binary/ww32/intel_extension_for_pytorch-*.whl
elif [[ "${ipex_version}" == "2.1.0+cpu" ]]; then
ipex_whl="https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/intel_extension_for_pytorch-2.1.0%2Bcpu-cp310-cp310-linux_x86_64.whl"
pip install $ipex_whl
fi

if [[ "${onnx_version}" != "" ]]; then
Expand Down Expand Up @@ -88,7 +84,6 @@ fi
# install special test env requirements
# common deps
pip install cmake
pip install horovod
pip install transformers

if [[ $(echo "${test_case}" | grep -c "others") != 0 ]];then
Expand All @@ -97,6 +92,10 @@ elif [[ $(echo "${test_case}" | grep -c "nas") != 0 ]]; then
pip install dynast==1.6.0rc1
elif [[ $(echo "${test_case}" | grep -c "tf pruning") != 0 ]]; then
pip install tensorflow-addons
# Workaround
# horovod can't be install in the env with TF and PT together
# so test distribute cases in the env with single fw installed
pip install horovod
fi
# test deps
pip install coverage
Expand All @@ -106,3 +105,12 @@ pip list
echo "[DEBUG] list pipdeptree..."
pip install pipdeptree
pipdeptree

# import torch before import tensorflow
if [[ $(echo "${test_case}" | grep -c "run basic api") != 0 ]] || [[ $(echo "${test_case}" | grep -c "run basic others") != 0 ]] || [[ $(echo "${test_case}" | grep -c "run basic adaptor") != 0 ]]; then
cd /neural-compressor/test || exit 1
find . -name "test*.py" | xargs sed -i 's/import tensorflow as tf/import torch; import tensorflow as tf/g'
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

2 changes: 1 addition & 1 deletion .azure-pipelines/scripts/ut/run_basic_adaptor.sh
Expand Up @@ -4,7 +4,7 @@ test_case="run basic adaptor"
echo "${test_case}"

echo "specify fwk version..."
source /neural-compressor/.azure-pipelines/scripts/ut/ut_fwk_version.sh $1
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}"
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/scripts/ut/run_basic_adaptor_tfnewapi.sh
@@ -1,6 +1,6 @@
#!/bin/bash
python -c "import neural_compressor as nc;print(nc.version.__version__)"
test_case="run basic adaptor tfnewapi"
test_case="run basic tfnewapi"
echo "${test_case}"

echo "specify fwk version..."
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/scripts/ut/run_basic_api.sh
@@ -1,10 +1,10 @@
#!/bin/bash
python -c "import neural_compressor as nc;print(nc.version.__version__)"
test_case="run basic quantization/benchmark/export/mixed_precision/distillation/scheduler/nas"
test_case="run basic api quantization/benchmark/export/mixed_precision/distillation/scheduler/nas"
echo "${test_case}"

echo "specify fwk version..."
source /neural-compressor/.azure-pipelines/scripts/ut/ut_fwk_version.sh $1
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}"
Expand Down
8 changes: 4 additions & 4 deletions .azure-pipelines/scripts/ut/run_basic_itex.sh
Expand Up @@ -4,10 +4,10 @@ test_case="run basic itex"
echo "${test_case}"

echo "specify fwk version..."
export itex_version='1.1.0'
export tensorflow_version='2.11.0-official'
export onnx_version='1.13.0'
export onnxruntime_version='1.13.1'
export itex_version='2.14.0.1'
export tensorflow_version='2.14.0-official'
export onnx_version='1.14.1'
export onnxruntime_version='1.16.3'

echo "set up UT env..."
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"
Expand Down
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/ut/run_basic_others.sh
Expand Up @@ -4,7 +4,7 @@ test_case="run basic others"
echo "${test_case}"

echo "specify fwk version..."
source /neural-compressor/.azure-pipelines/scripts/ut/ut_fwk_version.sh $1
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}"
Expand All @@ -26,6 +26,7 @@ sed -i '/ distillation\//d' run.sh
sed -i '/ scheduler\//d' run.sh
sed -i '/ nas\//d' run.sh
sed -i '/ 3x\//d' run.sh
sed -i '/ distributed\//d' run.sh

echo "copy model for dynas..."
mkdir -p .torch/ofa_nets || true
Expand Down
7 changes: 4 additions & 3 deletions .azure-pipelines/scripts/ut/run_basic_pt_pruning.sh
Expand Up @@ -4,16 +4,17 @@ test_case="run basic pt pruning"
echo "${test_case}"

echo "specify fwk version..."
export pytorch_version='2.0.0+cpu'
export torchvision_version='0.15.1+cpu'
export ipex_version='2.0.0+cpu'
export pytorch_version='2.1.0+cpu'
export torchvision_version='0.16.0+cpu'
export ipex_version='2.1.0+cpu'

echo "set up UT env..."
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"
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
find ./pruning_with_pt -name "test*.py" | sed 's,\.\/,coverage run --source='"${lpot_path}"' --append ,g' | sed 's/$/ --verbose/'> run.sh
# find ./distributed -name "test_distributed_pt_train.py" | sed 's,\.\/,coverage run --source='"${lpot_path}"' --append ,g' | sed 's/$/ --verbose/'>> run.sh

LOG_DIR=/neural-compressor/log_dir
mkdir -p ${LOG_DIR}
Expand Down
3 changes: 2 additions & 1 deletion .azure-pipelines/scripts/ut/run_basic_tf_pruning.sh
Expand Up @@ -4,14 +4,15 @@ test_case="run basic tf pruning"
echo "${test_case}"

echo "specify fwk version..."
export tensorflow_version='2.12.0'
export tensorflow_version='2.14.0'

echo "set up UT env..."
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"
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
find ./pruning_with_tf -name "test*.py" | sed 's,\.\/,coverage run --source='"${lpot_path}"' --append ,g' | sed 's/$/ --verbose/'> run.sh
find ./distributed -name "test_distributed_tf_dataloader.py" | sed 's,\.\/,coverage run --source='"${lpot_path}"' --append ,g' | sed 's/$/ --verbose/'>> run.sh

LOG_DIR=/neural-compressor/log_dir
mkdir -p ${LOG_DIR}
Expand Down
33 changes: 0 additions & 33 deletions .azure-pipelines/scripts/ut/run_basic_v2.1_ipex.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .azure-pipelines/scripts/ut/run_itrex.sh
Expand Up @@ -11,6 +11,8 @@ bash /intel-extension-for-transformers/.github/workflows/script/prepare_env.sh
bash /intel-extension-for-transformers/.github/workflows/script/install_binary.sh

# prepare test env
# tmp install transformers for incompatible issue
pip install transformers==4.34.1
pip install -r /intel-extension-for-transformers/tests/requirements.txt
LOG_DIR=/neural-compressor/log_dir
mkdir -p ${LOG_DIR}
Expand Down
32 changes: 0 additions & 32 deletions .azure-pipelines/scripts/ut/ut_fwk_version.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .azure-pipelines/template/docker-template.yml
Expand Up @@ -7,7 +7,7 @@ parameters:
default: "neural-compressor"
- name: repoTag
type: string
default: "py38"
default: "py310"
- name: dockerFileName
type: string
default: "Dockerfile"
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/template/model-template.yml
Expand Up @@ -15,7 +15,7 @@ steps:
parameters:
dockerConfigName: "commonDockerConfig"
repoName: "neural-compressor"
repoTag: "py38"
repoTag: "py310"
dockerFileName: "Dockerfile"
containerName: ${{ parameters.modelContainerName }}

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/template/ut-template.yml
Expand Up @@ -23,7 +23,7 @@ steps:
parameters:
dockerConfigName: ${{ parameters.dockerConfigName }}
repoName: "neural-compressor"
repoTag: "py38"
repoTag: "py310"
dockerFileName: "Dockerfile"
containerName: ${{ parameters.utContainerName }}
repo: ${{ parameters.repo }}
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/ut-3x-pt.yml
Expand Up @@ -18,7 +18,7 @@ pool: ICX-16C

variables:
IMAGE_NAME: "neural-compressor"
IMAGE_TAG: "py38"
IMAGE_TAG: "py310"
UPLOAD_PATH: $(Build.SourcesDirectory)/log_dir
DOWNLOAD_PATH: $(Build.SourcesDirectory)/log_dir
ARTIFACT_NAME: "UT_coverage_report_3x_pt"
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/ut-3x-tf.yml
Expand Up @@ -18,7 +18,7 @@ pool: ICX-16C

variables:
IMAGE_NAME: "neural-compressor"
IMAGE_TAG: "py38"
IMAGE_TAG: "py310"
UPLOAD_PATH: $(Build.SourcesDirectory)/log_dir
DOWNLOAD_PATH: $(Build.SourcesDirectory)/log_dir
ARTIFACT_NAME: "UT_coverage_report_3x_tf"
Expand Down

0 comments on commit 6c78dfe

Please sign in to comment.