Skip to main content
QUICK REVIEW

[Paper Review] Applying the Residue Number System to Network Inference

Mohamed R. Abdelhamid, Skanda Koppula|arXiv (Cornell University)|Dec 13, 2017
Cryptography and Residue ArithmeticComputer Science4 references10 citations
TL;DR

This paper proposes using the Residue Number System (RNS) to accelerate neural network inference by replacing standard arithmetic with RNS-based multiplication and addition, achieving up to 48% lower energy consumption in multipliers and enabling energy-efficient inference on low-power hardware. The approach leverages RNS's parallelism and efficient moduli arithmetic, with experimental results showing feasible accuracy under 6-bit integer constraints and a favorable break-even point for energy savings on fully-connected layers.

ABSTRACT

This work explores the lesser studied objective of optimizing the multiply-and-accumulates executed during evaluation of the network. In particular, we propose using the Residue Number System (RNS) as the internal number representation across all layer evaluations, allowing us to explore usage of the more power-efficient RNS multipliers and adders. Using results from simulation of our RNS arithmetic block implementations, we show theoretical power advantages of using RNS for an end-to-end evaluator.

Motivation & Objective

  • To explore the use of the Residue Number System (RNS) as an alternative number representation for accelerating neural network inference, particularly targeting energy efficiency.
  • To reduce the energy and area overhead of multiply-and-accumulate (MAC) operations—critical bottlenecks in CNN inference—by replacing standard 32-bit arithmetic with RNS-based computation.
  • To evaluate the feasibility of maintaining network accuracy under RNS constraints by training networks with fixed-point weights and activations within a modulus range.
  • To determine the break-even point at which RNS-based inference becomes more energy-efficient than conventional inference, especially for fully-connected and convolutional layers.
  • To implement and analyze RNS-specific hardware blocks (adders, multipliers, ReLU, and comparator modules) in Verilog and evaluate their power, area, and latency using a 65nm CMOS process.

Proposed method

  • The paper uses a 4-tuple modulus set {2^7−1, 2^7+1, 2^8−1, 2^8+1} to represent integers in RNS, enabling a 28-bit equivalent range with 32-bit storage, and ensuring moduli are pairwise coprime for unique representation.
  • RNS arithmetic is performed element-wise: addition and multiplication are computed modulo each individual modulus, enabling parallel and low-power computation using optimized RNS adder and multiplier architectures.
  • A comparison module based on parity checking of RNS differences is implemented to support ReLU nonlinearity, with a simplified 'half-comparator' for thresholding at M/2 to reduce logic complexity.
  • The ReLU and comparator modules are implemented in combinational logic using modified versions of existing RNS comparison techniques, with precomputed parity values for efficiency.
  • Hardware blocks (adders, multipliers, converters, ReLU, and comparator) are designed in Bluespec/SystemVerilog and synthesized using a 65nm CMOS process to estimate power, area, and latency.
  • A full network inference pipeline is simulated by training a 6-layer CNN/FC network on SVHN with 6-bit integer weights and activations, comparing accuracy under RNS constraints to full-precision and 32-bit integer baselines.

Experimental results

Research questions

  • RQ1Can RNS-based arithmetic reduce energy consumption in neural network inference, particularly in the multiply-and-accumulate (MAC) units?
  • RQ2What is the accuracy degradation when constraining weights and activations to fixed-point integers within a modulus range suitable for RNS representation?
  • RQ3At what layer size or network configuration does the energy savings from RNS-based MAC units outweigh the overhead of RNS-specific ReLU and comparator operations?
  • RQ4How do the power, area, and latency of RNS hardware blocks compare to their 32-bit counterparts in a standard CMOS process?
  • RQ5Is it feasible to perform end-to-end inference using only RNS arithmetic, including activation functions and output selection, without conversion back to standard binary?

Key findings

  • The RNS multiplier consumes 1.56 mW, achieving 48.7% lower power than the 32-bit multiplier (3.04 mW), with a 95.4 ps positive slack allowing higher clock frequency.
  • The RNS adder consumes 1.18 mW, slightly more than the 32-bit adder (1.05 mW), but operates at the same frequency with improved timing margin.
  • On the SVHN dataset, a (6,6)-FP network using RNS constraints achieved a test error of 6.69%, a 2.74% increase over the (32,32)-FP baseline (3.95%), indicating moderate accuracy degradation under RNS constraints.
  • The (6,6)-INT network achieved a test error of 7.07%, showing a 2.53% accuracy drop compared to the (32,32)-INT baseline (4.54%), suggesting integer quantization may introduce additional training instability.
  • The break-even analysis indicates that RNS-based inference becomes energy-efficient even for small fully-connected layers, as the energy savings from RNS MACs outweigh the ReLU overhead when input size X > 0.98.
  • The energy savings are robust across layer types, with the same break-even condition applying to convolutional layers when X is replaced by the filter output size (C_in × K_X × K_Y).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.