realesr-general-x4v3 optimized for Arm-based mobile CPUs with SME2

An INT8-quantized version of realesr-general-x4v3 for 4x image super-resolution, exported to ExecuTorch (.pte) and optimized for Arm-based mobile CPUs with SME2.

Summary

This repository contains an Arm-optimized version of realesr-general-x4v3 for image super-resolution, quantized to INT8 via static post-training quantization — per-channel symmetric weights, per-tensor affine activations. The model is provided in ExecuTorch (.pte) format, targeting Mobile CPU systems.

This version is intended to demonstrate efficient inference on Arm-based platforms while preserving the original model's intended behavior. Arm has evaluated this model on DIV2K and measured performance on a representative evaluation target.

Key results

Area Result
Model format ExecuTorch (.pte)
Target device class Mobile CPU
Reference device vivo X300 (C1-Ultra, C1-Premium, C1-Pro, Android 16 / OriginOS 6)
Primary performance result p50 latency 218.394 ms, 4.579 frames per second (8.77x faster than baseline)
Accuracy result PSNR 26.33 dB, SSIM 0.7473
Size / memory result 1.342 MB (3.49x smaller), peak memory 102.61 MB

Original model

Field Value
Original model realesr-general-x4v3
Original source GitHub
Original developer xinntao / Tencent ARC Lab
Original model card xinntao/Real-ESRGAN
Original license BSD-3-Clause

Model files

File Description
realesr-general-x4v3_executorch_optimized.pte Arm-optimized INT8 model for deployment
example.py Minimal inference example
pyproject.toml Pinned runtime dependencies for example.py, resolved with uv
uv.lock Locked dependency resolution for pyproject.toml
config.yaml Model I/O contract used by the example
benchmarks/ FP32 baseline and Arm-optimized benchmark records

Performance

Performance was measured on the reference configuration below. Results are intended to make the optimization reproducible but do not guarantee identical performance on every Arm-based system.

Reference configuration

Field Value
Device / platform vivo X300
CPU C1-Ultra, C1-Premium, C1-Pro, 8 cores
System memory 16 GB
OS android, Android 16 / OriginOS 6
Runtime ExecuTorch 1.1.0
Execution backend CPU (XNNPACK, KleidiAI)
Precision INT8, static PTQ — per-channel symmetric weights, per-tensor affine activations
Batch size 1
Input resolution 128x128x3
Runs / warmup 50 / 10

Performance results

Metric Original / baseline Arm-optimized Improvement
Model size (MB) 4.682 1.342 3.49x smaller
End-to-end latency p50 (ms) 1914.940 218.394 8.77x faster
End-to-end latency p90 (ms) 1926.900 224.093 8.60x faster
End-to-end latency p99 (ms) 1994.818 235.524 8.47x faster
Model load time (ms) 30.764 40.726 0.76x
Time to first inference (ms) 1981.444 272.362 7.28x faster
Peak memory (MB) 225.50 102.61 2.20x less
Average memory (MB) 221.43 102.17 2.17x less
Frames per second 0.522 4.579 8.77x

Accuracy

Accuracy was evaluated using the same preprocessing, input resolution, and evaluation protocol described below. Where possible, the optimized model is compared against the original model under the same evaluation conditions.

Evaluation setup

Field Value
Dataset DIV2K
Split val
Sample count 100
Metric(s) PSNR (dB), SSIM
Runtime ExecuTorch 1.1.0 (CPU, XNNPACK, KleidiAI)

Accuracy results

Metric Original / baseline Arm-optimized Change
PSNR (dB) 26.76 26.33 -0.43 dB
SSIM 0.7833 0.7473 -0.0360

Accuracy was measured using the evaluation setup described above. Users should re-evaluate the model on their own data before production use.

Arm optimization approach

Arm optimized this model for efficient inference on Arm-based platforms using a hardware-aware conversion and validation flow.

For this release, Arm used:

Optimization area Applied? Notes
Model conversion Yes Converted to ExecuTorch .pte via the PT2E export path
Quantization Yes INT8 PTQ-static — per-channel symmetric weights, per-tensor affine activations; calibrated on 800 randomly selected DIV2K samples. The final sub-pixel convolution was skipped from quantization to keep accuracy and runtime behavior within acceptable ranges
Runtime/backend selection Yes XNNPACK + KleidiAI delegate on CPU
Graph/runtime compatibility updates Yes Performed as part of the ExecuTorch export pipeline
Accuracy validation Yes Compared against the original model or published baseline
Performance validation Yes Measured on the reference Arm platform

The goal of this process is to improve deployment characteristics such as latency, memory use, model size, and runtime compatibility while preserving the model's intended behavior. Detailed conversion scripts, calibration configuration, or backend-specific implementation details may be provided separately where appropriate.

Using this model

Python environment

A representative evaluation target for this model is an Android handset, which does not run Python and uv. The Python/uv example runs on AWS Graviton (Ubuntu arm64) to confirm runtime compatibility only, and is intended as a guideline for building an equivalent run script on Mobile CPU systems. The environment recorded in .python-version, pyproject.toml, and uv.lock describes that Graviton host. No Graviton latency or memory benchmark is reported here — the figures in the Performance section were measured on the vivo X300 itself.

The runtime requires the ExecuTorch XnnpackBackend to be registered, declared as a required capability in pyproject.toml. No native packages beyond the Python wheels are needed.

Install dependencies

Dependencies are declared in pyproject.toml, which ships with this repository. Resolve and install them into a local virtual environment with uv:

uv python install
uv sync --frozen

Run the example

uv run example.py

An ordinary run prints the input and output sizes and writes nothing. To also save the upscaled image and its predictions JSON, pass an output directory:

uv run example.py --output out

Expected input

Property Value
Shape [1, 3, 128, 128]
Dtype float32
Range [0.0, 1.0]
Preprocessing to tensor (pass-through; the model expects raw [0, 1] RGB, no normalization); images larger than 128x128 are split into overlapping 128x128 tiles with 8 px overlap and blended back together after inference

Expected output

Property Value
Shape [1, 3, 512, 512]
Format Super-resolved RGB image tensor, values in [0, 1] after clamping
Postprocessing clamp to [0.0, 1.0], scale factor 4, stitch tiles with linear-ramp feathered blending

Intended use

This model is intended for developers evaluating image super-resolution workloads on Arm-based platforms. It is suitable as a reference implementation for benchmarking, prototyping, and integration exploration.

Limitations

  • The model is exported for a fixed 128x128 input tile. Larger images require tiled inference, which example.py implements; images smaller than the tile are replicate-padded to 128x128 and cropped back after inference.
  • Tiling cost grows with image area, so end-to-end latency for a full-resolution photograph is many times the per-tile latency reported in the Performance section.
  • Accuracy was evaluated on the DIV2K val split (100 samples) and may not generalize to all domains. The model was trained on synthetic real-world degradations, so it is at its best on noisy or compressed photographs and can over-smooth already-clean input.
  • Performance depends on the target device, runtime version, backend/delegate support, memory configuration, and system load.
  • The Python and uv environment describes an Arm64 Linux host, not the Android reference device. Deploying to a handset requires the ExecuTorch Android runtime and its own validation.
  • This release preserves the original model's intended task and behavior, but users should validate it for their own application, data, and deployment environment.
  • This repository is not a replacement for the original model documentation.

Additional notes

realesr-general-x4v3 is a compact VGG-style network trained on Real-ESRGAN's synthetic real-world degradation pipeline (blur, noise, compression artifacts) rather than clean bicubic downsampling, which makes it well suited to enhancing real-world photographs and video frames.

The final body convolution feeding the sub-pixel shuffle was skipped from quantization and kept at FP32, and the surrounding quantize/dequantize pair was removed after conversion, to keep accuracy and export-time graph compatibility within acceptable ranges.

About this version

Original Model: realesr-general-x4v3 by xinntao / Tencent ARC Lab - Repository

Optimization/conversion: Arm-Optimized version for execution on Arm-based platforms.

Converted/optimized by: Arm

License: The Original Model and the Optimized Model are subject to BSD-3-Clause.

This repository contains a converted or optimized version of the Original Model (the “Optimized Model”). The Original Model has been converted or optimized as described above for execution on Arm-based platforms.

No retraining or fine-tuning of the Original Model was performed as part of the conversion or optimization. The conversion or optimization was not intended to change the Original Model’s behavior or intended use.

Original Model and Documentation

For information about the Original Model, including its development, training data, intended uses, limitations and other relevant information, please refer to the Original Model repository. Information in that repository was provided by the original developer or other third parties and, unless expressly stated otherwise, has not been independently verified by Arm.

Licenses and Third-Party Terms

Use of the Original Model and the Optimized Model is subject to the applicable licenses, usage restrictions and other terms identified above and in the relevant repositories. Publication of the Optimized Model does not grant any rights beyond those provided under the applicable license terms.

You are responsible for reviewing those terms and ensuring that your use of the Original Model and the Optimized Model is permitted.

Purpose of this Release

The Optimized Model is provided as a reference implementation to demonstrate and evaluate execution and performance on Arm-based systems. It is not a production-ready or supported solution.

Arm’s publication of the Optimized Model does not constitute an endorsement or certification of the Original Model or a representation that the Optimized Model is suitable for production use or any particular purpose.

To the fullest extent permitted by applicable law (i) the Optimized Model is provided “as is.” Arm makes no representations or warranties that the Original Model, the Optimized Model or their outputs are accurate, safe, secure, non-infringing, legally compliant, suitable for production use or fit for any particular purpose; and (ii) Arm will not be liable for any loss or damage arising from or in connection with the Optimized Model, its use or its outputs.

You are responsible for independently evaluating the Optimized Model, its outputs and its suitability for your intended use, including compliance with applicable legal, regulatory, safety and security requirements.

Arm does not commit to provide ongoing support, maintenance or updates for the Optimized Model. Any use of or reliance on the Optimized Model or its outputs is at your own risk.

Downloads last month
26
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including Arm/realesr-general-x4v3-int8-xnnpack-executorch-vivo-x300