Revert bundle-in MKL and DPCPP

This commit is contained in:
Disty0 2023-12-15 14:08:38 +03:00
parent b09d1c0e6f
commit c1ae1d7341
3 changed files with 21 additions and 7 deletions

View File

@ -27,11 +27,7 @@ dependencies:
- --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
- torch==2.1.0a0
- intel-extension-for-pytorch==2.1.10+xpu
- mkl==2024.0.0
- mkl-dpcpp==2024.0.0
- oneccl-bind-pt==2.1.100+xpu; sys_platform == 'linux'
- impi-devel==2021.11.0; sys_platform == 'linux'
- oneccl-devel==2021.11.1; sys_platform == 'linux'
- deepspeed; sys_platform == 'linux'
- openvino
- onnxruntime-openvino

View File

@ -426,7 +426,11 @@ class HFTorchInferenceModel(HFInferenceModel):
if hasattr(torch, "xpu") and torch.xpu.is_available and os.environ.get('DISABLE_IPEX_OPTIMIZE', None) is None:
import intel_extension_for_pytorch as ipex
model = ipex.optimize_transformers(model.eval(), dtype=torch.float16, device="xpu", inplace=True)
model = model.to(memory_format=torch.channels_last)
if hasattr(ipex, "optimize_transformers"):
model = ipex.optimize_transformers(model.eval(), dtype=torch.float16, device="xpu", inplace=True)
else:
model = ipex.optimize(model.eval(), dtype=torch.float16, inplace=True)
except Exception as e:
# ...but fall back to stock HF if lazyloader fails.
if utils.args.panic:
@ -445,7 +449,11 @@ class HFTorchInferenceModel(HFInferenceModel):
if hasattr(torch, "xpu") and torch.xpu.is_available and os.environ.get('DISABLE_IPEX_OPTIMIZE', None) is None:
import intel_extension_for_pytorch as ipex
model = ipex.optimize_transformers(model.eval(), dtype=torch.float16, device="xpu", inplace=True)
model = model.to(memory_format=torch.channels_last)
if hasattr(ipex, "optimize_transformers"):
model = ipex.optimize_transformers(model.eval(), dtype=torch.float16, device="xpu", inplace=True)
else:
model = ipex.optimize(model.eval(), dtype=torch.float16, inplace=True)
if not self.lazy_load and not self.breakmodel:
# We need to move the model to the desired device

View File

@ -4,7 +4,17 @@ if [ ! -f "runtime/envs/koboldai-ipex/bin/python" ]; then
./install_requirements.sh ipex
fi
export LD_LIBRARY_PATH=$(realpath "runtime/envs/koboldai-ipex")/lib/:$LD_LIBRARY_PATH
#Set OneAPI environmet if it's not set by the user
if [ ! -x "$(command -v sycl-ls)" ]
then
echo "Setting OneAPI environment"
if [[ -z "$ONEAPI_ROOT" ]]
then
ONEAPI_ROOT=/opt/intel/oneapi
fi
source $ONEAPI_ROOT/setvars.sh
fi
export LD_PRELOAD=/usr/lib/libstdc++.so
export NEOReadDebugKeys=1
export ClDeviceGlobalMemSizeAvailablePercent=100