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

timm-coat_lite_small.in1k - Ascend NPU 适配

1. 模型信息

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

2. 昇腾 NPU 适配结果

指标值
设备Ascend 910B4
精度float32
Cosine Similarity0.999940
Max Absolute Error0.009168
NPU 推理时间13.37ms

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== coat_lite_small.in1k ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.12134451419115067, 0.14412380754947662, 0.18411995470523834, 0.2628661096096039, 0.3474887013435364]
推理时间: 394.10ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.12338726222515106, 0.14251507818698883, 0.18273788690567017, 0.2612473964691162, 0.3443298041820526]
推理时间: 13.37ms

=== 精度对比 ===
Cosine Similarity: 0.999940
Max Absolute Error: 0.009168
Relative Error: 0.058383

✓ NPU 适配通过

5. 精度校验

  • Cosine Similarity: 0.999940 (> 0.99 通过)
  • Max Absolute Error: 0.009168

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 自动完成。