Enable Diffusion Image models asynchronous output (#4981)
Signed-off-by: zzh <943967662@qq.com> Co-authored-by: dengyunyang <584797741@qq.com>
This commit is contained in:
1 parent
f2d9eb1630
commit
dba05c3517
22 files changed
+1440
-72
No files matched your search
@@ -190,6 +190,24 @@ class OmniPlatform(Platform):
|
||||
def synchronize(cls) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
# ── Async diffusion output: cross-stream sync ──
|
||||
|
||||
@classmethod
|
||||
def record_device_event(cls):
|
||||
"""Record a device event on the default stream to mark tensor readiness.
|
||||
|
||||
On platforms where distributed communication (e.g. HCCL) may use
|
||||
internal streams not visible to the default stream, this method
|
||||
should synchronize the default stream before recording the event
|
||||
to ensure the event captures all completed work including
|
||||
cross-device communication results.
|
||||
|
||||
Returns ``None`` by default so that platforms without a native
|
||||
implementation (ROCm, XPU, MUSA) fall through to a safe no-op.
|
||||
Override in platform subclasses to provide real event support.
|
||||
"""
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_free_memory(cls, device: torch.device | None = None) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in new issue
Block a user