Wan2.2-S2V-14B NPU 910B Support

NPU 910B (Huawei Ascend) adaptation for Wan2.2-S2V-14B, enabling free inference on platforms like AtomGit which provide NPU 910B 64GB instances at no cost.

Why

Wan2.2-S2V-14B is a powerful audio-to-video (talking body) model, but it requires significant GPU memory. On NPU 910B (32GB HBM + CPU offload), we can run it for free with staged loading and device_map='auto'.

Results

Configuration Value
Hardware NPU 910B 64GB (AtomGit free tier)
Resolution 480ร—832
Steps 5
Frames 40
Inference time ~550s (9.2 min)
Core-hours ~2.47
Cost Free
Quality AI-rated 8.5/10

Quick Start

# 1. Clone Wan2.2
git clone https://github.com/Wan-Video/Wan2.2.git
cd Wan2.2

# 2. Download this patch
wget https://huggingface.co/0xpabloli/Wan2.2-S2V-14B-NPU/resolve/main/patch_npu.py

# 3. Apply NPU patches
python patch_npu.py --repo-root . --max-memory 15GB

# 4. Download model
python -c "from modelscope import snapshot_download; snapshot_download('Wan-AI/Wan2.2-S2V-14B', local_dir='./Wan2.2-S2V-14B')"

# 5. Run inference
python generate.py \
    --task s2v-14B \
    --size 480*832 \
    --ckpt_dir ./Wan2.2-S2V-14B \
    --offload_model True \
    --sample_steps 5 \
    --num_clip 1 \
    --frame_num 40 \
    --prompt "A person is talking to camera" \
    --image portrait.jpg \
    --audio audio.wav \
    --save_file output.mp4

Files

  • patch_npu.py โ€” NPU 910B patch script (10 patches, idempotent)
  • NPU_SUPPORT.md โ€” Full documentation with setup instructions

Patches

  1. torch.cuda.* โ†’ torch.npu.* mapping + import torch_npu
  2. NCCL โ†’ HCCL distributed backend
  3. Staged loading: release T5 encoder before loading diffusion model
  4. device_map='auto' for automatic HBM/CPU offload
  5. Skip .to(device)/.cpu() for accelerate-managed models
  6. flash_attention โ†’ SDPA fallback
  7. VAE dtype fix
  8. dtype assert โ†’ .float() cast
  9. max_memory tuning (15GB HBM + 60GB CPU)
  10. empty_cache() before VAE decode

Related

Author

@0xPabloLI

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support