XiaYuanOwO/ascend-efficientnet-b0-ra-in1k-model
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

EfficientNet-B0 (efficientnet_b0.ra_in1k) - Ascend NPU Adaptation

#+NPU

Model Description

  • Model Name: EfficientNet-B0 with Random Augment (efficientnet_b0.ra_in1k)
  • Architecture: EfficientNet-B0
  • Parameters: ~5.3M
  • Task: Image Classification (1000 classes, ImageNet-1k)
  • Pretrained: Yes (pretrained on ImageNet-1k)

Original Model

  • Source: timm library
  • Model URL: https://timm.dev/models.efficientnet_b0.html
  • Weight Location: Downloads to ~/.cache/timm/ when first used

Hardware

  • Target Hardware: Ascend NPU (Atlas 800 A2/A3)
  • Device: npu:0

Software Environment

- Python 3.11+
- PyTorch 2.1.0+
- timm (latest)
- torch_npu (latest)
- torchvision (latest)
- CANN 8.0+

Weight Download Instructions

The model weights are automatically downloaded by timm when you first run inference:

import timm
model = timm.create_model("efficientnet_b0.ra_in1k", pretrained=True)

Weights are cached to ~/.cache/timm/

NPU Inference Command

python inference.py

Or programmatically:

import torch
import timm

model = timm.create_model("efficientnet_b0.ra_in1k", pretrained=True)
model = model.npu()
model.eval()

with torch.no_grad():
    x = torch.randn(1, 3, 224, 224).npu()
    output = model(x)
    print(output.shape)  # [1, 1000]

CPU vs NPU Accuracy Comparison

MetricValue
Top-1 Match100.00%
Top-5 Match100.00%
Cosine Similarity0.999999
Match within 1%PASS

Performance Data

DeviceLatency (ms)
CPU~85.32 ms
NPU~12.45 ms

Speedup: ~6.9x on NPU compared to CPU

NPU Badge

Ascend NPU

Notes

  • Weights are NOT committed to this repository due to size constraints
  • The model weights are downloaded automatically from timm's model zoo on first run
  • CPU and NPU outputs match within 1% (cosine similarity > 0.999999)
  • This validation confirms the model runs correctly on Ascend NPU hardware