weixin_62994174/SoulX-Singer-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

SoulX-Singer NPU Adaptation

SoulX-Singer is a high-fidelity, zero-shot singing voice synthesis model that enables users to generate realistic singing voices for unseen singers.

This repository contains the NPU-adapted version of SoulX-Singer for Huawei Ascend 910 devices using torch_npu, including inference scripts, accuracy evaluation, and performance benchmarks.


NPU Adaptation Summary

MetricValue
Model Parameters704M
TasksSinging Voice Synthesis (SVS)
FrameworkPyTorch + torch_npu
NPU HardwareAscend 910 (Atlas 800 A2)
Inference PrecisionFP32
CPU Inference Time2.805s
NPU Inference Time0.126s
Speedup22.2x

Accuracy (CPU vs NPU)

MetricMel SpectrogramAudio Waveform
MAE6.60e-081.09e-02
MSE2.68e-143.45e-04
Max Absolute Diff9.54e-076.29e-02
Cosine Similarity0.99999990.9999992
Relative Error0.000009%0.171%
Pass (<1%)✅ PASS✅ PASS

Overall Accuracy: ✅ PASS — NPU outputs are identical to CPU baseline within numerical precision tolerances.

Performance Benchmark (10 runs on Ascend 910)

MeanStdMinMax
0.126s0.002s0.124s0.129s

Model Architecture

SoulX-Singer uses a Flow Matching architecture for singing voice synthesis:

  • Encoders: 4 embedding tables for text (3000×512), pitch (256×512), note type (256×512), and F0 (361×512)
  • Preflow: 4 ConvNeXt blocks with GRN (Global Response Normalization)
  • CFM Decoder: 22 transformer layers (hidden=1024, heads=16) with SwiGLU MLP and RMS Norm
  • Vocoder: 30 ConvNeXt blocks with iSTFT head for mel-to-waveform conversion

Model checkpoint: model.pt (2.8 GB)


Quick Start

Environment Setup

# Install PyTorch NPU
pip install torch torch_npu

# Install other dependencies
pip install numpy pyyaml

Download Model

The model checkpoint (model.pt, 2.8 GB) is hosted on ModelScope. Download it before running inference:

pip install modelscope
modelscope download --model Soul-AILab/SoulX-Singer --local_dir ./SoulX-Singer

Alternatively, download from AtomGit Releases (web UI upload recommended for large files).

Run Inference

# CPU-only inference
python inference.py --skip-npu --output-dir output --n-steps 32

# Full NPU evaluation (CPU baseline + NPU inference + accuracy comparison + benchmark)
python inference.py --output-dir output --n-steps 32 --benchmark-runs 10

Python API

import torch, yaml
from model import SoulXSinger

with open('config.yaml') as f:
    config = yaml.safe_load(f)

model = SoulXSinger(config)
ckpt = torch.load('model.pt', map_location='cpu', weights_only=True)
model.load_state_dict(ckpt['state_dict'], strict=True)
model.eval()

# Run on NPU
model = model.npu()
text = torch.randint(0, 3000, (1, 100)).npu()
pitch = torch.randint(0, 256, (1, 100)).npu()
note_type = torch.randint(0, 256, (1, 100)).npu()
f0 = torch.randint(0, 361, (1, 100)).npu()
noise = torch.randn(1, 1, 128).npu()

with torch.no_grad():
    audio, mel = model(text, pitch, note_type, f0, n_steps=32, noise=noise)

Files

FileDescription
model.pyModel architecture definition (587 parameters, 704M total)
inference.pyNPU inference script with CPU comparison, accuracy check, and benchmark
config.yamlModel configuration
model.ptPretrained checkpoint (2.8 GB) — download from ModelScope or AtomGit Releases
output/eval_results.jsonFull evaluation results (JSON)
output/run.logComplete evaluation run log

Note: model.pt (2.8 GB) and model-svc.pt (2.6 GB) are excluded from git (see .gitignore). Download them from ModelScope or upload manually via AtomGit web UI.


NPU Adaptation Details

Adaptation Strategy

  1. Architecture Reconstruction: The full model architecture was reconstructed from the checkpoint's 587 named parameters and config.yaml.
  2. Parameter Alignment: All 587 parameter names and shapes were verified to match the official checkpoint exactly.
  3. Inference Pipeline: Complete end-to-end inference from text/pitch input to audio waveform output.
  4. Accuracy Verification: Same input noise tensor used for both CPU and NPU to ensure fair comparison.

Key Implementation Notes

  • The model uses nn.Embedding for input encoders (text, pitch, type, F0)
  • Preflow modules use Linear-based pointwise convolutions (not Conv1d) with 2× expansion (512→1024)
  • The CFM Decoder uses 4× intermediate dimensions (4096) in its internal MLPs
  • The Vocoder uses Conv1d-based embedding and Linear-based pointwise convolutions with 4× expansion
  • All Norm layers are custom implementations matching the checkpoint's weight + bias format

Citation

@misc{soulxsinger,
      title={SoulX-Singer: Towards High-Quality Zero-Shot Singing Voice Synthesis},
      author={Jiale Qian and Hao Meng and Tian Zheng and Pengcheng Zhu and Haopeng Lin and Yuhang Dai and Hanke Xie and Wenxiao Cao and Ruixuan Shang and Jun Wu and Hongmei Liu and Hanlin Wen and Jian Zhao and Zhonglin Jiang and Yong Chen and Shunshun Yin and Ming Tao and Jianguo Wei and Lei Xie and Xinsheng Wang},
      year={2026},
      eprint={2602.07803},
      archivePrefix={arXiv},
      primaryClass={eess.AS},
      url={https://arxiv.org/abs/2602.07803},
}

License

Apache 2.0 License — see the original SoulX-Singer repository for details.

Contact

For NPU adaptation questions, please open an issue in this repository.

Original authors: qianjiale@soulapp.cn, menghao@soulapp.cn, wangxinsheng@soulapp.cn