| 组件 | 版本 |
|---|---|
| torch | 2.9.0 |
| torch-npu | 2.9.0.post1 |
| transformers | 4.57.6 |
| CANN | 8.5.1 |
| NPU | Ascend 910B4 |
| 操作系统 | Ubuntu 22.04.5 LTS (aarch64) |
| Python | 3.11.14 |
✅ NPU 与 CPU 精度对比
| 指标 | 数值 |
|---|---|
| 余弦相似度 | 1.000010 |
| 精度误差 | -0.0010% |
| 是否满足要求 | 是(< 1%)✅ |

| 指标 | 数值 |
|---|---|
| 平均延迟 | 72.35 毫秒 |
| 峰值显存 | 0.16 GB |
| 测试轮数 | 10 |
python3 inference.py --model-id openai/whisper-tiny --device npu:0终端输出:
2026-05-16 16:04:31,895 - modelscope - INFO - Download model 'openai-mirror/whisper-tiny' successfully.
Using custom `forced_decoder_ids` from the (generation) config.
Transcription using a multilingual Whisper will default to language detection followed by transcription instead of translation to English.
/usr/local/python3.11.14/lib/python3.11/site-packages/transformers/models/whisper/generation_whisper.py:1678: UserWarning: Cannot create tensor with interal format while allow_internel_format=False, tensor will be created with base format.
non_lang_mask = torch.ones_like(logits[0], dtype=torch.bool)
The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Output shape: [1, 5]
SUCCESS# 环境检查
python3 env_check.py
# 精度验证
python3 evaluate.py --model-id openai/whisper-tiny --device npu:0 --output report.json
# 推理
python3 inference.py --model-id openai/whisper-tiny --device npu:0| 材料 | 文件 |
|---|---|
| 推理脚本 | inference.py |
| 精度评测 | evaluate.py |
| 环境检查 | env_check.py |
| 运行日志 | logs/run.log |
| 截图 | screenshots/ |
| 报告 | report.json |
| 部署文档 | DEPLOY.md |
| 依赖 | requirements.txt |
贡献者: xujiashuai | 赛道: 模型适配赛道 | 时间: 2026-05-15 01:43:16