@@ -48,19 +48,15 @@ if [[ "${torchvision_version}" != "" ]]; then
4848    pip install torchvision==${torchvision_version}  -f https://download.pytorch.org/whl/torch_stable.html
4949fi 
5050
51- if  [[ " ${ipex_version} "   ==  " 1.13.0+cpu"   ]];  then 
52-     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" 
53-     pip install $ipex_whl 
54- elif  [[ " ${ipex_version} "   ==  " 2.0.0+cpu"   ]];  then 
51+ if  [[ " ${ipex_version} "   ==  " 2.0.0+cpu"   ]];  then 
5552    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" 
5653    pip install $ipex_whl 
5754elif  [[ " ${ipex_version} "   ==  " 2.0.1+cpu"   ]];  then 
5855    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" 
5956    pip install $ipex_whl 
60- elif  [[ " ${ipex_version} "   ==  " 2.1.0"   ]];  then 
61-     pip install /tf_dataset/pt_binary/ww32/torch-* .whl
62-     pip install /tf_dataset/pt_binary/ww32/torchvision-* .whl
63-     pip install /tf_dataset/pt_binary/ww32/intel_extension_for_pytorch-* .whl
57+ elif  [[ " ${ipex_version} "   ==  " 2.1.0+cpu"   ]];  then 
58+     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" 
59+     pip install $ipex_whl 
6460fi 
6561
6662if  [[ " ${onnx_version} "   !=  " "   ]];  then 
8884#  install special test env requirements
8985#  common deps
9086pip install cmake
91- pip install horovod
9287pip install transformers
9388
9489if  [[ $( echo " ${test_case} "   |  grep -c " others" )   !=  0 ]]; then 
@@ -97,6 +92,10 @@ elif [[ $(echo "${test_case}" | grep -c "nas") != 0 ]]; then
9792    pip install dynast==1.6.0rc1
9893elif  [[ $( echo " ${test_case} "   |  grep -c " tf pruning" )   !=  0 ]];  then 
9994    pip install tensorflow-addons
95+     #  Workaround
96+     #  horovod can't be install in the env with TF and PT together
97+     #  so test distribute cases in the env with single fw installed
98+     pip install horovod
10099fi 
101100#  test deps
102101pip install coverage
@@ -106,3 +105,12 @@ pip list
106105echo  " [DEBUG] list pipdeptree..." 
107106pip install pipdeptree
108107pipdeptree
108+ 
109+ #  import torch before import tensorflow
110+ 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 
111+     cd  /neural-compressor/test ||  exit  1
112+     find .  -name " test*.py"   |  xargs sed -i ' s/import tensorflow as tf/import torch; import tensorflow as tf/g' 
113+     find .  -name " test*.py"   |  xargs sed -i ' s/import tensorflow.compat.v1 as tf/import torch; import tensorflow.compat.v1 as tf/g' 
114+     find .  -name " test*.py"   |  xargs sed -i ' s/from tensorflow import keras/import torch; from tensorflow import keras/g' 
115+ fi 
116+ 
0 commit comments