Skip to content

Commit b813f16

Browse files
committed
bug fix
1 parent d820f75 commit b813f16

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/diffusers/utils/testing_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,20 +1081,28 @@ def _is_torch_fp64_available(device):
10811081
"cuda": torch.cuda.manual_seed,
10821082
"xpu": torch.xpu.manual_seed,
10831083
"cpu": torch.manual_seed,
1084+
"mps": torch.mps.manual_seed,
10841085
"default": torch.manual_seed,
10851086
}
10861087
BACKEND_RESET_PEAK_MEMORY_STATS = {
10871088
"cuda": torch.cuda.reset_peak_memory_stats,
10881089
"xpu": getattr(torch.xpu, "reset_peak_memory_stats", None),
1090+
"cpu": None,
1091+
"mps": None,
10891092
"default": None,
10901093
}
10911094
BACKEND_RESET_MAX_MEMORY_ALLOCATED = {
10921095
"cuda": torch.cuda.reset_max_memory_allocated,
1096+
"xpu": None,
1097+
"cpu": None,
1098+
"mps": None,
10931099
"default": None,
10941100
}
10951101
BACKEND_MAX_MEMORY_ALLOCATED = {
10961102
"cuda": torch.cuda.max_memory_allocated,
10971103
"xpu": getattr(torch.xpu, "max_memory_allocated", None),
1104+
"cpu": 0,
1105+
"mps": 0,
10981106
"default": 0,
10991107
}
11001108

0 commit comments

Comments
 (0)