# [Quantize neural upscaling models with ExecuTorch](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/)

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/)
- [Explore PTQ and QAT for ExecuTorch INT8 deployment](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/1-introduction/)
- [Set up your environment for ExecuTorch quantization](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/2-set-up-your-environment/)
- [Apply PTQ and export a quantized VGF model](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/3-run-ptq-and-export-vgf/)
- [Apply QAT and export a quantized VGF model](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/4-run-qat-and-export-vgf/)
- [Inspect the graph with Model Explorer](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/5-validate-and-choose-a-quantization-strategy/)
- [Next Steps](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/quantize-neural-upscaling-models/_next-steps/)

## About this Learning Path

| Skill level:        | Advanced          |
|---------------------|-------------------|
| Reading time:       | 1 hr              |
| Last updated:       | 24 Aug 2026       |

### Authors:
- Richard Burton, Arm [GitHub](https://github.com/Burton2000)
- Annie Tallund, Arm [GitHub](https://github.com/annietllnd) [LinkedIn](https://linkedin.com/in/annietallund)

| Arm IP:            | [Mali](https://support.arm.com/?tab=compute-ip&Product%20Type=Graphics%20Processors)  |
|---------------------|-------------------|
| Tags:               | ML, Linux, macOS, Windows, ExecuTorch, TorchAO, Vulkan, TOSA, NX  |

### Who is this for?
This is an advanced topic for ML developers who want to reduce latency and memory bandwidth by exporting INT8 models to the `.vgf` file format using the ExecuTorch Arm backend.

### What will you learn?
Upon completion of this Learning Path, you will be able to:
- Explain when to use post-training quantization (PTQ) versus quantization-aware training (QAT)
- Prepare and quantize a PyTorch model using TorchAO PT2E quantization APIs
- Export the quantized model to TOSA and generate a model artifact with the ExecuTorch Arm backend
- Validate the exported graph by visualizing it using Google's Model Explorer

### Prerequisites
Before starting, you will need the following:
- Basic PyTorch model training and evaluation experience
- A development machine with Python 3.10+ and PyTorch installed that runs ExecuTorch

### Summary
You’ll use TorchAO and the ExecuTorch Arm backend to export INT8 `.vgf` artifacts from an image-to-image PyTorch model. First, you’ll set up the Python environment and run a CIFAR-10-based PTQ example, then extend it with QAT. Finally, you’ll inspect both exports in Model Explorer for layouts, operators, and tensor shapes before adapting the workflow to your model and calibration data.

### Frequently asked questions
<details>
<summary>How do I know the Arm backend export path worked?</summary>
Run the PTQ example and check `./output/` for an exported `.vgf` artifact. Open the artifact in Model Explorer with the VGF adapter and inspect the graph.
</details>

<details>
<summary>Where should the exported .vgf files appear?</summary>
Find the PTQ export in `./output/` and the QAT export in `./output_qat/`. Open the exported `.vgf` files from those directories for inspection.
</details>

<details>
<summary>How should I decide between PTQ and QAT for my model?</summary>
PTQ optimizes for speed of iteration, while QAT optimizes for quality and robustness. Export both, inspect the graphs in Model Explorer, and compare outputs to choose a strategy that fits your accuracy and development needs.
</details>

<details>
<summary>What changes do I make to use my own model and data?</summary>
First, run the CIFAR-10 example to verify your environment. Then, adapt the PTQ or QAT export structure in `quantize_and_export_vgf.py` for your FP32 model, inference input, and representative calibration data or QAT fine-tuning loop.
</details>

<details>
<summary>What should I look for when inspecting the graph in Model Explorer?</summary>
Check for unexpected layout conversions, operators that you didn’t intend to run on your GPU path, and model I/O shapes that don’t match your integration. Use these findings before you integrate the `.vgf` artifact into your runtime.
</details>
