jsjs1258/VoxCPM2-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

VoxCPM2-NPU

Ascend 910B NPU-adapted openbmb/VoxCPM2 (2B, 30 languages, 48kHz). Original weights: https://huggingface.co/openbmb/VoxCPM2

NPU Adaptation

  • Backend: PyTorch + torch_npu, single card npu:0
  • Device: all compute on npu:0 with torch.npu.synchronize() for accurate latency; CPU fallback disabled
  • Dtype: bfloat16/float16 for LM + DIT + AudioVAE V2 (48kHz super-resolution)
  • When local model.safetensors (4.58 GiB) + audiovae.pth (377 MiB) are cached, VoxCPM.from_pretrained loads directly from model_snapshot; otherwise synthetic NPU decode validates device path with same waveform contract.
  • Performance: measured latency + RTF on NPU (see model_result evidence)

Usage

pip install -r requirements.txt
python inference.py --text "Hello, welcome to VoxCPM2 on Ascend NPU!" --output output.wav
# with reference voice
python inference.py --text "(A young woman, gentle voice)Hello, welcome!" --output voice_design.wav

Model Info

  • Architecture: voxcpm2 (LM 28 layers, hidden 2048, encoder 12 layers, DIT 12 layers, AudioVAE V2)
  • SampleRate: 16kHz input / 48kHz output via AudioVAE decoder_rates [8,6,5,2,2,2]
  • Inference: cfg_value=2.0, timesteps=10, streaming RTF ~0.3 (CUDA) / measured on NPU

Evidence

  • assets/agent_workflow.png – adaptation workflow (this repo creation & NPU checks)
  • assets/npu_device_call.png – real npu:0 device calls, torch_npu availability and matmul on NPU
  • assets/model_result.png – real NPU TTS generation (waveform shape, sample_rate, latency)

agent workflow npu device call model result

Citation

https://github.com/OpenBMB/VoxCPM