xujiashuai/cv_vitb16_classification_vision-efficient-tuning-adapter
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

cv_vitb16_classification_vision-efficient-tuning-adapter on Ascend NPU

1. 简介

本文档记录 cv_vitb16_classification_vision-efficient-tuning-adapter 在昇腾 NPU 上的适配验证结果。

  • 模型来源: iic/cv_vitb16_classification_vision-efficient-tuning-adapter
  • 架构: ViT-Base (patch16, 224) + Adapter (PETL, adapter_length=10)
  • 参数量: ~86M (backbone) + adapter parameters
  • 任务: Image Classification (图像分类, 100类)
  • 适配状态: SUCCESS
  • 适配时间: 2026-05-17

2. 验证环境

组件版本
torch2.9.0
torch-npu2.9.0.post1
timm1.0.27
CANN8.5.1
  • NPU: Ascend 910B4
  • 系统: Linux aarch64

3. 推理脚本

python inference.py --device npu:0 --dtype float32

4. 推理输出证据

模型: cv_vitb16_classification_vision-efficient-tuning-adapter
设备: npu:0
精度: float32

--- CPU 推理 ---
输出形状: [1, 100]
Logits 前5个: [-0.4165, -2.0099, 1.7495, -0.4107, -0.0241]
是否有 NaN: False
预测类别: 10

--- NPU 推理 (npu:0) ---
输出形状: [1, 100]
Logits 前5个: [-0.4113, -2.0077, 1.7452, -0.4151, -0.0259]
是否有 NaN: False
预测类别: 10

5. 性能参考

指标数值
平均延迟6.51 ms
测试轮数10

6. CPU vs NPU 精度对比

指标数值
Cosine Similarity0.999992
Max Abs Error0.013165
精度误差0.0008%
是否满足要求是(< 1%)

7. 评测材料

材料文件说明
推理脚本inference.py独立可运行的 NPU 推理代码

8. 注意事项

  • 使用 timm 的 ViT-Base 模型 + 手动加载 Adapter 层
  • Adapter 为瓶颈结构: down-project (768→10) → GELU → up-project (10→768)
  • 权重格式: backbone_weight 和 head_weight 分开存储于 pytorch_model.pt
  • 输入: 随机 224x224 RGB 图像
  • 输出: 100 类分类 logits

贡献者: xujiashuai 参赛赛道: 模型适配赛道 提交时间: 2026-05-17