Q-PETR: Quant-aware Position Embedding Transformation for Multi-View 3D Object Detection

Jiangyong Yu, Changyong Shu, Dawei Yang, Zichen Yu, Xing Hu, Yan Chen · DOI

Abstract

FQ-PETR is the first fully quantized framework designed to enable high-performance PETR-based 3D object detectors on edge hardware. The PETR family of models suffers from significant accuracy degradation under standard 8-bit quantization due to a massive "magnitude imbalance" between multi-modal features and the presence of hardware-unfriendly non-linear operators. This paper identifies the "inverse-sigmoid" function as a primary cause of feature inflation and proposes three key innovations: Quantization-Friendly LiDAR-ray Position Embedding (QFPE) to align feature magnitudes, Dual-Lookup Tables (DULUT) for efficient non-linear approximation, and Quantization After Numerical Stabilization (QANS) to preserve attention patterns. Evaluated on the nuScenes dataset, FQ-PETR achieves near-lossless W8A8 performance, providing a 3.9x speedup and 75% reduction in memory footprint compared to floating-point baselines.

Introduction

Multi-view 3D object detection is a cornerstone of autonomous driving, and the PETR (Position Embedding Transformation) family of models currently represents the state-of-the-art. These models function by projecting 2D image features into 3D space using camera-ray positional embeddings (PE). However, deploying these models on real-world automotive chips is difficult because standard quantization—converting 32-bit floating-point numbers to 8-bit integers—causes accuracy to plummet.

Modality disparity between camera-ray PE and image features.

The authors identify two main culprits for this failure. First is Modality Disparity: as shown in Figure 1, camera-ray PE values range from -130 to 130, while image features range only from -4 to 4. When added together in 8-bit, the image features are essentially rounded away to zero. Second is Non-linear Complexity: operators like Softmax and SiLU are mathematically unfriendly to hardware, leading to massive approximation errors in standard quantization pipelines.

Methods

The authors propose three synergistic innovations to create a fully quantized pipeline:

Quantization-Friendly LiDAR-ray Position Embedding (QFPE)

The original PETR uses an "inverse-sigmoid" function that significantly inflates the magnitude of coordinates. FQ-PETR replaces this with a LiDAR-prior-guided sampling strategy. By sampling a single 3D point per pixel and using anchor-based embeddings, they eliminate problematic non-linearities and bring the PE range down to $\pm 29.7$, aligning it much better with image features.

Comparison between original PETR PE and the proposed QFPE.

Dual-Lookup Table (DULUT)

To handle non-linear functions like SiLU or GELU without specialized hardware, the authors use two cascaded linear lookup tables (LUTs). The first table acts as a nonlinear index mapper that clusters inputs, and the second stores the actual values. This achieves high precision with very few entries, making it compatible with standard edge-device compilers.

Quantization After Numerical Stabilization (QANS)

Standard quantization often occurs before Softmax stabilization, leading to attention distortion. FQ-PETR performs quantization after subtracting the maximum logit. This constrains inputs to a stable, non-positive range ($[-\beta, 0]$), preserving the delicate attention patterns needed for accurate detection.

Key Results

The framework was evaluated on the nuScenes dataset, a benchmark for autonomous driving featuring 360-degree camera coverage. FQ-PETR sets a new standard for efficient 3D detection:

  • Near-Lossless Accuracy: Under W8A8 quantization, it maintains <1% degradation in mAP (mean Average Precision) and NDS (nuScenes Detection Score) compared to the floating-point baseline.
  • Massive Speedup: On an NVIDIA RTX 4090, the quantized model runs at 27.6 FPS, a 3.9x speedup over the FP32 version (7.1 FPS).
  • Memory Efficiency: It reduces the memory footprint from 4.8 GB to just 1.3 GB, a 75% saving.
  • Superiority: It significantly outperforms existing Post-Training Quantization (PTQ) methods like SmoothQuant, which often see mAP drops of 10-20% on these architectures.

Conclusion

FQ-PETR demonstrates that the key to efficient 3D detection lies in hardware-algorithm co-design. By identifying structural "villains" like the inverse-sigmoid function and replacing them with quantization-friendly alternatives, the researchers achieved near-lossless 8-bit performance. Future work will explore ultra-low bit-widths (e.g., 4-bit) and the generalization of these techniques to larger transformer-based backbones.

Summary updated

BibTeX
@inproceedings{yu2026q,
  author = {Jiangyong Yu and Changyong Shu and Dawei Yang and Zichen Yu and Xing Hu and Yan Chen},
  title = {{Q-PETR: Quant-aware Position Embedding Transformation for Multi-View 3D Object Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i14.38204},
}
Figure