From d15a3cc5a5546b7bdc146582dba7c832ecd815d5 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Wed, 8 Jan 2025 14:09:54 -0800 Subject: [PATCH] Remove unnecessary copy of gradients in util (#144329) Summary: No need to copy gradients to CPU too X-link: https://github.com/pytorch/pytorch/pull/144329 Approved by: https://github.com/awgu, https://github.com/cyyever Reviewed By: clee2000 Differential Revision: D67943148 fbshipit-source-id: dea67477dbc0a791cf4a8c72ca7c9e4d4381cc54 --- userbenchmark/dynamo/dynamobench/_dynamo/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py index 12a9376d7..5cbba76a9 100644 --- a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py +++ b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py @@ -2492,7 +2492,7 @@ def to_tensor(t): return True score = torch.nn.functional.cosine_similarity(ref, res, dim=0, eps=1e-6) if score < 0.99: - log.warning("Similarity score=%s", score.cpu().detach().item()) + log.warning("Similarity score=%s", score.detach().cpu().item()) return score >= 0.99 else: if not exact_dtype: