[Perf][MRV2] Avoid stream syncs in NonUvaBuffer host-to-device copies (#60215)

Signed-off-by: cheesecake <farzanaman99@gmail.com>
Co-authored-by: William Joyner <133391209+joynerwk03@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cheese Cake
2026-10-07 01:51:12 +00:00
committed by GitHub
co-authored by William Joyner Claude Opus 5.5
parent 283d76d56a
commit 956960f85f
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -54,8 +54,8 @@ class NonUvaBuffer:
def uva(self, n: int | None = None) -> torch.Tensor:
if n is None:
return self._uva.copy_(self.cpu)
return self._uva[:n].copy_(self.cpu[:n])
return self._uva.copy_(self.cpu, non_blocking=True)
return self._uva[:n].copy_(self.cpu[:n], non_blocking=True)
class UvaBufferPool: