From c9f5d1d5028c66cb61968d5830c91eefbfe3695d Mon Sep 17 00:00:00 2001 From: yuefeng Wu <33725817+ChefWu551@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:53:10 +0800 Subject: [PATCH] [Diffusion][NPU] add ring sp performance benchmark page in npu (#21811) --- docs/platforms/ascend/ascend_npu_support.rst | 1 + .../ascend_npu_ring_sp_performance.md | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 docs/platforms/ascend_npu_ring_sp_performance.md diff --git a/docs/platforms/ascend/ascend_npu_support.rst b/docs/platforms/ascend/ascend_npu_support.rst index 3ec28b837..a579cbfb1 100644 --- a/docs/platforms/ascend/ascend_npu_support.rst +++ b/docs/platforms/ascend/ascend_npu_support.rst @@ -13,6 +13,7 @@ Ascend NPUs mindspore_backend.md ascend_contribution_guide.md ascend_npu_best_practice.md + ascend_npu_ring_sp_performance.md ascend_npu_qwen3_5_examples.md ascend_npu_glm5_examples.md ascend_npu_environment_variables.md diff --git a/docs/platforms/ascend_npu_ring_sp_performance.md b/docs/platforms/ascend_npu_ring_sp_performance.md new file mode 100644 index 000000000..014328aef --- /dev/null +++ b/docs/platforms/ascend_npu_ring_sp_performance.md @@ -0,0 +1,55 @@ +# Ascend NPU Ring-SP Performance (Wan2.1-T2V-1.3B) + +This page reports Ring-SP performance on Ascend NPU with `torch_npu==2.10.0`. + +- Baseline config: `ulysses=1, ring=1` (short: `u1r1`) +- Ring-SP config: `ulysses=1, ring=2` (short: `u1r2`) + +## Benchmark Setup + +- Model: `Wan2.1-T2V-1.3B-Diffusers` +- Prompt: `"a cat is playing piano"` +- Framework command: `sglang generate` +- Runtime: `torch_npu==2.10.0` + +## Generate Commands + +### Baseline (`u1r1`) + +```bash +sglang generate --model-path /nas/disk1/Wan2.1-T2V-1.3B-Diffusers \ + --prompt "a cat is playing piano" --num-gpus 1 --ring-degree 1 \ + --save-output +``` + +### Ring-SP (`u1r2`) + +```bash +sglang generate --model-path /nas/disk1/Wan2.1-T2V-1.3B-Diffusers \ + --prompt "a cat is playing piano" --num-gpus 2 --ring-degree 2 \ + --save-output +``` + +## Benchmarks + +Benchmark Disclaimer + +These numbers are from one fixed setup and one prompt case. Actual performance may vary by model settings, environment, and workload. + +### Stage Time Breakdown + +| Stage / Metric | `u1r2` (s) | `u1r1` baseline (s) | Speedup | +|---|---:|---:|---:| +| InputValidation | 0.0003 | 0.0002 | 0.67x | +| TextEncoding | 3.5936 | 3.5820 | 1.00x | +| LatentPreparation | 0.0007 | 0.0055 | 7.86x | +| TimestepPreparation | 0.0008 | 0.0007 | 0.88x | +| Denoising | 121.2788 | 239.2580 | 1.97x | +| Decoding | 13.8685 | 16.4969 | 1.19x | +| **Total (Pixel data generated)** | **141.86** | **266.50** | **1.88x** | + +## Summary + +- With `torch_npu==2.10.0`, Ring-SP (`u1r2`) runs successfully on NPU for this case. +- End-to-end generation time improves from `266.50s` to `141.86s` (`1.88x`). +- The main gain comes from `DenoisingStage` (`1.97x`), while decoding also improves (`1.19x`).