[Core] Implement Diffusion Profiler Support (#709)

Signed-off-by: lishunyang <lishunyang12@163.com>
Signed-off-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
This commit is contained in:
SYLAR authored and GitHub committed 2026-01-20 11:35:48 +08:00
1 parent 3fc4f988ea
commit a1c37cc6e3
13 files changed
+610 -68

No files matched your search

+23
View File
@@ -126,3 +126,26 @@ class OmniDiffusion:
self.close()
except Exception:
pass
def start_profile(self, trace_filename: str | None = None) -> None:
"""Start profiling for the diffusion model.
Args:
trace_filename: Optional base filename for trace files.
If None, a timestamp-based name will be generated.
"""
if hasattr(self, "engine") and self.engine:
self.engine.start_profile(trace_filename)
else:
raise RuntimeError("Diffusion engine not initialized")
def stop_profile(self) -> dict:
"""Stop profiling and return profiling results.
Returns:
Dictionary containing paths to trace and table files.
"""
if hasattr(self, "engine") and self.engine:
return self.engine.stop_profile()
else:
raise RuntimeError("Diffusion engine not initialized")