[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:
co-authored by
William Joyner
Claude Opus 5.5
parent
283d76d56a
commit
956960f85f
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user