From 42bff706df6bbd4af7be178433e444910f599322 Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhang <35585791+BBuf@users.noreply.github.com> Date: Sun, 21 Dec 2025 12:56:46 +0800 Subject: [PATCH] [diffusion] profiling: simplify `--perf-dump-path` JSON output (remove duplicate denoise steps) (#15537) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- python/sglang/multimodal_gen/docs/profiling.md | 2 ++ python/sglang/multimodal_gen/runtime/utils/perf_logger.py | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/sglang/multimodal_gen/docs/profiling.md b/python/sglang/multimodal_gen/docs/profiling.md index 7d039557f..cf7ddc215 100644 --- a/python/sglang/multimodal_gen/docs/profiling.md +++ b/python/sglang/multimodal_gen/docs/profiling.md @@ -67,6 +67,8 @@ Besides profiler traces, you can also dump a lightweight JSON report that contai This is useful to quickly identify which stage dominates end-to-end latency, and whether denoising steps have uniform runtimes (and if not, which step has an abnormal spike). +The dumped JSON contains a `denoise_steps_ms` field formatted as an array of objects, each with a `step` key (the step index) and a `duration_ms` key. + Example: ```bash diff --git a/python/sglang/multimodal_gen/runtime/utils/perf_logger.py b/python/sglang/multimodal_gen/runtime/utils/perf_logger.py index 2afa203fc..d76233696 100644 --- a/python/sglang/multimodal_gen/runtime/utils/perf_logger.py +++ b/python/sglang/multimodal_gen/runtime/utils/perf_logger.py @@ -207,10 +207,9 @@ class PerformanceLogger: for name, duration_ms in timings.stages.items() ] - denoise_steps_ms = list(timings.steps) - denoise_steps = [ - {"index": idx, "duration_ms": duration_ms} - for idx, duration_ms in enumerate(denoise_steps_ms) + denoise_steps_ms = [ + {"step": idx, "duration_ms": duration_ms} + for idx, duration_ms in enumerate(timings.steps) ] report = { @@ -221,7 +220,6 @@ class PerformanceLogger: "total_duration_ms": timings.total_duration_ms, "steps": formatted_steps, "denoise_steps_ms": denoise_steps_ms, - "denoise_steps": denoise_steps, "meta": meta or {}, }