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

Method finish

lightx2v/utils/async_vae.py:162–180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 output.record_stream(stream)
161
162 def finish(self) -> list[torch.Tensor]:
163 if self._stream is not None:
164 t0 = time.perf_counter()
165 self._stream.synchronize()
166 wait_ms = (time.perf_counter() - t0) * 1000.0
167 self._finish_wait_ms += wait_ms
168 self._log_new_async_chunks(wait_ms, wait_kind="finish_wait")
169 self._log_timing()
170 chunks = self._chunks
171 self._chunks = []
172 self._prev_vae_done = None
173 self._decode_events = []
174 self._num_submitted = 0
175 self._sync_decode_ms = 0.0
176 self._submit_wait_ms = 0.0
177 self._finish_wait_ms = 0.0
178 self._logged_decode_events = 0
179 self._restore_vae()
180 return chunks
181
182 def _log_new_async_chunks(self, exposed_wait_ms: float, wait_kind: str) -> None:
183 if not self.enabled:

Callers 3

run_mainMethod · 0.80
run_mainMethod · 0.80
run_mainMethod · 0.80

Calls 3

_log_new_async_chunksMethod · 0.95
_log_timingMethod · 0.95
_restore_vaeMethod · 0.95

Tested by

no test coverage detected