SegQuant: A Semantics-Aware and Generalizable Quantization Framework for Diffusion Models

Jiaji Zhang, Ruichao Sun, Hailiang Zhao, Jiaju Wu, Peng Chen, Hao Li, Yuying Liu, Kingsum Chow, Gang Xiong, Shuiguang Deng

TL;DR

SegQuant is a deployment-ready, post-training quantization (PTQ) framework designed to make massive diffusion models computationally efficient without sacrificing image quality. By extracting quantization strategies directly from static computation graphs and preserving asymmetric activation functions (like SiLU) via hardware-native parallel execution, SegQuant bridges the gap between high-fidelity generation and automated industrial deployment.

What Problem Does This Paper Address?

Diffusion models like Stable Diffusion 3.5 and FLUX.1 generate stunning imagery but are notoriously resource-heavy. While Post-Training Quantization (PTQ) can compress these models to lower precision (e.g., 8-bit integers) without expensive retraining, existing methods suffer from a Compiler Gap.

Modern AI compilers rely on static graph analysis to optimize models for production deployment. However, current diffusion PTQ techniques often depend on runtime-dynamic data (like timestep-varying activations) or hardcoded, architecture-specific rules (like manual fixes for UNet skip connections). This makes them incompatible with standard deployment toolchains. Furthermore, uniform quantization frequently squashes the delicate, asymmetric activation distributions inherent to diffusion backbones, severely degrading the visual quality of the generated outputs.

Methods

SegQuant introduces a top-down, modular framework that eliminates the need for dynamic heuristics or manual rules:

Figure 1. SegQuant framework follows a top-down workflow that effectively integrates existing quantization techniques with our novel contributions.
  1. SegLinear (Semantics-Aware Quantization): Instead of treating linear layers as uniform matrices, SegLinear uses static graph analysis (via torch.fx) to automatically identify structural patterns like chunk, split, reshape, and concat. It algorithmically partitions weights based on these semantic boundaries, quantizing distinct data pathways independently to prevent "quantization interference" between heterogeneous inputs (e.g., separating time embeddings from latent features).
  2. DualScale (Polarity-Preserving Quantization): Modern diffusion models heavily feature activation functions like SiLU and GELU, which produce highly skewed distributions with a narrow but critical negative tail. DualScale splits the activation matrix into non-negative ($X_+$) and negative ($X_-$) components, applying distinct quantization scales to each. To avoid the latency penalty of custom hardware kernels, it executes both paths simultaneously using a single, highly efficient BatchedGEMM operation via NVIDIA's CUTLASS library, combining the results in a fused epilogue.
Figure 5. SegLinear reveals two semantic patterns in the weight matrix that guide quantization.

Datasets

The authors evaluated SegQuant across three prominent text-to-image datasets using 5,000 randomly sampled images per benchmark:

  • COCO (Common Objects in Context)
  • MJHQ-30K
  • DCI (Dense Captions and Images)

Key Insights and Ideas

  • The Importance of the Negative Tail: Unlike ReLU, which completely zeroes out negative values, functions like SiLU retain dense, low-magnitude negative values. The authors discovered that these negative activations preserve high-frequency details and textural consistency. Standard quantization uniform bins compress this narrow range too aggressively, resulting in a noticeable loss of image detail.
Figure 7. Visual impact of negative-range quantization in SD3.5 (timestep 60, COCO). Only the negative part of activations is quantized to isolate its contribution to image details. (a) and (c) show full images; (b) and (d) zoom in to highlight detail and range loss.
  • Static Graphs Hold the Key: You don't need runtime data to find structural boundaries. By analyzing the static computation graph, SegQuant achieves architecture-agnostic segmentation that naturally aligns with how compilers optimize code.
  • Hardware-Native Parallelism Trumps Custom Kernels: Rather than designing non-standard bit layouts or custom hardware quantizers that break kernel fusion, mapping asymmetric quantization to standard BatchedGEMM operations preserves maximum hardware throughput on modern GPUs.

Key Results

SegQuant was tested against leading PTQ baselines (such as Q-Diffusion, PTQ4DiT, and SVDQuant) across multiple architectures:

  • Stable Diffusion 3.5 (DiT-based): In 8-bit weight/activation (W8A8) settings, SegQuant-G achieved an FID score of 23.94 on MJHQ-30K, significantly outperforming PTQ4DiT (25.66) and approaching the unquantized FP16 baseline (23.70).
  • FLUX.1-dev (12B Parameter DiT): Under W8A8 quantization, SegQuant-A achieved an FID of 22.85, remarkably beating the original BF16 baseline score of 23.21 on the MJHQ-30K dataset.
  • Efficiency: Hardware profiling on an NVIDIA RTX 4090 showed that SegQuant maintains a memory footprint comparable to naive quantization methods while introducing only a negligible runtime overhead, making it highly practical for real-world deployment pipelines.

Limitations and Future Work

The authors do not explicitly detail limitations within the main text. However, based on the methodology, promising future directions include extending this compiler-native static graph analysis to video-generation diffusion models, which exhibit even more complex temporal dependencies and hardware acceleration challenges.

Summary updated

BibTeX
@inproceedings{zhang2026segquant,
  author = {Jiaji Zhang and Ruichao Sun and Hailiang Zhao and Jiaju Wu and Peng Chen and Hao Li and Yuying Liu and Kingsum Chow and Gang Xiong and Shuiguang Deng},
  title = {{SegQuant: A Semantics-Aware and Generalizable Quantization Framework for Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=awny1w4CR1},
}
Figure