Skip to content

Commit b07cf90

Browse files
atuljangrafacebook-github-bot
authored andcommittedJan 31, 2025·
Move check mem usage inside trace call (#2715)
Summary: Pull Request resolved: #2715 As title. Move the mem usage collection inside the trace call. Reviewed By: gag1jain, satgera Differential Revision: D68914259 fbshipit-source-id: bab5153f5b452497c468244eab6687a5e43d1460
1 parent b3e19e2 commit b07cf90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎torchrec/metrics/metric_module.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ def compute(self) -> Dict[str, MetricValue]:
353353
right before logging the metrics results to the data sink.
354354
"""
355355
self.compute_count += 1
356-
self.check_memory_usage(self.compute_count)
357356
with record_function("## RecMetricModule:compute ##"):
357+
self.check_memory_usage(self.compute_count)
358358
ret: Dict[str, MetricValue] = {}
359359
if self.rec_metrics:
360360
self._adjust_compute_interval()

0 commit comments

Comments
 (0)
Please sign in to comment.