[ROCm] Using a more precise memory profiling (#12624)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
This commit is contained in:
Gregory Shtrasberg 2025-02-11 08:47:10 -05:00 committed by GitHub
parent 9cf4759493
commit 7539bbc6a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -169,4 +169,5 @@ class RocmPlatform(Platform):
device: Optional[torch.types.Device] = None
) -> float:
torch.cuda.reset_peak_memory_stats(device)
return torch.cuda.max_memory_allocated(device)
return torch.cuda.mem_get_info(device)[1] - torch.cuda.mem_get_info(
device)[0]