[CI] [AMD] diffusion: Drain the Cosmos Dreams decode stream after freeing its outputs (#45983)

This commit is contained in:
Michael
2026-10-23 13:26:56 -07:00
committed by GitHub
parent 1d605b7ece
commit 194abb8e54
@@ -872,11 +872,13 @@ class CausalDecodeQueue:
def __exit__(self, exc_type, exc_value, traceback) -> None:
try:
self.stream.synchronize()
finally:
self.vae.reset_causal_decode_state()
if exc_type is not None:
self.outputs.clear()
finally:
# Drain last: freeing pinned outputs records host-allocator events
# on this stream, so they must land before the final sync.
self.stream.synchronize()
def _denormalize(self, latents: torch.Tensor) -> torch.Tensor:
return denormalize_vae_latents(latents, self._mean, self._std)