xujiashuai/timm-coat_lite_mini.in1k-FE-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

timm-coat_lite_mini.in1k - Ascend NPU 适配

1. 模型信息

  • 模型: timm-coat_lite_mini.in1k
  • 来源: timm
  • 任务: ImageNet 图像分类

2. 昇腾 NPU 适配结果

指标值
设备Ascend 910B4
精度float32
Cosine Similarity0.999982
Max Absolute Error0.006865
NPU 推理时间7.17ms

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== coat_lite_mini.in1k ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.4714316725730896, -0.12448915094137192, -0.12505146861076355, -0.21620219945907593, -0.10293301939964294]
推理时间: 189.06ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.4730431139469147, -0.1252298653125763, -0.12451627850532532, -0.21485327184200287, -0.10255396366119385]
推理时间: 7.17ms

=== 精度对比 ===
Cosine Similarity: 0.999982
Max Absolute Error: 0.006865
Relative Error: 0.023209

✓ NPU 适配通过

5. 精度校验

  • Cosine Similarity: 0.999982 (> 0.99 通过)
  • Max Absolute Error: 0.006865

6. 复现步骤

pip install torch torch_npu timm huggingface_hub safetensors
python3 inference.py

7. 环境要求

  • Python 3.11+, PyTorch 2.9.0+, torch_npu 2.9.0+, CANN 8.5.1, Ascend 910B4

8. Agent Skill

本适配由 vision-encoder-npu-adapt Agent Skill 自动完成。