[Perf] Pin CPU tensors before non_blocking H2D in three MM paths (#54292)

Signed-off-by: Keyi Li <likey6688@gmail.com>
Co-authored-by: Keyi Li <likey6688@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Keyi Li
2026-08-28 20:13:40 -07:00
committed by GitHub
co-authored by Keyi Li Claude Opus 4.7
parent 93ab92be0c
commit 46a83642f6
3 changed files with 5 additions and 11 deletions
+2 -3
View File
@@ -37,6 +37,7 @@ from vllm.model_executor.models.vision import (
)
from vllm.platforms import current_platform
from vllm.transformers_utils.configs.kimi_k25 import KimiK25VisionConfig
from vllm.utils.torch_utils import async_tensor_h2d
logger = init_logger(__name__)
@@ -821,9 +822,7 @@ class MoonViT3dPretrainedModel(nn.Module):
merge_gather_idx = build_image_merge_gather_idx(
grid_thw_list, self.merge_kernel_size
)
metadata["merge_gather_idx"] = torch.from_numpy(merge_gather_idx).to(
device=device, non_blocking=True
)
metadata["merge_gather_idx"] = async_tensor_h2d(merge_gather_idx, device=device)
return metadata