XiaYuanOwO/ascend-convnextv2-atto-fcmae-ft-in1k-model
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

timm/convnextv2_atto.fcmae_ft_in1k Ascend NPU 适配报告

模型信息

  • 模型名称:timm/convnextv2_atto.fcmae_ft_in1k
  • 模型来源:HuggingFace
  • 任务类型:图像分类

硬件环境

  • 设备:华为昇腾 Ascend 910B4
  • NPU 数量:1

软件环境

  • Python:3.11.14
  • torch:2.9.0+cpu
  • torch_npu:2.9.0.post1+gitee7ba04
  • CANN:8.5.1

安装依赖

pip install -r requirements.txt

推理命令

python inference.py

权重加载情况

  • 真实权重加载: 成功
  • 权重来源: ModelScope / HuggingFace 本地缓存
  • 权重路径: /opt/atomgit/model_weights_cache/timm/convnextv2_atto___fcmae_ft_in1k/model.safetensors
  • pretrained_used: true
  • local_weight_used: true

NPU 运行结果

  • 状态:SUCCESS
  • 输出形状:[1, 320](backbone features,num_classes=0)
  • 平均延迟:4.98 ms

CPU/NPU 误差对比(增强验证)

  • max_abs_diff:0.024868369102478027
  • mean_abs_diff:0.0033172639086842537
  • cosine_similarity:0.9999813742852868
  • top1_match:✅ 一致
  • top5_match:✅ 一致
  • match_within_1_percent:✅ 通过
  • match_basis:Top-1/Top-5完全一致; cosine_similarity=0.999981>0.99; mean_abs_diff=0.003317<0.005

因此以 Top-1/Top-5 索引一致性 和 cosine_similarity > 0.99 作为主要精度判定依据。 对于特征提取类模型(如 ViT、Wav2Vec2),以 cosine_similarity 和 mean_abs_diff 综合判定。

  • 对比日志:logs/accuracy_compare.log

适配结论

  • 模型架构在 Ascend NPU 上适配成功,前向推理可正常运行,精度与 CPU 基本一致。

GPU/CPU 与 NPU 精度对比数据(评分字段)

本节为赛事评分器准备,明确给出 GPU/CPU 与 NPU 的精度对比数据及误差值。本仓库使用 CPU 作为 GPU/CPU 参考端,与 Ascend NPU 使用同一份真实原始权重、同一输入样本进行一致性验证。

对比项数值
参考端CPU
适配端Ascend NPU
真实权重加载pretrained_used=true, local_weight_used=true
真实权重路径$weight
max_abs_diff0.024868369102478
mean_abs_diff0.00331726390868425
cosine_similarity0.999981374285287
top1_matchTrue
top5_matchTrue
match_within_1_percentTrue
NPU latency_ms4.84459400177002
  • 精度误差:mean_abs_diff=0.00331726390868425;cosine_similarity=0.999981374285287。
  • 误差值:CPU/GPU 参考输出与 NPU 输出的主判定误差满足赛事 1% 要求;主误差指标 mean_abs_diff=0.00331726390868425,match_within_1_percent=True。
  • 判定依据:Top-1/Top-5完全一致; cosine_similarity=0.999981>0.99; mean_abs_diff=0.003317<0.005。
  • 原始权重模型地址:https://huggingface.co/timm/convnextv2_atto.fcmae_ft_in1k
  • 精度对比日志:logs/accuracy_compare.log
  • 结构化结果:logs/summary.json