iic/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404 是基于 ContextualParaformer (SANMEncoder) 架构的语音识别模型。
本项目将该模型适配到单卡昇腾 NPU(Ascend910)上运行,使用 ModelScope snapshot_download 下载权重,通过 FunASR AutoModel 框架加载,包含推理验证、CPU-NPU 精度一致性检查和性能基准测试。
| 项目 | 配置 |
|---|---|
| 硬件 | 单卡 Ascend910 |
| CANN | 8.5.1 |
| Python | 3.11.14 |
| PyTorch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
| FunASR | 1.3.1 |
| 模型架构 | ContextualParaformer (SANMEncoder) |
pip install -r requirements.txt
python inference.py推理结果(NPU):
NPU transcription: 欢迎大家来到么哒社区进行体验
NPU inference time: 4.4780s对单张测试音频进行 CPU 与 NPU 一致性验证(encoder 输出层):
| 指标 | 数值 |
|---|---|
| relative_error | 0.0577% |
| cosine_similarity | 1.000000 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| avg_latency | 736.74 ms |
| min_latency | 729.52 ms |
| max_latency | 745.08 ms |
| p50_latency | 737.46 ms |
| p90_latency | 742.07 ms |
| p95_latency | 744.65 ms |
| RTF | 0.1629 |
详见 screenshots/self_verification.png。
#NPU #Ascend #ASR #Paraformer #FunASR