Skip to content

[PERF] Ascend NPU: Accelerate Wan2.2 1-8x on 910B2 and add benchmark board - #59

Open
yx0716 wants to merge 2 commits into
Tele-AI:mainfrom
yx0716:pr/ascend-npu-perf-board
Open

yx0716 wants to merge 2 commits into
Tele-AI:mainfrom
yx0716:pr/ascend-npu-perf-board

Conversation

@yx0716

@yx0716 yx0716 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Description

Accelerates Wan2.2-TI2V-5B inference on Huawei Ascend 910B2 (64GB) (x86_64 · CANN 9.3.0 · quay.io/ascend/vllm-omni:v0.34.0 base) across 1×, 2×, 4×, and 8× cards to surpass vLLM-Omni v0.34.0 at every card count, and introduces a reproducible five-gate (G0–G4) Ascend NPU Qualification Suite & Bilingual Performance Board under benchmarks/ascend_npu/ and docs/{en,zh}/benchmark_ascend_npu.md.

Motivation

  • Push single-card (1× Ascend 910B2 64GB with BF16 model CPU offload) and multi-card (2× / 4× / 8×) Wan2.2-TI2V-5B latency strictly below vLLM-Omni v0.34.0 on an identical container base without lossy feature caching or quantization.
  • Provide an automated, sanitized qualification harness (G0–G4, including zero-mount env -i clean-room reproduction) and CI-enforced benchmark board that explicitly distinguishes Ascend 910B2 (64GB) vs. Ascend 910B4 (32GB) SKUs and exact accelerator counts while blocking any host/cluster metadata leakage.

Type of Change

  • Performance improvement
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Changes Made

  1. Wan2.2 Ascend 910B Performance Optimizations (telefuser/ops/, telefuser/models/wan_*.py, ti2v_denoising.py)
    • Automatically promote eligible non-causal eager TORCH_SDPA calls on Ascend NPU to MINDIE_ATTN when mindiesd is installed, and propagate set_attention_config to both SelfAttention and CrossAttention in WanModel.
    • Add step-scoped static text-embedding and CrossAttention K/V caching across denoising steps (automatically cleared on stage exit and offload_device).
    • Pre-unsqueeze 4D RoPE cos/sin once per block stack on NPU with a zero-allocation _apply_rotary_emb_npu fast path, fuse DiTBlock / Head scale-shift modulation via torch.addcmul, dispatch WanTextEncoder GELU / T5LayerNorm to native NPU kernels, and eliminate O(T^2) frame concatenation in Wan22VideoVAE.decode.
  2. Five-Gate Qualification Suite & Bilingual Performance Board (benchmarks/ascend_npu/, docs/{en,zh}/benchmark_ascend_npu.md, mkdocs.yml)
    • Add preflight_check.sh, comm_probe.py (G0), bench_vs_vllm_omni.py (G1–G3), cleanroom_repro.sh (G4), and render_board.py with strict hardware-SKU validation and zero-leakage sanitization checks.
    • Check in verified 1× / 2× / 4× / 8× Ascend 910B2 (64GB) head-to-head records for Wan2.2-TI2V-5B and planned qualification slots for MiniMax-H3.

Performance Impact

Measured on Ascend 910B2 (64GB) (x86_64, CANN 9.3.0, shared quay.io/ascend/vllm-omni:v0.34.0 runtime), Wan2.2-TI2V-5B (864×480, 121 frames, 50-step UniPC, CFG=5.0, pure BF16), 1 Cold + 3 Warm serial requests:

Accelerator SKU & Cards Parallelism TeleFuser Warm (DiT) vLLM-Omni v0.34.0 Warm (DiT) Speedup vs. vLLM-Omni Peak HBM / Card (TF vs. Omni)
1× Ascend 910B2 (64GB) Offload (Single-Card) 85.51 s (78.0 s) 101.57 s (93.0 s) 1.19× (-15.8%) 17,805 MB vs. 24,475 MB (-27%)
2× Ascend 910B2 (64GB) CFG2 46.67 s (39.1 s) 56.01 s (47.5 s) 1.20× (-16.7%) 18,278 MB vs. 24,906 MB (-27%)
4× Ascend 910B2 (64GB) CFG2 × Ulysses2 33.85 s (26.3 s) 38.66 s (29.8 s) 1.14× (-12.4%) 19,039 MB vs. 25,814 MB (-26%)
8× Ascend 910B2 (64GB) CFG2 × Ulysses4 20.66 s (13.1 s) 25.84 s (16.5 s) 1.25× (-20.0%) 18,153 MB vs. 25,792 MB (-30%)

Testing

  • Unit tests pass (pytest tests/unit/benchmarks/test_ascend_npu_board.py tests/unit/ops/test_npu_optimizations.py tests/unit/ops/test_attention_backends.py)
  • Manual testing performed (G0–G4 hardware qualification across 1× / 2× / 4× / 8× Ascend 910B2)
  • Benchmarks added/updated (benchmarks/ascend_npu/render_board.py & python scripts/docs/prepare_cookbook.py build)

Checklist

  • Code follows the project's coding standards (ruff check, ruff format --check, ruff check --select I)
  • All tests pass (pytest & tests/docs)
  • New tests added for new functionality
  • Documentation updated (docs/en/, docs/zh/, benchmarks/ascend_npu/README.md)
  • Commit messages are clear and descriptive
  • PR title follows the convention: [TYPE] Brief description

Related Issues

Related to #52

…-Omni

Optimize single-card and multi-card Ascend NPU execution paths under strict
BF16 model-level CPU offload parity:
- Promote eligible eager non-causal TORCH_SDPA calls on Ascend NPU to
  MindIE-SD attention when installed, and propagate set_attention_config to
  both SelfAttention and CrossAttention instances in WanModel
- Add step-scoped static text-embedding and CrossAttention K/V caching in
  WanModel/TI2VDenoisingStage across denoising steps, cleared automatically on
  stage exit and model offload
- Pre-unsqueeze 4D RoPE cos/sin once per block stack on NPU and add a
  zero-allocation fast path in _apply_rotary_emb_npu
- Fuse DiTBlock and Head scale/shift modulation via torch.addcmul on NPU
- Dispatch WanTextEncoder GELU and T5LayerNorm to native NPU kernels
- Eliminate O(T^2) frame concatenation in Wan22VideoVAE.decode and FP32
  nearest-neighbor upsample round-trips on NPU

Verified with unit tests in tests/unit/ops/test_attention_backends.py and
tests/unit/ops/test_npu_optimizations.py.
…rformance board

Add reproducible five-gate (G0-G4) Ascend NPU qualification harness under
benchmarks/ascend_npu/, sanitized head-to-head benchmark records across 1x,
2x, 4x, and 8x Ascend 910B2 (64GB) vs. vLLM-Omni v0.34.0, and bilingual
MkDocs pages (docs/{en,zh}/benchmark_ascend_npu.md) enforcing explicit chip
SKU and card-count reporting with zero host metadata leakage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant