convnext_xxlarge.clip_laion2b_soup_ft_in1k — Ascend NPU Adaptation
Image Classification model adapted for Huawei Ascend NPU (Ascend910B)
1. Model Overview
| Item | Detail |
|---|
| Model | convnext_xxlarge.clip_laion2b_soup_ft_in1k |
| Framework | timm (PyTorch) |
| Task | Image Classification (ImageNet-1K, 1000 classes) |
| Parameters | 846.5M |
| Source | ModelScope |
2. Environment
- Hardware: Ascend 910B4-1
- OS: Linux (aarch64)
- Python: 3.10
- PyTorch: 2.10.0+torch_npu
- timm: 1.0.27
- CANN: 8.x
3. Files
├── model_utils.py # Model loading & preprocessing utilities
├── inference.py # Single-image inference script
├── eval_accuracy.py # CPU-NPU accuracy consistency check
├── benchmark.py # Performance benchmark script
├── assets/
│ └── test.jpg # Test image
├── logs/
│ ├── inference.log # Inference output
│ ├── accuracy.log # Accuracy comparison
│ └── benchmark.log # Performance data
└── README.md
4. Quick Start
# Install dependencies
pip install torch torch-npu timm modelscope
# Run inference
python inference.py
5. Inference Results
Single test image on NPU:
6. Accuracy: CPU vs NPU
| Metric | Value |
|---|
| max_abs_error | 0.058968 |
| mean_abs_error | 0.007984 |
| relative_error | 1.0280% |
| cosine_similarity | 0.999954 |
| Top-1 match | True |
Note: This is a smoke consistency check on a single test image, not an official ImageNet full validation set evaluation.
| Metric | Value |
|---|
| Throughput | images_per_sec 24.04 images/sec |
| Device | NPU:0 (Ascend 910B) |
| Precision | FP32 |
8. Reproduce
# 1. Download model weights
python -c "from modelscope import snapshot_download; snapshot_download('timm/convnext_xxlarge.clip_laion2b_soup_ft_in1k', cache_dir='/data/modelscope_cache')"
# 2. Run inference
python inference.py
# 3. Check accuracy
python eval_accuracy.py
# 4. Run benchmark
python benchmark.py
9. 竞赛提交信息
10. Notes
- Model weights are NOT included in this repository
- Weights are downloaded from ModelScope via
snapshot_download
- FP32 precision used for all inference and accuracy checks
NPU Ascend Ascend910 torch_npu timm ImageClassification #convnext_xxlarge.clip_laion2b_soup_ft_in1k