[Bugfix][ROCm] Capture CUDA graphs on the current stream (#53818)

Signed-off-by: fanxingran <xingran.fan@amd.com>
This commit is contained in:
fanxingran
2026-08-26 23:16:45 +08:00
committed by GitHub
parent 28b484e5d7
commit 080a66a69c
3 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -20,6 +20,7 @@ from vllm.model_executor.models.interfaces import (
from vllm.model_executor.models.utils import scatter_output_slices
from vllm.model_executor.models.vision import get_load_balance_assignment
from vllm.utils.gpu_sync_debug import gpu_sync_allowed
from vllm.utils.torch_utils import current_stream
from vllm.v1.worker.encoder_cudagraph_defs import (
EncoderCudaGraphConfig,
EncoderItemSpec,
@@ -270,7 +271,10 @@ class EncoderCudaGraphManager:
output_buffer = torch.empty_like(output)
graph = torch.cuda.CUDAGraph()
with torch.inference_mode(), torch.cuda.graph(graph, pool=self.graph_pool):
with (
torch.inference_mode(),
torch.cuda.graph(graph, pool=self.graph_pool, stream=current_stream()),
):
output = self.model.encoder_cudagraph_forward({**values}, path=path)
output_buffer.copy_(output)