cv_swinv2-base_patch4_window16_256 on Ascend NPU
1. 简介
- 模型来源: microsoft/swinv2-base-patch4-window16-256
- 架构: SwinV2-Base (patch_size=4, window_size=16, embed_dim=128)
- 参数量: 86,893,816
- 任务: 图像分类 (ImageNet-22k 预训练)
- 适配状态: SUCCESS
- 适配时间: 2026-05-17
2. 验证环境
| 组件 | 版本 |
|---|
| torch | 2.9.0 |
| torch-npu | 2.9.0.post1 |
| CANN | 8.5.1 |
| NPU | Ascend 910B4 |
3. 精度评测
| 指标 | 数值 |
|---|
| Cosine Similarity | 0.999989 |
| Max Abs Error | 0.005416 |
| 是否满足要求 | 是(< 1%) |
4. 性能
| 指标 | 数值 |
|---|
| 平均延迟 | 29.39 ms |
| 输出形状 | [1, 64, 1024] |
5. 适配说明
使用 transformers Swinv2Model.from_pretrained 直接加载预训练权重。输入为随机图像张量 (1, 3, 256, 256),比较 last_hidden_state 输出。
6. 推理输出证据
Model: cv_swinv2-base_patch4_window16_256
Output shape: [1, 64, 1024]
Latency: 29.39ms
Cosine Similarity: 0.999989
Max Abs Error: 0.005416
7. CPU vs NPU 精度对比
| 指标 | CPU | NPU | 差异 |
|---|
| Cosine Similarity | 1.0 | 0.999989 | 0.0011% |
| Max Abs Error | - | 0.005416 | - |