Compressing deep neural networks on FPGAs to binary and ternary precision with HLS4ML

Giuseppe Di Guglielmo, Javier Duarte, Philip Harris, Duc Hoang, Sergo Jindariani +11 more
3/11/2020
120 citations
cs.LGeess.SPhep-ex

Official code: fastmachinelearning/hls4ml (2,211 stars, Python, Apache-2.0, PyTorch, last commit 2026-10-20).

Abstract

We present the implementation of binary and ternary neural networks in the hls4ml library, designed to automatically convert deep neural network models to digital circuits with FPGA firmware. Starting from benchmark models trained with floating point precision, we investigate different strategies to reduce the network's resource consumption by reducing the numerical precision of the network parameters to binary or ternary.

Show full abstract

We discuss the trade-off between model accuracy and resource consumption. In addition, we show how to balance between latency and accuracy by retaining full precision on a selected subset of network components. As an example, we consider two multiclass classification tasks: handwritten digit recognition with the MNIST data set and jet identification with simulated proton-proton collisions at the CERN Large Hadron Collider. The binary and ternary implementation has similar performance to the higher precision implementation while using drastically fewer FPGA resources.

View on arXivView PDF

Code Implementations(1)

PyTorchApache-2.0

Machine learning on FPGAs using HLS

2,211616Python, C++Oct 25, 20171 months agoApache-2.0
fpgahlsintel-hlskerasmachine-learning+6 more

Similar Papers

Cite this paper

@article{guglielmo2020compressing,
  title  = {Compressing deep neural networks on FPGAs to binary and ternary precision with HLS4ML},
  author = {Giuseppe Di Guglielmo and Javier Duarte and Philip Harris and Duc Hoang and Sergo Jindariani and Edward Kreinar and Mia Liu and Vladimir Loncar and Jennifer Ngadiuba and Kevin Pedro and Maurizio Pierini and Dylan Rankin and Sheila Sagear and Sioni Summers and Nhan Tran and Zhenbin Wu},
  year   = {2020},
  eprint = {2003.06308},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2003.06308}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2003.06308.svg)](https://codeofpaper.com/paper/2003.06308)

Discussion