Skip to content

Commit 858f584

Browse files
atuljangrafacebook-github-bot
authored andcommitted
Move check mem usage inside trace call
Summary: As title. Move the mem usage collection inside the trace call. Reviewed By: gag1jain Differential Revision: D68914259
1 parent b3e19e2 commit 858f584

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)