timm-mobilevitv2_050 on Ascend NPU
1. 简介
本文档记录 timm/mobilevitv2_050.cvnets_in1k (MobileViTV2 050) 在昇腾 NPU 上的适配验证结果。
- 模型来源: timm/mobilevitv2_050.cvnets_in1k
- 参数量: ~1.4M
- 任务: Image Classification (ImageNet-1K, 1000类)
- 适配状态: SUCCESS
- 适配时间: 2026-05-18
2. 验证环境
| 组件 | 版本 |
|---|
torch | 2.9.0 |
torch-npu | 2.9.0.post1 |
timm | 1.0.27 |
CANN | 8.5.1 |
3. 推理脚本
python inference.py --device npu:0 --dtype float32
4. 推理输出证据
if self.device.type != 'cpu':
模型: mobilevitv2_050.cvnets_in1k
设备: npu:0
精度: float32
------------------------------------------------------------
权重加载完成
--- CPU 推理 ---
输出形状: [1, 1000]
输出前5值: [-1.205540418624878, -0.49574151635169983, -1.5163331031799316, -0.837357223033905, 0.5808066129684448]
--- NPU 推理 (npu:0) ---
输出形状: [1, 1000]
输出前5值: [-1.2060625553131104, -0.4955255091190338, -1.5171669721603394, -0.8373667001724243, 0.5793150663375854]
=== 精度对比 ===
Cosine Similarity: 0.999998
Max Absolute Error: 0.010277
--- 性能基准 ---
平均延迟: 6.46 ms (10轮)
✓ NPU 适配通过
5. 性能参考
6. CPU vs NPU 精度对比
| 指标 | 数值 |
|---|
| Cosine Similarity | 0.999998 |
| Max Abs Error | 0.010277 |
| 是否满足要求 | 是(< 1%) |
7. 评测材料
| 材料 | 文件 | 说明 |
|---|
| 推理脚本 | inference.py | NPU 推理代码 |
8. 注意事项
- 使用 timm 库加载预训练权重(hf-mirror)
- 输入: 随机 256x256 RGB 图像
- 输出: 1000 类 ImageNet logits
贡献者: xujiashuai
参赛赛道: 模型适配赛道
提交时间: 2026-05-18