[Paper Review] Technical Report: NEMO DNN Quantization for Deployment Model
This paper introduces a formal framework for layer-wise DNN quantization focused on deployment efficiency, proposing two novel representations—QuantizedDeployable and IntegerDeployable—that enable full integer inference without floating-point operations or explicit fixed-point arithmetic. The key contribution is a mathematically rigorous method to represent DNNs using only integer computations, ensuring accuracy and hardware efficiency in edge deployment.
This technical report aims at defining a formal framework for Deep Neural Network (DNN) layer-wise quantization, focusing in particular on the problems related to the final deployment. It also acts as a documentation for the NEMO (NEural Minimization for pytOrch) framework. It describes the four DNN representations used in NEMO (FullPrecision, FakeQuantized, QuantizedDeployable and IntegerDeployable), focusing in particular on a formal definition of the latter two. An important feature of this model, and in particular the IntegerDeployable representation, is that it enables DNN inference using purely integers - without resorting to real-valued numbers in any part of the computation and without relying on an explicit fixed-point numerical representation.
Motivation & Objective
- To define a formal, mathematically grounded framework for deep neural network (DNN) layer-wise quantization tailored for final deployment.
- To address the challenge of enabling full integer inference in DNNs without relying on floating-point arithmetic or fixed-point representations.
- To provide a systematic transformation pipeline from full-precision models to deployable integer-only inference through four distinct DNN representations.
- To support quantization-aware training and post-training quantization while preserving model accuracy during deployment.
- To formalize the handling of operations like batch normalization, pooling, and addition in the context of integer-only inference.
Proposed method
- Defines four DNN representations: FullPrecision, FakeQuantized, QuantizedDeployable, and IntegerDeployable, each serving a distinct stage in the quantization pipeline.
- Introduces a formal quantization model where tensors are represented as $\mathbf{t} = \alpha_{\mathbf{t}} + \varepsilon_{\mathbf{t}} \cdot \textsc{q}_{\mathbf{t}}(\mathbf{t})$, with $\textsc{q}_{\mathbf{t}}$ a monotonic, piecewise-constant quantization function mapping real values to integers.
- Applies BN folding to merge batch normalization parameters into preceding linear layers, simplifying the computation graph for deployment.
- Uses requantization in integer-add operations via the PACT_IntegerAdd module, where outputs are scaled and shifted using a fixed-point approximation with a default factor of 256.
- Transforms average pooling operations into integer-only equivalents by approximating division by $K_1K_2$ as a right bit-shift after multiplication by $\lfloor 2^d / (K_1K_2) \rfloor$.
- Supports input bias adjustment via `net.add_input_bias()` to align input representations with the canonical $[0, \beta)$ quantized space.
Experimental results
Research questions
- RQ1How can a DNN be formally represented to enable end-to-end integer inference without floating-point operations?
- RQ2What mathematical framework ensures that quantization preserves model accuracy during deployment while minimizing bit-width?
- RQ3How can batch normalization and pooling layers be transformed to support integer-only computation without introducing numerical errors?
- RQ4What mechanisms allow for accurate, efficient, and hardware-friendly inference using only integer arithmetic in DNNs?
- RQ5How can the quantization pipeline be structured to support both quantization-aware training and post-training quantization in a unified framework?
Key findings
- The IntegerDeployable representation enables full inference using only integer arithmetic, eliminating the need for floating-point operations or explicit fixed-point formats.
- The framework supports accurate integer-only inference through a combination of quantization functions, requantization in additions, and bit-shift approximations in average pooling.
- BN folding is successfully applied to merge batch normalization parameters into linear layers, simplifying the computation graph and enabling integer-only inference.
- The PACT_IntegerAdd module enables correct integer-based addition with dynamic range control via a default requantization factor of 256, ensuring relative error $< 1/256$.
- Average pooling is transformed into an integer-only operation by approximating division by $K_1K_2$ as a right bit-shift after multiplication by a scaled integer approximation.
- The input representation can be aligned with the canonical quantized space via an input bias adjustment, ensuring consistency across the entire network graph.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.