Course contentsShow
← Machine Learning and Deep Learning
Lesson 2651 of 3,53857. Model Compression: QuantizationFree lesson

Per-Channel vs Per-Tensor QAT

Applying separate quantization parameters per output channel for better accuracy in convolutions and linear layers.

Per-Channel vs Per-Tensor QAT

What You'll Learn

You'll understand how applying quantization parameters separately per output channel—rather than per entire tensor—can significantly improve quantized model accuracy in convolution and linear layers.

The Core Idea

In Quantization-Aware Training (QAT), you have two main choices for where to apply scale and zero-point parameters:

Per-Tensor: Use a single scale and zero-point for the entire weight tensor. Simple, but treats all channels equally.

Per-Channel: Use separate scale and zero-point values for each output channel (filter) in convolutions or each output dimension in linear layers.

Why Per-Channel Matters

Think of per-channel quantization like adjusting the volume on individual instruments in an orchestra rather than using one master volume knob. Different output channels often have vastly different weight distributions—some filters might have large weights, others small. A single quantization scale forces you to either:

  • Waste precision on small-weight channels, or
  • Clip/saturate large-weight channels

Per-channel quantization lets each channel use its dynamic range optimally.

When to Use Per-Channel

Use per-channel for weights in:

  • Convolutional layers (per output channel)
  • Linear/fully-connected layers (per output feature)

Keep per-tensor for activations: Activations typically maintain more consistent ranges across channels, and per-channel activations complicate hardware acceleration.

Accuracy vs Complexity Trade-off

Per-channel quantization stores more parameters (one scale/zero-point per channel instead of one per layer), but the overhead is negligible compared to the weights themselves. The accuracy gain—especially in lower bit-widths like INT8—usually justifies this minimal increase.

Key Takeaway: Per-channel QAT applies separate quantization parameters to each output channel in weight tensors, allowing better preservation of per-channel weight distributions and typically yielding higher accuracy than per-tensor quantization with minimal overhead.