Skip to content

Commit

Permalink
Remove broken ipex auto detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Disty0 committed May 27, 2023
1 parent 1da0503 commit 95242ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
11 changes: 8 additions & 3 deletions webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)" ]
Expand Down

1 comment on commit 95242ca

@Disty0
Copy link
Collaborator Author

@Disty0 Disty0 commented on 95242ca May 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto detection for ipex in installer.py didn't pass --use-ipex argument to launch.py so i removed auto detection for now.
It was confusing users.

For setting OneAPI environment in webui.sh:
Users had to set it manually before starting the script or had to use another script that includes it.
So i added this in webui.sh

Please sign in to comment.