[Core] Ensure memory is pinned prior to async h2d copy (#45424)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-06-20 20:02:24 -07:00
committed by GitHub
parent 8dd1b702f2
commit 7df3d7dada
49 changed files with 254 additions and 264 deletions
+2 -2
View File
@@ -545,7 +545,7 @@ def update_ngram_gpu_tensors_incremental(
num_tokens = input_batch.num_tokens_no_spec[idx]
if num_tokens > 0:
token_ids_gpu_tensor[idx, :num_tokens].copy_(
input_batch.token_ids_cpu_tensor[idx, :num_tokens],
input_batch.token_ids_cpu_tensor[idx, :num_tokens].pin_memory(),
non_blocking=True,
)
@@ -591,7 +591,7 @@ def update_ngram_gpu_tensors_incremental(
num_tokens = input_batch.num_tokens_no_spec[new_req_idx]
if num_tokens > 0:
token_ids_gpu_tensor[new_req_idx, :num_tokens].copy_(
input_batch.token_ids_cpu_tensor[new_req_idx, :num_tokens],
input_batch.token_ids_cpu_tensor[new_req_idx, :num_tokens].pin_memory(),
non_blocking=True,
)