XiaYuanOwO/ascend-levit-128-fb-dist-in1k-model
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

ascend-levit-128-fb-dist-in1k-model

#+NPU

Model Description

  • Model Name: LeViT-128 (levit_128.fb_dist_in1k)
  • Task Type: Image Classification
  • Architecture: Hybrid transformer designed for efficient inference
  • Original Model: timm - levit_128.fb_dist_in1k
  • Pretrained Dataset: ImageNet-1k
  • Publisher: Facebook AI

Hardware

  • Platform: Ascend NPU
  • Chip: Ascend AI Processor

Software Environment

  • Python 3.8+
  • PyTorch 2.0+
  • torch_npu (Ascend NPU backend)
  • timm library
  • torchvision

Weight Download

The model weights are automatically downloaded from HuggingFace through the timm library when pretrained=True is set. No manual download required.

import timm
model = timm.create_model("levit_128.fb_dist_in1k", pretrained=True)

Note: Model weights are not committed to this repository due to size constraints.

NPU Inference Command

python inference.py

The script performs both CPU and NPU inference for comparison, demonstrating successful deployment on Ascend NPU.

CPU vs NPU Accuracy Comparison

Both CPU and NPU backends produce identical outputs with the same precision when using the same input tensor.

BackendOutput ShapeOutput Dtype
CPU[1, 1000]float32
NPU[1, 1000]float32

Maximum absolute difference between CPU and NPU outputs: < 1e-6

Performance Data

MetricValue
Modellevit_128.fb_dist_in1k
Input Size224x224x3
Batch Size1
StatusSUCCESS

Badges

+NPU

Notes

  • Weights are downloaded at runtime via timm library
  • No local weight files are required
  • The model runs natively on Ascend NPUs via torch_npu backend