Repository navigation
Conversation
…-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.
…nd 910B - Explicitly select manual MindIE-SD ascend_laser_attention (BNSD) with exact power-of-two input pre-scaling on >=4k self-attention shapes (2.59x faster than runtime default). - Stage MiniMax-H3 online AdaLN projection weights on CPU and materialize the schedule cache block-by-block before step 0 (62 GB -> 36 GB resident DiT), bypassing unsupported NPU _assert_async. - Batch NPU Ulysses Q/K/V scatter into a single all_to_all_single collective via ulysses_scatter_qkv and enable pinned CPU parameter offload for TP-sharded Qwen3-VL text encoding and single-card stages. - Dispatch Ascend NPU fused primitives (npu_swiglu, partial NeoX Q/K RoPE, addcmul indexed modulation), release host-queue ParallelWorker and Video VAE buffers before empty_cache(), and raise worker RLIMIT_NOFILE. - Add 1/2/4/8-card Ascend 910B2 MiniMax-H3 execution profiles, container assets, bilingual Ascend 910B documentation, and CPU-mocked unit tests.
…x Ascend 910B2 records - Extend bench_vs_vllm_omni.py and cleanroom_repro.sh (G0-G4) for MiniMax-H3 joint audio-video (T2VA) benchmarking and standalone reproduction. - Add sanitized 50-step (1 Cold + 3 Warm) head-to-head benchmark records across 1x, 2x, 4x, and 8x Ascend 910B2 (64GB) on x86_64 CANN 9.3.0 vs. vLLM-Omni v0.34.0 (2.06x, 1.04x, 1.12x, and 1.12x speedups) and regenerate bilingual MkDocs boards.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adapts and optimizes MiniMax-H3 joint audio-video generation (
T2VA/FL2VA/Ref2VA) on Huawei Ascend 910B2 (64GB) across 1×, 2×, 4×, and 8× cards (x86_64· CANN9.3.0·quay.io/ascend/vllm-omni:v0.34.0base), surpassing vLLM-Omniv0.34.0across every topology (2.06×on1×,1.04×on2×,1.12×on4×, and1.12×on8×) under losslessBF16execution, and populates the verifiedMiniMax-H3rows on the Ascend NPU Performance Board.Motivation
MiniMax-H3combines a 48-layer joint audio-video DiT (~36.9kpacked tokens at768p5s), a 50-layerQwen3-VLmultimodal encoder, and spatiotemporal Video/Audio VAEs: naive resident loading (~62 GBDiT +26 GBAdaLN projections) exceeds 64 GB HBM, while defaultMindIE-SDopt_mode="runtime"falls back to slower attention kernels on NPU.1× / 2× / 4× / 8×Ascend 910B2 support verified throughG0–G4clean-room reproduction (env -i, zero source mounts) and head-to-head parity againstvLLM-Omni v0.34.0.Type of Change
Changes Made
AscendLaserAttentionDispatch & Power-of-Two Pre-Scaling (telefuser/ops/attention/backends.py,minimax_h3_dit.py)opt_mode="manual", op_type="ascend_laser_attention", layout="BNSD"for>= 4000-token self-attention shapes withhead_dim <= 128(2.03 msvs.5.25 msruntimedefault —2.59×faster), paired with exact power-of-two (1/256) Q/K input pre-scaling and packed live-token prefix slicing.telefuser/models/minimax_h3_dit.py,denoising.py)adaln_proj/time_embedderweights on CPU and materialize the schedule cache one block (~520 MB) at a time on step 0 before releasing the projection weights, reducing resident DiT HBM from62 GB → 36 GBso4×and8×run pureResident Ulysses4 / Ulysses8without per-layer TPall_reduce, and bypass unsupportedtorch._assert_asyncon NPU.minimax_h3_dit.py,text_encoding.py,examples/minimax_h3/)ulysses_scatter_qkvall_to_all_singlecollective (3×fewer scatter collectives across 48 blocks × 50 steps).MODEL_CPU_OFFLOADwithpin_cpu_memory=Truefor TP-shardedQwen3-VLtext encoding (0.40sonload+forward on8×) and single-card stage offload (2.06×faster thanvLLM-Omnion1×).telefuser/ops/,parallel_worker.py,vae.py)torch_npu.npu_swiglu, partial NeoX Q/K RMSNorm+RoPE (npu_rms_norm+npu_rotary_mul), andaddcmul-fused indexed scale-shift/gate modulations.empty_cache(), raise workerRLIMIT_NOFILE, and enableHCCL_NPU_SOCKET_PORT_RANGE=auto.benchmarks/ascend_npu/,docs/{en,zh}/,docker/Dockerfile.ascend)bench_vs_vllm_omni.pyandcleanroom_repro.shforMiniMax-H3T2VAvideo +32 kHzstereo AAC audio verification, add1× / 2× / 4× / 8×verified JSON records, and updatedocs/{en,zh}/benchmark_ascend_npu.md,docs/{en,zh}/ascend_910b.md, andexamples/minimax_h3/README.md.Performance Impact
Measured on Ascend 910B2 (64GB) (
x86_64, CANN9.3.0, sharedquay.io/ascend/vllm-omni:v0.34.0runtime), MiniMax-H3 (T2VA) (1344×768,124frames @24 fps+32 kHz2ch AAC audio,50steps, pureBF16),1 Cold + 3 Warmserial requests:v0.34.0Warm (DiT)Testing
pytest tests/unit/ops/test_npu_optimizations.py tests/unit/benchmarks/test_ascend_npu_board.py tests/unit/pipelines/minimax_h3/ tests/unit/worker/)G0–G4hardware qualification across1× / 2× / 4× / 8×Ascend 910B2, includingenv -izero-mountCLEANROOM_PASSon1×and4×)benchmarks/ascend_npu/render_board.py&python scripts/docs/prepare_cookbook.py build)Checklist
ruff check,ruff format --check,ruff check --select I)pytest&tests/docs)docs/en/,docs/zh/,examples/minimax_h3/README.md)[TYPE] Brief descriptionRelated Issues
Related to #52