(self, exc_type, exc_val, exc_tb)
| 169 | logger.info(f"[Profile] {self.rank_info} - {self.name} cost {display_elapsed:.6f} {self.time_unit}{memory_suffix}{suffix}") |
| 170 | return False |
| 171 | |
| 172 | async def __aenter__(self): |
| 173 | self.rank_info = f"Rank {dist.get_rank()}" if dist.is_initialized() else "Single GPU" |
| 174 | self._skip_sync = _is_profiler_no_sync_active() |
| 175 | if not self._skip_sync: |
| 176 | torch_device_module.synchronize() |
| 177 | self._begin_memory_profile() |
| 178 | self.start_time = time.perf_counter() |
| 179 | _get_excluded_time_stack().append(0.0) |
| 180 | return self |
| 181 | |
| 182 | async def __aexit__(self, exc_type, exc_val, exc_tb): |
| 183 | if not self._skip_sync: |
| 184 | torch_device_module.synchronize() |
nothing calls this directly
no test coverage detected