[Perf] Ensure async h2d copies are pinned in more places (#55202)

This commit is contained in:
Nick Hill
2026-09-04 17:17:01 -07:00
committed by GitHub
parent 874df9373d
commit 8277c42e4c
21 changed files with 206 additions and 73 deletions
+2 -2
View File
@@ -643,8 +643,8 @@ class TransformerEncoderBase(abc.ABC, nn.Module):
seq_len, batch_size, chunk_size_nc, left_chunk_nc
)
if device.type != "cpu":
enc_streaming_mask_nc = enc_streaming_mask_nc.contiguous().to(
device, non_blocking=True
enc_streaming_mask_nc = async_tensor_h2d(
enc_streaming_mask_nc.contiguous(), device
)
if masks is not None:
hs_mask_nc = masks & enc_streaming_mask_nc