chat-daiyu-sovits (Ascend NPU Adaptation)
Model Introduction
chat-daiyu-sovits is a GPT-SoVITS S1 autoregressive (AR) model fine-tuned for Daiyu voice cloning. This repository contains the Ascend NPU adaptation that enables high-performance inference on Huawei Ascend 910 hardware.
Model Architecture : GPT-SoVITS S1 AR (24-layer Transformer)
Parameters : 77,494,787
Original Model : Omelette/chat-daiyu-sovits
Task : Text-to-Semantic-Token (S1 stage of GPT-SoVITS pipeline)
Language : Chinese (zh-CN)
Adaptation Target : Ascend 910 NPU (CANN 8.5.1, torch_npu 2.9.0)
Quick Start
Environment Requirements
Component Version CANN 8.5.1 torch 2.9.0 torch_npu 2.9.0.post1 Python 3.11 Ascend NPU 910
Model Download
pip install modelscope
modelscope download --model Omelette/chat-daiyu-sovits --local_dir ./chat-daiyu-sovits
Inference
# Precision evaluation (CPU vs NPU)
python inference.py --mode eval --checkpoint ./chat-daiyu-sovits/daiyu-voice-e12.ckpt
# Performance benchmark
python inference.py --mode benchmark --checkpoint ./chat-daiyu-sovits/daiyu-voice-e12.ckpt
# Single inference demo
python inference.py --mode inference --checkpoint ./chat-daiyu-sovits/daiyu-voice-e12.ckpt
Python API
import torch
from inference import ARModel, build_model_from_checkpoint
# Load model on NPU
model, config = build_model_from_checkpoint(
"./chat-daiyu-sovits/daiyu-voice-e12.ckpt",
device="npu:0"
)
# Prepare inputs
bert_features = torch.randn(1, 15, 1024, device="npu:0") # BERT semantic features
text_tokens = torch.randint(0, 512, (1, 8), device="npu:0") # Text phoneme tokens
# Generate audio tokens
audio_tokens = model.generate(bert_features, text_tokens, max_new_tokens=100, top_k=5)
print(f"Generated {audio_tokens.shape[1]} audio tokens")
Precision Evaluation
NPU inference precision is validated against CPU (float32) baseline with the following results:
Metric Result Threshold Status Forward Relative Error 0.073% < 1% PASS Cosine Similarity 1.0000001 > 0.9999 PASS Top-1 Accuracy 100.0% > 99% PASS Top-5 Accuracy 100.0% > 99% PASS Top-10 Accuracy 100.0% > 99% PASS Greedy Generation Match 100.0% > 98% PASS Overall Precision PASS - PASS
Layer-by-Layer Precision
Layer Max Absolute Diff Embedding (Layer 0) 1.53e-05 Layer 12 (Mid) 0.055 Output (Layer 24) 0.041
Environment: Ascend 910 NPU x2, CANN 8.5.1
Forward Pass
Metric NPU CPU Speedup Average Latency 9.57 ms 244.35 ms 25.5x Std Dev 0.10 ms - - Throughput 208.9 samples/s 8.2 samples/s 25.5x
Autoregressive Generation
Metric Value Avg Generation Time (50 tokens) 0.41 s Token Generation Rate 21.8 tokens/s
Memory Usage
Type Usage Allocated 310.9 MB Reserved 328.0 MB
Model Architecture Details
GPT-SoVITS S1 AR Model (77.5M parameters)
├── BERT Projection: Linear(1024 → 512)
├── Text Embedding: Embedding(512 × 512)
├── Audio Embedding: Embedding(1025 × 512)
├── Sine Positional Encoding (x2, with learnable alpha)
├── Transformer Layers ×24
│ ├── Self-Attention (16 heads, head_dim=32)
│ ├── FFN (Linear 512→2048, GELU, 2048→512)
│ └── Pre-LayerNorm
└── Output Head: Linear(512 → 1025)
Directory Structure
chat-daiyu-sovits-npu/
├── inference.py # NPU inference script
├── eval_results.json # Precision & performance results
├── run_eval.log # Evaluation run log
└── README.md # This document
Known Issues
Warning messages : Non-critical permission/ownership warnings from torch_npu are expected in the current CANN environment. They do not affect functionality or precision.
Top-K sampling randomness : When using top_k > 0, small floating-point differences between NPU and CPU may lead to different sampling paths. Use top_k=0 (greedy) for deterministic output comparison.
License
This adaptation is released under Apache License 2.0, consistent with the original model license.
Citation
@misc{chat-daiyu-sovits-npu,
title = {chat-daiyu-sovits Ascend NPU Adaptation},
author = {Ascend NPU Adaptation},
year = {2026},
url = {https://modelscope.cn/Omelette/chat-daiyu-sovits},
}