resnet-50 / README.md
AMD-PAVS-AI's picture
Update image references to HF URLs
02212c2 verified
|
Raw
History Blame Contribute Delete
3.37 kB
---
library_name: onnx
license: apache-2.0
tags:
- foundation
- amd
- rocm
- image-classification
pipeline_tag: image-classification
---
![](https://huggingface.co/AMD-PAVS-AI/resnet-50/resolve/main/resnet-50.png)
# ResNet-50: Optimized for AMD ROCm
ResNet-50 is a 50-layer deep residual network for image classification over the 1000 ImageNet categories. This repository packages inference for image classification using **ONNX Runtime**, exported and validated for **AMD ROCm** so it runs efficiently on AMD GPUs, CPUs, and NPUs.
This is based on the implementation of ResNet-50 found [here](https://huggingface.co/microsoft/resnet-50).
This repository contains configurations and scripts optimized for **AMD® ROCm™** platforms. You can use the [resnet-50 AMD scripts](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/resnet-50) to reproduce results or export with custom configurations.
---
## Task Overview
**Task:** Image classification
**Dataset:** ImageNet-1000 label space (a small sample set is staged under `dataset/samples/` for visual evaluation)
**Output metrics:** Throughput (inferences/sec), latency (mean/P95/P99 ms), per-operator profiling breakdown
---
## AMD ROCm Optimization
This model export has been adapted and validated for **AMD Instinct™ / Radeon™ GPUs** running **ROCm**, as well as AMD CPUs and AMD Ryzen AI NPUs. Key points:
- Validated backends: **ONNX Runtime** across CPU (native execution provider), GPU (MIGraphX execution provider, ROCm-based), and NPU (VitisAI execution provider).
- No code changes required versus the upstream `microsoft/resnet-50` export — only environment/runtime configuration differs.
- CPU fallback path supported for environments without a ROCm-capable GPU.
| Runtime | Precision | Backend | Hardware | Notes |
|---|---|---|---|---|
| ONNX Runtime | FP32 / FP16 / BF16 / INT8 | CPU Execution Provider | AMD CPU | — |
| ONNX Runtime | FP32 / FP16 / BF16 / INT8 | MIGraphX Execution Provider | AMD Instinct™ / Radeon™ GPU (ROCm) | — |
| ONNX Runtime | FP32 | VitisAI Execution Provider | AMD Ryzen AI NPU | Accepts FP32 input; VitisAI quantizes internally |
---
## Getting Started
For setup instructions, evaluation scripts, and custom configuration options, see the [resnet-50 on GitHub](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/resnet-50).
---
## Model Details
**Model Type:** Image classification, ResNet-50 (50-layer deep residual network)
**Base Model:** `microsoft/resnet-50` (ResNet-50, ImageNet-1000)
**Model Stats:**
- Input resolution: 224×224 (`pixel_values`: `(batch, 3, 224, 224)`; `logits` output: `(batch, 1000)`)
- Precision tested: FP32, FP16, BF16, INT8 (CPU/GPU); FP32 auto-quantized (NPU)
---
## Accuracy Pipeline
Accuracy evaluation is not yet implemented for this model.
---
## Dig Deeper
Want to explore the full evaluation scripts, config options, and other AMD-optimized model examples?
📂 **[View the full project on GitHub](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/resnet-50)**
The GitHub repository includes:
- Benchmark and profile scripts for CPU, GPU, and NPU (including AI Analyzer profiling)
- ONNX export and pretrained weight download automation
- Sample-image evaluation with annotated top-prediction overlays
- `make metrics` aggregation into `METRICS_TABLE.md`