diff --git a/installer.py b/installer.py index 0f14c3f3d..829f4fe3f 100644 --- a/installer.py +++ b/installer.py @@ -803,6 +803,9 @@ def install_ipex(): if os.environ.get("PYTORCH_ENABLE_XPU_FALLBACK", None) is None: os.environ.setdefault('PYTORCH_ENABLE_XPU_FALLBACK', '1') # CPU fallback for unsupported ops + if os.environ.get("UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS", None) is None: + os.environ.setdefault('UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS', '1') # Work around the 4G alloc limit on Alchemist + # FP64 emulation causes random UR Errors #if os.environ.get("OverrideDefaultFP64Settings", None) is None: # os.environ.setdefault('OverrideDefaultFP64Settings', '1') diff --git a/modules/intel/ipex/hijacks.py b/modules/intel/ipex/hijacks.py index a359fefc7..eb8936c3a 100644 --- a/modules/intel/ipex/hijacks.py +++ b/modules/intel/ipex/hijacks.py @@ -17,14 +17,6 @@ device_supports_fp64 = torch.xpu.has_fp64_dtype() if hasattr(torch.xpu, "has_fp6 if os.environ.get('IPEX_FORCE_ATTENTION_SLICE', '0') == '0': if torch_version[0] > 2 or (torch_version[0] == 2 and torch_version[1] >= 7): use_dynamic_attention = False # torch 2.7 has flash atten support - elif (torch.xpu.get_device_properties(devices.device).total_memory / 1024 / 1024 / 1024) > 4.1: - try: - x = torch.ones((33000,33000), dtype=torch.float32, device=devices.device) - del x - torch.xpu.empty_cache() - use_dynamic_attention = False - except Exception: - use_dynamic_attention = True else: use_dynamic_attention = True else: