Skip to content

Commit

Permalink
Fix UT env and upgrade torch to 2.4.0 (#1978)
Browse files Browse the repository at this point in the history
Signed-off-by: Sun, Xuehao <[email protected]>
(cherry picked from commit 68b1f8b)
  • Loading branch information
XuehaoSun authored and chensuyue committed Aug 30, 2024
1 parent 7056720 commit 9486bf3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .azure-pipelines/scripts/fwk_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

echo "export FWs version..."
export tensorflow_version='2.15.0-official'
export pytorch_version='2.3.0+cpu'
export torchvision_version='0.18.0+cpu'
export ipex_version='2.3.0+cpu'
export pytorch_version='2.4.0+cpu'
export torchvision_version='0.19.0'
export ipex_version='2.4.0+cpu'
export onnx_version='1.16.0'
export onnxruntime_version='1.18.0'
export mxnet_version='1.9.1'
8 changes: 5 additions & 3 deletions .azure-pipelines/scripts/install_nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ cd /neural-compressor
if [[ $1 = *"3x_pt"* ]]; then
if [[ $1 != *"3x_pt_fp8"* ]]; then
echo -e "\n Install torch CPU ... "
pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu
fi
python -m pip install --no-cache-dir -r requirements_pt.txt
python setup.py pt bdist_wheel
# python setup.py pt bdist_wheel
python setup.py bdist_wheel
pip install --no-deps dist/neural_compressor*.whl --force-reinstall
elif [[ $1 = *"3x_tf"* ]]; then
python -m pip install --no-cache-dir -r requirements_tf.txt
python setup.py tf bdist_wheel
# python setup.py tf bdist_wheel
python setup.py bdist_wheel
pip install dist/neural_compressor*.whl --force-reinstall
else
python -m pip install --no-cache-dir -r requirements.txt
Expand Down
8 changes: 6 additions & 2 deletions .azure-pipelines/scripts/models/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ SCRIPTS_PATH="/neural-compressor/.azure-pipelines/scripts/models"
log_dir="/neural-compressor/.azure-pipelines/scripts/models"
if [[ "${inc_new_api}" == "3x"* ]]; then
WORK_SOURCE_DIR="/neural-compressor/examples/3.x_api/${framework}"
git clone https://github.com/intel/intel-extension-for-transformers.git /itrex
cd /itrex
pip install -r requirements.txt
pip install -v .
else
WORK_SOURCE_DIR="/neural-compressor/examples/${framework}"
fi
Expand Down Expand Up @@ -95,8 +99,8 @@ if [[ "${fwk_ver}" != "latest" ]]; then
pip install intel-tensorflow==${fwk_ver}
fi
elif [[ "${framework}" == "pytorch" ]]; then
pip install torch==${fwk_ver} -f https://download.pytorch.org/whl/torch_stable.html
pip install torchvision==${torch_vision_ver} -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==${fwk_ver} --index-url https://download.pytorch.org/whl/cpu
pip install torchvision==${torch_vision_ver} --index-url https://download.pytorch.org/whl/cpu
elif [[ "${framework}" == "onnxrt" ]]; then
pip install onnx==1.15.0
pip install onnxruntime==${fwk_ver}
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/scripts/ut/run_basic_pt_pruning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ test_case="run basic pt pruning"
echo "${test_case}"

echo "specify fwk version..."
export pytorch_version='2.3.0+cpu'
export pytorch_version='2.4.0+cpu'
export torchvision_version='0.18.0+cpu'
export ipex_version='2.3.0+cpu'
export ipex_version='2.4.0+cpu'

echo "set up UT env..."
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/template/docker-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ steps:
- checkout: self
clean: true
displayName: "Checkout out Repo"
fetchDepth: 0

- ${{ if eq(parameters.dockerConfigName, 'gitCloneDockerConfig') }}:
- script: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ wandb
einops
neural-compressor
intel-extension-for-transformers
lm_eval==0.4.2
lm_eval==0.4.3
peft
auto_round
intel_extension_for_pytorch

0 comments on commit 9486bf3

Please sign in to comment.