MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __exit__

Method __exit__

lightx2v/utils/profiler.py:171–181  ·  view source on GitHub ↗
(self, exc_type, exc_val, exc_tb)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 3

_get_excluded_time_stackFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected