Skip to content

Commit 16cca22

Browse files
faaanyhlky
andauthored
Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <[email protected]>
1 parent d1532d2 commit 16cca22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/diffusers/utils/testing_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,15 @@ def _is_torch_fp64_available(device):
10891089
"xpu": torch.xpu.reset_peak_memory_stats,
10901090
"default": None,
10911091
}
1092+
BACKEND_RESET_MAX_MEMORY_ALLOCATED = {
1093+
"cuda": torch.cuda.reset_max_memory_allocated,
1094+
"default": None,
1095+
}
1096+
BACKEND_MAX_MEMORY_ALLOCATED = {
1097+
"cuda": torch.cuda.max_memory_allocated,
1098+
"xpu": torch.xpu.max_memory_allocated,
1099+
"default": 0,
1100+
}
10921101

10931102

10941103
# This dispatches a defined function according to the accelerator from the function definitions.

0 commit comments

Comments
 (0)