Skip to content

Commit dfdc219

Browse files
authored
use reset_peak_memory_stats on xpu (#3772)
Signed-off-by: YAO Matrix <matrix.yao@intel.com>
1 parent 45959d7 commit dfdc219

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/accelerate/test_utils/scripts/external_deps/test_peak_memory_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __enter__(self):
6969
self.begin = torch.npu.memory_allocated()
7070
elif is_xpu_available():
7171
torch.xpu.empty_cache()
72-
torch.xpu.reset_max_memory_allocated() # reset the peak gauge to zero
72+
torch.xpu.reset_peak_memory_stats() # reset the peak gauge to zero
7373
self.begin = torch.xpu.memory_allocated()
7474
elif is_hpu_available():
7575
# torch.hpu.empty_cache() # not available on hpu as it reserves all device memory for the current process

0 commit comments

Comments
 (0)