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

Method _log_new_async_chunks

lightx2v/utils/async_vae.py:182–203  ·  view source on GitHub ↗
(self, exposed_wait_ms: float, wait_kind: str)

Source from the content-addressed store, hash-verified

180 return chunks
181
182 def _log_new_async_chunks(self, exposed_wait_ms: float, wait_kind: str) -> None:
183 if not self.enabled:
184 return
185 while self._logged_decode_events < len(self._decode_events):
186 start, end = self._decode_events[self._logged_decode_events]
187 decode_ms = start.elapsed_time(end)
188 # The synchronize wait is the portion of this decode that was still
189 # visible to the caller; the rest was hidden behind later DiT work.
190 visible_ms = exposed_wait_ms if self._logged_decode_events == len(self._decode_events) - 1 else 0.0
191 overlapped_ms = max(decode_ms - visible_ms, 0.0)
192 overlap_ratio = overlapped_ms / decode_ms if decode_ms > 0 else 0.0
193 logger.info(
194 "[AsyncVAEChunkDecoder] async VAE chunk {}/{} gpu_decode={:.2f} ms, {}={:.2f} ms, overlapped={:.2f} ms ({:.1%})",
195 self._logged_decode_events + 1,
196 self._num_submitted,
197 decode_ms,
198 wait_kind,
199 visible_ms,
200 overlapped_ms,
201 overlap_ratio,
202 )
203 self._logged_decode_events += 1
204
205 def _log_timing(self) -> None:
206 if self._num_submitted == 0:

Callers 2

submitMethod · 0.95
finishMethod · 0.95

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected