weixin_62994174/Pocket-TTS-Ascend-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Pocket TTS - Ascend NPU Adaptation

A lightweight text-to-speech (TTS) model adapted for Huawei Ascend NPU (Ascend 910). Based on Kyutai's Pocket TTS (without voice cloning variant).

Model Description

  • Model: Pocket TTS (100M parameters)
  • Model Source: AI-ModelScope/pocket-tts-without-voice-cloning
  • NPU Device: Huawei Ascend 910
  • Framework: PyTorch 2.9 + torch_npu 2.9
  • Precision: FP32
  • Task: Text-to-Speech (English)

Key Features

  • Runs on Ascend NPU (910 series)
  • 100M parameter model
  • ~200ms first audio chunk latency
  • ~4-5x real-time inference on Ascend 910
  • Python API for easy integration
  • Supports streaming audio generation

Quick Start

Requirements

  • Python 3.11+
  • PyTorch 2.9.0
  • torch_npu 2.9.0
  • Ascend NPU driver

Installation

pip install pocket-tts safetensors scipy numpy beartype

Download Model

pip install modelscope
modelscope download --model AI-ModelScope/pocket-tts-without-voice-cloning

Inference

from inference import load_model_on_npu, create_voice_state, run_inference
import scipy.io.wavfile

# Load model on NPU
model = load_model_on_npu()

# Create voice state
voice_state = create_voice_state(model, seed=42)

# Generate speech
audio, stats = run_inference(model, voice_state, "Hello world!", seed=42)

# Save audio
scipy.io.wavfile.write("output.wav", model.sample_rate, audio.cpu().numpy())
print(f"Generated {stats['duration_s']:.1f}s audio in {stats['elapsed_s']:.2f}s ({stats['rtf']:.1f}x RTF)")

Or use the command line:

python inference.py --text "Hello world, this is a test." --output output.wav
python inference.py --text "Hello world." --compare   # accuracy validation
python inference.py --benchmark                        # performance test

Accuracy Validation

Accuracy is validated by comparing deterministic model components (encoder, decoder, backbone transformer) between NPU and CPU. TTS generation is stochastic due to random noise sampling, so direct audio comparison is not meaningful.

ComponentMax Relative ErrorStatus
Mimi Encoder0.0000%✅ Pass
Mimi Decoder0.0270%✅ Pass
FlowLM Backbone0.0150%✅ Pass
Overall0.0270%✅ Pass (< 1%)

Performance

Benchmarked on Huawei Ascend 910 (single NPU):

MetricValue
Average RTF4.38x
Total RTF4.70x
Model Parameters109.5 M
Sample Rate24 kHz
PrecisionFP32

Compared to CPU baseline (~1.07x RTF), the NPU delivers approximately 4.4x speedup.

Model Architecture

Pocket TTS consists of two main components:

  1. FlowLM (Flow Language Model): A transformer-based flow model that generates audio latents from text input. Features:

    • 6 transformer layers (1024 dim, 16 heads, 4096 FF)
    • Flow network with 6 AdaGN residual blocks
    • LSD (Lagrangian Self Distillation) decoding
    • Text conditioner with sentencepiece tokenizer (4000 vocab)
  2. Mimi (Audio Codec): A SEANet-based encoder/decoder that converts between audio and latent space. Features:

    • SEANet encoder/decoder with 3 stages (ratios 6, 5, 4)
    • 2-layer ProjectedTransformer (512 dim, 8 heads)
    • ConvTr-based upsampling / Conv-based downsampling
    • Output: 24kHz mono audio

File Structure

pocket-tts-npu/
├── inference.py           # Main NPU inference script
├── README.md              # This file
├── accuracy_report.json   # Accuracy validation results
├── benchmark_report.json  # Performance benchmark results
└── output_npu.wav         # Sample generated audio

License

This model is released under the CC-BY-4.0 license.

Citation

@article{orsini2025pocket,
  title={Pocket TTS: Lightweight Text-to-Speech},
  author={Orsini, Manu and Rouard, Simon and De Marmiesse, Gabriel and Volhejn, Václav and Zeghidour, Neil and Défossez, Alexandre},
  journal={arXiv preprint arXiv:2509.06926},
  year={2025}
}

Prohibited Use

Use of this model must comply with all applicable laws and regulations. Prohibited uses include voice impersonation or cloning without explicit consent, misinformation, and generation of unlawful or harmful content.