timm/swinv2_cr_small_ns_224.sw_in1k - Ascend NPU Adaptation
1. Model Overview
SwinV2-CR Small is a Compact Restructured Swin Transformer V2 model trained with neighborhood attention on ImageNet-1k at 224x224 resolution.
2. NPU Adaptation
- Device: Ascend NPU (npu:0)
- Framework: PyTorch + torch_npu
3. Accuracy
| Metric | Value |
|---|
| Cosine Similarity | 0.999986 |
| Max Abs Error | 0.001687 |
4. Latency
| Device | Avg Latency |
|---|
| NPU (npu:0) | 22.31 ms |
5. CPU vs NPU
| Metric | CPU | NPU |
|---|
| Output Shape | [1, 1000] | [1, 1000] |
| Prediction | 640 | 640 |
6. Usage
source setup_env.sh
HF_ENDPOINT=https://hf-mirror.com python3 inference.py --device npu:0