From 5e1da44bbaac349e4dbe05aeb9d1d82130b79f24 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 18 Aug 2024 05:22:11 +0300 Subject: [PATCH] IPEX fix custom_fwd x2 --- modules/intel/ipex/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/intel/ipex/__init__.py b/modules/intel/ipex/__init__.py index 79cafd155..38fc81c07 100644 --- a/modules/intel/ipex/__init__.py +++ b/modules/intel/ipex/__init__.py @@ -149,8 +149,8 @@ def ipex_init(): # pylint: disable=too-many-statements # AMP: if legacy: - torch.xpu.amp.custom_fwd = torch.amp.custom_fwd - torch.xpu.amp.custom_bwd = torch.amp.custom_bwd + torch.xpu.amp.custom_fwd = torch.cuda.amp.custom_fwd + torch.xpu.amp.custom_bwd = torch.cuda.amp.custom_bwd torch.cuda.amp = torch.xpu.amp torch.is_autocast_enabled = torch.xpu.is_autocast_xpu_enabled torch.get_autocast_gpu_dtype = torch.xpu.get_autocast_xpu_dtype