Skip to content
Merged
14 changes: 9 additions & 5 deletions vllm/config/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2527,9 +2527,8 @@ def _resolve_mm_processor_device(self) -> None:
)

def _resolve_mm_video_decode_device(self) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something? Where does the check for encode-only instance occur?

@Isotr0py Isotr0py Sep 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed this one, fixed in https://github.com/vllm-project/vllm/pull/53675/changes/84b1d07d55e22bdfa0980b3905a8ab147e03c9e8..62adfadc317bc604e5f4d87e64a6cfad8353e86b

(I think we should clean the processor/mediaio device resolver function in followup PR, it's a bit messy 😅)

@Isotr0py Isotr0py Sep 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, after second thought, I think we should tie video decode device with mm processor device instead, otherwise it will cause duplicated d2h/h2d transfer. 🤔

"""Default video decoding to NVDEC when the processor runs on the
accelerator (an EPD encode-only instance, see
`_resolve_mm_processor_device`).
"""Default video decoding to NVDEC on an EPD encode-only instance
whose processor runs on the accelerator.

The processor consumes the decoded frames on-device in that case, so
keeping the frames on the GPU skips the host round-trip through the
Expand All @@ -2547,9 +2546,14 @@ def _resolve_mm_video_decode_device(self) -> None:
from vllm.platforms import current_platform

device_type = current_platform.device_type
if device_type in ("", "cpu"):
if device_type != "cuda":
return
if mm_config.get_mm_processor_device_type() != device_type:

ec_config = self.ec_transfer_config
# An EC producer that is not also a consumer runs no forward pass and
# allocates no KV cache, so frontend accelerator work has the device to
# itself.
if ec_config is None or not ec_config.is_encode_only:
return

video_kwargs = mm_config.media_io_kwargs.setdefault("video", {})
Expand Down