Remove broken ipex auto detection

This commit is contained in:
Disty0
2023-05-27 09:46:20 +03:00
parent 1da0503de1
commit 95242ca7d6
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -261,7 +261,7 @@ def check_torch():
os.environ.setdefault('PYTORCH_HIP_ALLOC_CONF', 'garbage_collection_threshold:0.9,max_split_size_mb:512')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.0 torchvision==0.15.1 --index-url https://download.pytorch.org/whl/rocm5.4.2')
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none')
elif allow_ipex and (shutil.which('sycl-ls') is not None or os.path.exists('/opt/intel/oneapi') or args.use_ipex):
elif allow_ipex and args.use_ipex and shutil.which('sycl-ls') is not None:
log.info('Intel OneAPI Toolkit detected')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==1.13.0a0 torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu')
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none')
+8 -3
View File
@@ -81,10 +81,15 @@ else
exit 1
fi
if [[ "$@" == *"--use-ipex"* ]]
#Set OneAPI environmet if it's not set by the user
if [[ "$@" == *"--use-ipex"* ]] && ! [ -x "$(command -v sycl-ls)" ]
then
echo "Setting OneAPI enviroment"
source /opt/intel/oneapi/setvars.sh
echo "Setting OneAPI environment"
if [[ -z "$ONEAPI_ROOT" ]]
then
ONEAPI_ROOT=/opt/intel/oneapi
fi
source $ONEAPI_ROOT/setvars.sh
fi
if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]