Upcast bf16 fftn to fp32

This commit is contained in:
Disty0
2024-09-23 22:53:40 +03:00
parent 31b66cfa4a
commit 4de0480d9f
2 changed files with 42 additions and 2 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ device_supports_fp64 = torch.xpu.has_fp64_dtype() if hasattr(torch.xpu, "has_fp6
attention_slice_rate = float(os.environ.get('IPEX_ATTENTION_SLICE_RATE', 4))
# Force FP32 upcast
# diffusers is imported before ipex hijacks and doesn't apply so hijack this separately
# Diffusers FreeU
# Diffusers is imported before ipex hijacks so fourier_filter needs hijacking too
original_fourier_filter = diffusers.utils.torch_utils.fourier_filter
@wraps(diffusers.utils.torch_utils.fourier_filter)
def fourier_filter(x_in, threshold, scale):