[Perf][4/n] Eliminate various GPU<->CPU syncs (#42347)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-05-19 10:35:54 -04:00
committed by GitHub
parent a78b842d0e
commit b82e908b4c
23 changed files with 129 additions and 108 deletions
+4 -2
View File
@@ -5,6 +5,8 @@ from typing import TYPE_CHECKING
import torch
from vllm.utils.torch_utils import async_tensor_h2d
if TYPE_CHECKING:
# avoid circuit import
from vllm.lora.layers import LoRAMapping
@@ -110,8 +112,8 @@ def convert_mapping(
embedding_indices,
]
indices = torch.tensor(indices_list, dtype=torch.long, device=device)
prompt_mapping_tensor = torch.tensor(
indices = async_tensor_h2d(indices_list, dtype=torch.long, device=device)
prompt_mapping_tensor = async_tensor_h2d(
prompt_mapping, dtype=torch.long, device=device
)
embeddings_indices = torch.stack(