[Core][MM] Use non-blocking CPU-GPU copy of multimodal data (#28141)

Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
This commit is contained in:
Lukas Geiger 2025-11-06 04:05:12 +00:00 committed by GitHub
parent 43ecd0a900
commit 80679f108f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -444,7 +444,9 @@ def group_mm_kwargs_by_modality(
if device is not None: if device is not None:
mm_kwargs_group = json_map_leaves( mm_kwargs_group = json_map_leaves(
lambda x: x.to(device=device) if isinstance(x, torch.Tensor) else x, lambda x: x.to(device=device, non_blocking=True)
if isinstance(x, torch.Tensor)
else x,
mm_kwargs_group, mm_kwargs_group,
) )
else: else: