From 7b0ca011a4ae70b8aadaddad0410f60d4c34aaea Mon Sep 17 00:00:00 2001 From: Sebastian Hoffmann Date: Thu, 28 Mar 2024 17:18:30 +0100 Subject: [PATCH] feat: async transfer -> considerable perf increase --- dmlcloud/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmlcloud/metrics.py b/dmlcloud/metrics.py index 3a2644a..6d70a5e 100644 --- a/dmlcloud/metrics.py +++ b/dmlcloud/metrics.py @@ -231,7 +231,7 @@ def register_metric(self, name, reduction=None, dim=None, globally=True): def track(self, name, value): if isinstance(value, torch.Tensor): - value = value.detach().cpu() + value = value.detach().to('cpu', non_blocking=True) if name not in self: raise ValueError(f'Metric {name} does not exist')