From a7f07c1ef592fdcd60f37b1481bebb3de9705808 Mon Sep 17 00:00:00 2001 From: Yao Matrix Date: Wed, 2 Apr 2025 14:25:48 +0800 Subject: [PATCH] map BACKEND_RESET_MAX_MEMORY_ALLOCATED to reset_peak_memory_stats on XPU (#11191) Signed-off-by: YAO Matrix --- src/diffusers/utils/testing_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffusers/utils/testing_utils.py b/src/diffusers/utils/testing_utils.py index 1374209453..e62f245f9e 100644 --- a/src/diffusers/utils/testing_utils.py +++ b/src/diffusers/utils/testing_utils.py @@ -1161,7 +1161,7 @@ if is_torch_available(): } BACKEND_RESET_MAX_MEMORY_ALLOCATED = { "cuda": torch.cuda.reset_max_memory_allocated, - "xpu": None, + "xpu": getattr(torch.xpu, "reset_peak_memory_stats", None), "cpu": None, "mps": None, "default": None,