Fish Speech V1.5 is a leading multilingual text-to-speech (TTS) model trained on more than 1 million hours of audio data. This repository contains the model adapted and verified for inference on Huawei Ascend NPU (昇腾).
| Property | Value |
|---|---|
| Model | Fish Speech V1.5 |
| Architecture | DualAR Transformer (GPT-style + Fast codebook decoder) |
| Parameters | 637.9M |
| Precision | BF16 |
| Base Model | fishaudio/fish-speech-1.5 |
| Supported Languages | zh, en, ja, de, fr, es, ko, ar, nl, ru, it, pl, pt |
| Vocoder | Firefly-GAN VQ-FSQ-8x1024-21Hz |
| License | CC-BY-NC-SA-4.0 |
The Fish Speech V1.5 model adopts a Dual Autoregressive (DualAR) architecture:
The inference pipeline: Text → Tokenizer → DualAR Transformer → VQ Codes → Firefly-GAN Vocoder → Audio
| Component | Specification |
|---|---|
| NPU | Ascend 910B2 / 910B / 910A |
| CANN | 8.5.1 or later |
| Driver | Ascend HDK 24.1+ |
| torch_npu | 2.9.0+ |
| PyTorch | 2.9.0+ |
| Memory | ≥ 8 GB NPU memory |
| Storage | ≥ 3 GB free disk space |
NPU: Ascend 910B2 (9362) x2
CANN: 8.5.1
PyTorch: 2.9.0
torch_npu: 2.9.0.post1
Python: 3.11
OS: Linux (aarch64)# Install dependencies
pip install torch torch_npu
pip install modelscope loguru tiktoken soundfile numpy
pip install dac # For vocoder support
# Set environment variables
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True# Download the model
pip install modelscope
modelscope download --model fishaudio/fish-speech-1.5 --local_dir ./fish-speech-1.5
# Clone the fish-speech repo for tokenizer support
git clone --depth 1 https://github.com/fishaudio/fish-speech.git /tmp/fish-speech# Basic TTS inference
python inference.py \
--model-path ./fish-speech-1.5 \
--text "Hello world, this is a test of Fish Speech on Ascend NPU." \
--output output.wav
# Chinese text
python inference.py \
--model-path ./fish-speech-1.5 \
--text "你好,世界!这是Fish Speech在昇腾NPU上的测试。" \
--output output_cn.wav \
--temperature 0.7 \
--top-p 0.9
# With custom sampling parameters
python inference.py \
--model-path ./fish-speech-1.5 \
--text "Your text here." \
--output output.wav \
--temperature 0.8 \
--top-p 0.8 \
--top-k 40 \
--max-new-tokens 256python evaluation/eval_precision.py \
--model-path ./fish-speech-1.5 \
--output-dir ./evaluationpython evaluation/eval_performance.py \
--model-path ./fish-speech-1.5 \
--num-decode-tokens 100 \
--decode-runs 5 \
--output-dir ./evaluation| Parameter | Type | Default | Description |
|---|---|---|---|
--model-path | str | ./fish-speech-1.5 | Path to model directory |
--text | str | required | Input text for TTS |
--output | str | output.wav | Output audio file path |
--max-new-tokens | int | 512 | Maximum tokens to generate |
--temperature | float | 0.7 | Sampling temperature (0-2) |
--top-p | float | 0.7 | Top-p (nucleus) sampling |
--top-k | int | 30 | Top-k sampling |
--device-id | int | 0 | NPU device ID |
--skip-vocoder | flag | False | Skip audio generation |
--codes-output | str | None | Save VQ codes to .npy file |
The following optimizations are applied for Ascend NPU inference:
PYTORCH_NPU_ALLOC_CONF=expandable_segments:True: Enables dynamic memory segment expansion, reducing fragmentation@torch.inference_mode()) for operator fusiontorch.npu.synchronize() for accurate timing| Test Item | Result | Threshold |
|---|---|---|
| Weight loading (BF16 vs FP32) | < 1% relative error | 1% |
| CPU vs NPU code overlap | ~95%+ | - |
| Output code range | [0, 1023] | Valid codebook range |
Precision Status: ✅ PASSED (error < 1%)
Performance measured on Ascend 910B2 with BF16 precision:
| Metric | Value |
|---|---|
| Model Load Time | ~8s |
| Prefill Latency (prompt=50 tokens) | ~200ms |
| Decode Throughput | ~30-50 tokens/s |
| NPU Memory (peak) | ~4-6 GB |
| First Token Latency | ~300ms |
Note: Performance varies based on prompt length, generated sequence length, and sampling parameters.
fish-speech-1.5/
├── config.json # Model configuration
├── model.pth # DualAR Transformer checkpoint
├── firefly-gan-vq-fsq-8x1024-21hz-generator.pth # Vocoder checkpoint
├── tokenizer.tiktoken # Tokenizer
├── special_tokens.json # Special tokens
├── inference.py # NPU inference script
├── README.md # This document
└── evaluation/
├── eval_precision.py # Precision evaluation script
├── eval_performance.py # Performance benchmark script
├── precision_results.json # Precision test results
└── performance_results.json # Performance benchmark resultsdac package. If unavailable, the script saves raw VQ codes instead.@misc{fish-speech-v1.4,
title={Fish-Speech: Leveraging Large Language Models for Advanced Multilingual Text-to-Speech Synthesis},
author={Shijia Liao and Yuxuan Wang and Tianyu Li and Yifan Cheng and Ruoyi Zhang and Rongzhi Zhou and Yijin Xing},
year={2024},
eprint={2411.01156},
archivePrefix={arXiv},
primaryClass={cs.SD},
url={https://arxiv.org/abs/2411.01156},
}This model is licensed under CC-BY-NC-SA-4.0. See the original Fish Speech repository for details.