From bee8ac5b881ec16701a1038061c8289f873baa10 Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhang <35585791+BBuf@users.noreply.github.com> Date: Sun, 21 Dec 2025 00:15:27 +0800 Subject: [PATCH] [diffusion] doc: add `--perf-dump-path` section to profiling doc (#15533) --- python/sglang/multimodal_gen/docs/profiling.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/sglang/multimodal_gen/docs/profiling.md b/python/sglang/multimodal_gen/docs/profiling.md index 62c2da78b..7d039557f 100644 --- a/python/sglang/multimodal_gen/docs/profiling.md +++ b/python/sglang/multimodal_gen/docs/profiling.md @@ -58,6 +58,24 @@ Load and visualize trace files at: For large trace files, reduce `--num-profiled-timesteps` or avoid using `--profile-all-stages`. + +### `--perf-dump-path` (Stage/Step Timing Dump) + +Besides profiler traces, you can also dump a lightweight JSON report that contains: +- stage-level timing breakdown for the full pipeline +- step-level timing breakdown for the denoising stage (per diffusion step) + +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). + +Example: + +```bash +sglang generate \ + --model-path \ + --prompt "" \ + --perf-dump-path perf.json +``` + ## Nsight Systems Nsight Systems provides low-level CUDA profiling with kernel details, register usage, and memory access patterns.