Yanguan/dolphin-small-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Dolphin-small NPU Adaptation

This repository contains the NPU-adapted inference scripts for the Dolphin-small multilingual ASR model on Huawei Ascend NPU.

Model Info

ItemValue
Model NameDataoceanAI/dolphin-small
Parameters372 M
ArchitectureCTC-Attention (E-Branchformer + Transformer)
Languages40 Eastern languages + 22 Chinese dialects
Original RepoModelScope

Hardware & Environment

ItemVersion / Model
NPUAscend 910
CANN8.5.1
PyTorch2.9.0+cpu
torch_npu2.9.0.post1

Installation

# Install core dependencies
pip install torch==2.9.0 torch-npu==2.9.0.post1
pip install dataoceanai-dolphin soundfile

# Download model weights
modelscope download --model DataoceanAI/dolphin-small --local_dir /path/to/model

Files

dolphin-small/
├── inference.py      # NPU inference script
├── benchmark.py      # Performance benchmark
├── accuracy.py       # Accuracy validation (CPU vs NPU)
├── assets/           # Test audio samples
└── output/           # Output logs

Usage

1. NPU Inference

python inference.py \
    --audio assets/test_audio.wav \
    --model_dir /path/to/model \
    --device npu \
    --lang_sym zh \
    --region_sym CN

Example output:

{
    'text': '<zh><CN>欢迎大家来体验达摩院推出的语音识别模型',
    'text_nospecial': '欢迎大家来体验达摩院推出的语音识别模型',
    'language': 'zh',
    'region': 'CN',
    'inference_time_sec': 0.235
}

2. Performance Benchmark

python benchmark.py \
    --audio assets/test_audio.wav \
    --device npu \
    --iterations 10

Benchmark result (Ascend 910, attention_rescoring, beam_size=10):

MetricValue
Avg latency0.23s
P50 latency0.23s
P90 latency0.23s
Throughput4.36 samples/sec

3. Accuracy Validation

python accuracy.py \
    --audio assets/test_audio.wav \
    --lang_sym zh \
    --region_sym CN

Validation result:

MetricCPU BaselineNPU OutputMatch
Transcript欢迎大家来体验达摩院推出的语音识别模型欢迎大家来体验达摩院推出的语音识别模型Yes
LanguagezhzhYes
RegionCNCNYes
Accuracy100%PASS

NPU Adaptation Notes

  • The model is a pure PyTorch model. NPU adaptation is achieved by passing device="npu" to load_model().
  • No code modifications to the original dolphin package are required.
  • Audio loading uses soundfile instead of ffmpeg to reduce external binary dependencies.
  • Numerical consistency between CPU and NPU is verified: transcript, language, and region predictions are identical.

Citation

@article{dolphin2025,
  title={Dolphin: A Large-Scale Multilingual Multitask ASR Model for 40 Eastern Languages},
  author={Dataocean AI and Tsinghua University},
  journal={arXiv preprint arXiv:2503.20212},
  year={2025}
}