@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 157caf511b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 14:45 UTC

[Perf] avoid duplicate mem_get_info() call in get_current_memory_usage (#33064)

Signed-off-by: Paco Xu <paco.xu@daocloud.io>

Paco Xu committed Jan 27, 2026 at 11:45 UTC 157caf511b5264c1b93610e5dcde04f70fd9d676
1 file changed +2 -1
vllm/platforms/rocm.py
+2 -1
@@ -561,7 +561,8 @@ class RocmPlatform(Platform):
561 cls, device: torch.types.Device | None = None
562 ) -> float:
563 torch.cuda.reset_peak_memory_stats(device)
564 - return torch.cuda.mem_get_info(device)[1] - torch.cuda.mem_get_info(device)[0]
564 + free_mem, total_mem = torch.cuda.mem_get_info(device)
565 + return total_mem - free_mem
566
567 @classmethod
568 def get_device_communicator_cls(cls) -> str: