diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2225fd9..a6f65d246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,7 +125,8 @@ However, improves compatibilty and performance fixes random memory leaks - remove IPEX / Torch 2.0 specific hijacks - - add `IPEX_SDPA_SLICE_TRIGGER_RATE` and `IPEX_ATTENTION_SLICE_RATE` env variables + - add `IPEX_SDPA_SLICE_TRIGGER_RATE`, `IPEX_ATTENTION_SLICE_RATE` and `IPEX_FORCE_ATTENTION_SLICE` env variables + - disable 1024x1024 workaround if the GPU supports 64 bit - fix lock-ups at very high resolutions - **OpenVINO**, thanks @disty0 - **4-bit support with NNCF** diff --git a/modules/intel/ipex/hijacks.py b/modules/intel/ipex/hijacks.py index 34522941f..d4fa8441c 100644 --- a/modules/intel/ipex/hijacks.py +++ b/modules/intel/ipex/hijacks.py @@ -1,3 +1,4 @@ +import os from functools import wraps from contextlib import nullcontext import torch @@ -60,7 +61,7 @@ def from_numpy(ndarray): else: return original_from_numpy(ndarray) -if torch.xpu.has_fp64_dtype(): +if torch.xpu.has_fp64_dtype() and os.environ.get('IPEX_FORCE_ATTENTION_SLICE', None) is None: original_torch_bmm = torch.bmm original_scaled_dot_product_attention = torch.nn.functional.scaled_dot_product_attention else: diff --git a/modules/processing.py b/modules/processing.py index 7a0cd8525..ca0147ce3 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -165,7 +165,7 @@ class StableDiffusionProcessing: self.image_cfg_scale = image_cfg_scale self.diffusers_guidance_rescale = diffusers_guidance_rescale self.sag_scale = sag_scale - if devices.backend == "ipex" and width == 1024 and height == 1024 and os.environ.get('DISABLE_IPEX_1024_WA', None) is None: + if devices.backend == "ipex" and width == 1024 and height == 1024 and not torch.xpu.has_fp64_dtype() and os.environ.get('DISABLE_IPEX_1024_WA', None) is None: width = 1080 height = 1080 self.width: int = width @@ -1064,7 +1064,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): def __init__(self, enable_hr: bool = False, denoising_strength: float = 0.75, firstphase_width: int = 0, firstphase_height: int = 0, hr_scale: float = 2.0, hr_force: bool = False, hr_upscaler: str = None, hr_second_pass_steps: int = 0, hr_resize_x: int = 0, hr_resize_y: int = 0, refiner_steps: int = 5, refiner_start: float = 0, refiner_prompt: str = '', refiner_negative: str = '', **kwargs): super().__init__(**kwargs) - if devices.backend == "ipex" and os.environ.get('DISABLE_IPEX_1024_WA', None) is None: + if devices.backend == "ipex" and not torch.xpu.has_fp64_dtype() and os.environ.get('DISABLE_IPEX_1024_WA', None) is None: width_curse = bool(hr_resize_x == 1024 and self.height * (hr_resize_x / self.width) == 1024) height_curse = bool(hr_resize_y == 1024 and self.width * (hr_resize_y / self.height) == 1024) if (width_curse != height_curse) or (height_curse and width_curse): diff --git a/webui.sh b/webui.sh index 1fc9121de..bdcb55191 100755 --- a/webui.sh +++ b/webui.sh @@ -82,7 +82,7 @@ fi if [ -d "$(realpath "$venv_dir")/lib/" ] && [[ -z "${DISABLE_VENV_LIBS}" ]] then - export LD_LIBRARY_PATH=$(realpath "$venv_dir")/lib/:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(realpath "$venv_dir")/lib/ fi if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]