timm/swinv2_tiny_window8_256.ms_in1k - Ascend NPU Adaptation
1. Model Overview
SwinV2 Tiny is a hierarchical Vision Transformer using shifted windows with window size 8, trained on ImageNet-1k at 256x256 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.002450 |
4. Latency
| Device | Avg Latency |
|---|
| NPU (npu:0) | 12.51 ms |
5. CPU vs NPU
| Metric | CPU | NPU |
|---|
| Output Shape | [1, 1000] | [1, 1000] |
| Prediction | 852 | 852 |
6. Usage
source setup_env.sh
HF_ENDPOINT=https://hf-mirror.com python3 inference.py --device npu:0