From d973cce3ca809b44e0794ee044519e8ba91502e1 Mon Sep 17 00:00:00 2001 From: Rohan Potdar Date: Sun, 12 Jul 2026 23:59:20 -0400 Subject: [PATCH] Re-disable CUDA graph memory profiling on ROCm (#48440) Signed-off-by: Rohan Potdar Co-authored-by: Claude Opus 4.8 (1M context) --- vllm/v1/worker/gpu_worker.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vllm/v1/worker/gpu_worker.py b/vllm/v1/worker/gpu_worker.py index 5fb0c38773..871f2f31c0 100644 --- a/vllm/v1/worker/gpu_worker.py +++ b/vllm/v1/worker/gpu_worker.py @@ -492,14 +492,11 @@ class Worker(WorkerBase): ) # Profile CUDA graph memory if graphs will be captured. - # ROCm is included: #44825 moved the profiler to - # torch.accelerator.get_memory_info (reliable on ROCm, as used by - # the AMD-CI mem tests), and graph_pool_handle resolves to the same - # torch.cuda handle the live capture path already uses on ROCm. - # XPU stays excluded (see #39977). + # Skip on ROCm/HIP/XPU as graph pool handles and get_memory_info + # behave differently and can produce incorrect/negative estimates. cudagraph_memory_estimate = 0 if ( - current_platform.is_cuda_alike() + current_platform.is_cuda() and self.vllm_config.compilation_config.cudagraph_mode != CUDAGraphMode.NONE ): @@ -515,7 +512,8 @@ class Worker(WorkerBase): + profile_result.weights_memory ) - # Respect the opt-in flag as originally designed. + # On ROCm, cudagraph_memory_estimate is always 0 so this is a no-op. + # On CUDA, respect the opt-in flag as originally designed. cudagraph_memory_estimate_applied = ( cudagraph_memory_estimate if envs.VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS