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 6, 13:15 UTC
[Bugfix][ROCm] Fix worker startup OOM on ROCm by skipping unreliable cudagraph memory profiling (#36720)
Signed-off-by: JartX <sagformas@epdcenter.es>
JartX committed
Mar 17, 2026 at 22:55 UTC
e8f9dbc369aa2086ec1e1fe3b104c582812cfc17
1 file changed
+5
-2
vllm/v1/worker/gpu_worker.py
+5
-2
@@ -392,8 +392,10 @@ class Worker(WorkerBase):
392
)
393
394
# Profile CUDA graph memory if graphs will be captured.
395
+ # Skip on ROCm/HIP as graph pool handles and mem_get_info behave
396
+ # differently and can produce incorrect/negative estimates.
397
cudagraph_memory_estimate = 0
396
- if not self.model_config.enforce_eager:
398
+ if not self.model_config.enforce_eager and not current_platform.is_rocm():
399
cudagraph_memory_estimate = self.model_runner.profile_cudagraph_memory()
400
401
# Use the pre-cudagraph torch peak to avoid double-counting.
@@ -406,6 +408,8 @@ class Worker(WorkerBase):
408
+ profile_result.weights_memory
409
)
410
411
+ # On ROCm, cudagraph_memory_estimate is always 0 so this is a no-op.
412
+ # On CUDA, respect the opt-in flag as originally designed.
413
cudagraph_memory_estimate_applied = (
414
cudagraph_memory_estimate
415
if envs.VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS
@@ -517,7 +521,6 @@ class Worker(WorkerBase):
521
522
def update_max_model_len(self, max_model_len: int) -> None:
523
"""Update max_model_len after auto-fit to GPU memory.
520
-
524
This is called when max_model_len=-1 is used and the engine
525
automatically determines the maximum context length that fits
526
in GPU memory. Workers need to update their cached max_model_len