From 2deccf2c8806220fe00e457d053465a049f38407 Mon Sep 17 00:00:00 2001 From: Mihir Patel Date: Thu, 4 Jan 2024 15:21:46 -0700 Subject: [PATCH] fix profiler (#2818) --- composer/profiler/torch_profiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/profiler/torch_profiler.py b/composer/profiler/torch_profiler.py index a372dc2c04..a8c51bb27b 100644 --- a/composer/profiler/torch_profiler.py +++ b/composer/profiler/torch_profiler.py @@ -342,7 +342,7 @@ def batch_start(self, state: State, logger: Logger) -> None: def close(self, state: State, logger: Logger) -> None: del state, logger # unused - if self.profiler is not None: + if self.profiler is not None and self.profiler.profiler is not None: log.info(self.profiler.key_averages().table(sort_by='cpu_time_total', row_limit=20)) if self.profile_memory: log.info(self.profiler.key_averages().table(sort_by='self_cpu_memory_usage', row_limit=20))