Skip to content

Commit 68b1f8b

Browse files
authored
Fix UT env and upgrade torch to 2.4.0 (#1978)
Signed-off-by: Sun, Xuehao <[email protected]>
1 parent f9dfd54 commit 68b1f8b

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

.azure-pipelines/scripts/fwk_version.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
echo "export FWs version..."
44
export tensorflow_version='2.15.0-official'
5-
export pytorch_version='2.3.0+cpu'
6-
export torchvision_version='0.18.0+cpu'
7-
export ipex_version='2.3.0+cpu'
5+
export pytorch_version='2.4.0+cpu'
6+
export torchvision_version='0.19.0'
7+
export ipex_version='2.4.0+cpu'
88
export onnx_version='1.16.0'
99
export onnxruntime_version='1.18.0'
1010
export mxnet_version='1.9.1'

.azure-pipelines/scripts/install_nc.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ cd /neural-compressor
55
if [[ $1 = *"3x_pt"* ]]; then
66
if [[ $1 != *"3x_pt_fp8"* ]]; then
77
echo -e "\n Install torch CPU ... "
8-
pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu
8+
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu
99
fi
1010
python -m pip install --no-cache-dir -r requirements_pt.txt
11-
python setup.py pt bdist_wheel
11+
# python setup.py pt bdist_wheel
12+
python setup.py bdist_wheel
1213
pip install --no-deps dist/neural_compressor*.whl --force-reinstall
1314
elif [[ $1 = *"3x_tf"* ]]; then
1415
python -m pip install --no-cache-dir -r requirements_tf.txt
15-
python setup.py tf bdist_wheel
16+
# python setup.py tf bdist_wheel
17+
python setup.py bdist_wheel
1618
pip install dist/neural_compressor*.whl --force-reinstall
1719
else
1820
python -m pip install --no-cache-dir -r requirements.txt

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ SCRIPTS_PATH="/neural-compressor/.azure-pipelines/scripts/models"
5151
log_dir="/neural-compressor/.azure-pipelines/scripts/models"
5252
if [[ "${inc_new_api}" == "3x"* ]]; then
5353
WORK_SOURCE_DIR="/neural-compressor/examples/3.x_api/${framework}"
54+
git clone https://github.com/intel/intel-extension-for-transformers.git /itrex
55+
cd /itrex
56+
pip install -r requirements.txt
57+
pip install -v .
5458
else
5559
WORK_SOURCE_DIR="/neural-compressor/examples/${framework}"
5660
fi
@@ -95,8 +99,8 @@ if [[ "${fwk_ver}" != "latest" ]]; then
9599
pip install intel-tensorflow==${fwk_ver}
96100
fi
97101
elif [[ "${framework}" == "pytorch" ]]; then
98-
pip install torch==${fwk_ver} -f https://download.pytorch.org/whl/torch_stable.html
99-
pip install torchvision==${torch_vision_ver} -f https://download.pytorch.org/whl/torch_stable.html
102+
pip install torch==${fwk_ver} --index-url https://download.pytorch.org/whl/cpu
103+
pip install torchvision==${torch_vision_ver} --index-url https://download.pytorch.org/whl/cpu
100104
elif [[ "${framework}" == "onnxrt" ]]; then
101105
pip install onnx==1.15.0
102106
pip install onnxruntime==${fwk_ver}

.azure-pipelines/scripts/ut/run_basic_pt_pruning.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ test_case="run basic pt pruning"
44
echo "${test_case}"
55

66
echo "specify fwk version..."
7-
export pytorch_version='2.3.0+cpu'
7+
export pytorch_version='2.4.0+cpu'
88
export torchvision_version='0.18.0+cpu'
9-
export ipex_version='2.3.0+cpu'
9+
export ipex_version='2.4.0+cpu'
1010

1111
echo "set up UT env..."
1212
bash /neural-compressor/.azure-pipelines/scripts/ut/env_setup.sh "${test_case}"

.azure-pipelines/template/docker-template.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ steps:
4242
- checkout: self
4343
clean: true
4444
displayName: "Checkout out Repo"
45+
fetchDepth: 0
4546

4647
- ${{ if eq(parameters.dockerConfigName, 'gitCloneDockerConfig') }}:
4748
- script: |

examples/3.x_api/pytorch/nlp/huggingface_models/language-modeling/quantization/weight_only/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ wandb
99
einops
1010
neural-compressor
1111
intel-extension-for-transformers
12-
lm_eval==0.4.2
12+
lm_eval==0.4.3
1313
peft
1414
auto_round
1515
intel_extension_for_pytorch

0 commit comments

Comments
 (0)