pytorch-quantization

Quantize PyTorch models to INT8 using PTQ and QAT.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cuba6112/skillfactory --skill pytorch-quantization
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pytorch-quantization
Source: https://github.com/cuba6112/skillfactory/tree/main/skills/pytorch-quantization
Command: npx skills add https://github.com/cuba6112/skillfactory --skill pytorch-quantization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, torchvision, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need to reduce model size and accelerate inference for PyTorch models, particularly for deployment on resource-constrained environments.

Core Features & Use Cases

  • INT8 Quantization: Convert floating-point models to use 8-bit integers for reduced memory footprint and faster computation.
  • Post-Training Quantization (PTQ): Apply quantization to an already trained model without retraining.
  • Quantization Aware Training (QAT): Train a model with quantization simulation to maintain higher accuracy.
  • Use Case: Deploy a computer vision model on an edge device where memory and processing power are limited, significantly improving its performance and reducing power consumption.

Quick Start

Use the pytorch-quantization skill to demonstrate manual tensor quantization and load a pre-quantized ResNet50 model.

Frequently Asked Questions about pytorch-quantization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply INT8 quantization to a PyTorch model for inference acceleration?▼

INT8 quantization converts PyTorch floating-point models to 8-bit integers, reducing memory footprint and accelerating inference. You can apply it via Post-Training Quantization without retraining or use Quantization Aware Training to maintain accuracy.

What is the difference between Post-Training Quantization and Quantization Aware Training in PyTorch?▼

Post-Training Quantization (PTQ) applies INT8 quantization to an already trained model without retraining, while Quantization Aware Training (QAT) simulates quantization during training to maintain higher accuracy for edge deployment.

Does PyTorch quantization work for deploying computer vision models on edge devices?▼

PyTorch quantization is designed for deploying computer vision models on edge devices. It reduces model size and improves inference speed on resource-constrained environments with limited memory and processing power.

What backends does PyTorch INT8 quantization use for efficient execution?▼

PyTorch INT8 quantization utilizes FBGEMM and QNNPACK backends for efficient execution. These backends optimize inference performance on edge devices and CPU instances for your quantized models.

Can I use torchvision models for quantization aware training?▼

You can quantize torchvision models using Quantization Aware Training (QAT). This Skill supports QAT to simulate quantization during training, helping maintain higher accuracy when converting floating-point models to INT8.

When should I use Quantization Aware Training instead of Post-Training Quantization?▼

Use Quantization Aware Training (QAT) instead of Post-Training Quantization (PTQ) when you need to maintain higher accuracy. QAT trains the model with quantization simulation, while PTQ applies quantization directly without retraining.