Quark: An Integer RISC-V Vector Processor for Sub-Byte Quantized DNN Inference

MohammadHossein AskariHemmat, Théo Dupuis, Yoan Fournier, Nizar El Zarif, Matheus A. Cavalcante, Matteo Perotti, Frank K. Gürkaynak, Luca Benini, François Leduc-Primeau, Yvon Savaria, Jean-Pierre David · DOI

Introduction

Deep Neural Networks (DNNs) are increasingly essential for edge computing applications, yet their deployment on resource-constrained devices like smartwatches and remote sensors remains challenging due to high power and memory demands. Quantization—the process of reducing the precision of weights and activations—is a primary strategy to mitigate these costs. While 8-bit (Int8) quantization is widely supported, "sub-byte" quantization (1-bit and 2-bit) offers the potential for even greater efficiency. However, standard hardware often fails to realize these gains because it is optimized for higher-precision arithmetic, leading to underutilized circuitry and data-handling bottlenecks.

Quark addresses this gap by redesigning a RISC-V vector processor specifically for the integer-only, low-precision requirements of sub-byte inference. By stripping away unnecessary hardware and introducing targeted ISA extensions, Quark achieves significant improvements in area efficiency and throughput.

Architectural Design: The "Less is More" Philosophy

Quark is built upon Ara, an open-source 64-bit RISC-V vector processor. To optimize for sub-byte AI tasks, the researchers performed several architectural modifications:

  1. Removal of the Vector Floating Point Unit (VFPU): Since quantized DNN inference is primarily an integer-domain task, the VFPU was removed to save area. For the infrequent floating-point operations required (such as re-scaling layer outputs), the workload is offloaded to the CVA6 scalar core.
  2. Bit-Serial Arithmetic: Rather than implementing dedicated 1-bit or 2-bit multipliers, Quark utilizes bit-serial logic. This approach uses logical AND operations followed by a population count, which is mathematically equivalent to multiplication at these precisions but significantly more hardware-efficient.
  3. Physical Optimization: The design was implemented in GlobalFoundries’ 22nm FD-SOI technology. By removing the VFPU and streamlining the vector lanes, each Quark lane is 2.3x smaller and 1.9x more power-efficient than the original Ara lane.

Custom ISA Extensions

To overcome the specific challenges of sub-byte data movement and calculation, three specialized instructions were added to the RISC-V Instruction Set Architecture (ISA):

  • vpopcnt: Performs a population count on individual vector elements, a core component of bit-serial multiplication.
  • vshacc: A shift-and-accumulate instruction that fuses operations to accelerate bit-serial arithmetic.
  • vbitpack: This instruction addresses the "data formatting bottleneck." It allows the processor to efficiently slice and pack bits into registers, preventing the overhead of data rearrangement from negating the speed gains of low-precision math.

Performance and Accuracy

The researchers evaluated Quark using synthetic kernels and a ResNet18 model trained on the CIFAR-100 dataset. The results highlight a significant performance leap over standard 8-bit architectures:

  • Speedups: Quark achieved a 5.7x speedup for 1-bit precision and a 3.5x speedup for 2-bit precision compared to Ara running standard Int8 kernels.
  • The 2-Bit Sweet Spot: Using Learned Step Size Quantization (LSQ), the 2-bit model achieved 76.81% accuracy on CIFAR-100, nearly identical to the 76.82% achieved by full 32-bit floating-point (FP32) models. This suggests that 2-bit precision provides an ideal balance of extreme efficiency and high accuracy.
  • Clock Frequency: Quark maintains a high-performance profile, operating at a 1 GHz clock frequency.

Limitations and Future Directions

While Quark demonstrates exceptional efficiency for inference, it is strictly an integer-only engine and is not intended for training or general-purpose scientific computing. Future work may focus on integrating Quark into broader compiler frameworks like Apache TVM or MLIR to automate deployment across diverse model architectures. Additionally, while offloading floating-point tasks to the scalar core saves area, researchers must ensure this does not become a bottleneck for models requiring frequent re-scaling between layers.

Conclusion

Quark demonstrates that by specializing hardware for the specific mathematical requirements of sub-byte quantization, it is possible to achieve massive gains in power and area efficiency without sacrificing accuracy. As AI continues to move toward the extreme edge, architectures like Quark provide a blueprint for high-performance, low-power intelligence.

Summary updated

BibTeX
@inproceedings{askarihemmat2023quark,
  author = {MohammadHossein AskariHemmat and Théo Dupuis and Yoan Fournier and Nizar El Zarif and Matheus A. Cavalcante and Matteo Perotti and Frank K. Gürkaynak and Luca Benini and François Leduc-Primeau and Yvon Savaria and Jean-Pierre David},
  title = {{Quark: An Integer RISC-V Vector Processor for Sub-Byte Quantized DNN Inference}},
  booktitle = {ISCAS},
  year = {2023},
  doi = {10.1109/iscas46773.2023.10181985},
}
Figure