#+NPU
MobileNetV3-Small is an efficient image classification model optimized for edge devices. This adaptation enables inference on Ascend NPU using torch_npu backend, maintaining accuracy while achieving significant performance improvements.
| Metric | CPU | NPU | Speedup |
|---|---|---|---|
| Inference Time (ms/image) | 45.2 | 8.7 | 5.2x |
| Throughput (images/sec) | 22.1 | 114.9 | 5.2x |
import torch
import timm
# Load model
model = timm.create_model('mobilenetv3_small_100.lamb_in1k', pretrained=True)
# Move to NPU
model = model.to('npu')
# Inference
input_tensor = torch.randn(1, 3, 224, 224).npu()
output = model(input_tensor)├── inference.py # Main inference script with CPU/NPU comparison
├── requirements.txt # Python dependencies
├── logs/ # Execution logs
│ ├── run_npu.log
│ ├── accuracy_compare.log
│ └── summary.json
└── README.mdApache 2.0