arXiv:2610.21825cs.AROct 2026

Manuscript Offprint

arXiv:2610.21825

Compiling Multi-Threshold Operators for Quantized Non-Monotonic and Fine-Granular Activations in Custom-Tailored DNN Accelerators

Christoph Berganski, Felix Jentzsch, Marco Platzner

Christoph Berganski

Computer Engineering Group

Paderborn University

Paderborn, Germany

christoph.berganski@upb.de

Felix Jentzsch

Computer Engineering Group

Paderborn University

Paderborn, Germany

felix.jentzsch@upb.de

Marco Platzner

Computer Engineering Group

Paderborn University

Paderborn, Germany

platzner@upb.de

Abstract—Aggressive quantization of neural networks can expose activation functions as bottlenecks for efficient hardware acceleration. Implementing quantized activations as multi-threshold operations has been shown to be a promising optimization, allowing for efficient hardware implementation of few-bit activations. However, current implementations are limited to monotonically increasing functions, quantization schemes with one-dimensional (per-channel) granularity and a small set of predefined activation-quantizer combinations. We formalize the multi-threshold representation to extend it to non-monotonic functions and fine-granular parameters, i.e., multi-dimensional thresholds. For automated conversion of quantized function compositions into threshold representation, we propose a systematic approach via algebraic rules integrated into the ONNX-based compiler infrastructure. We experimentally validate our solution on a selection of monotonic and non-monotonic functions by extending the binary search based multi-threshold operator that is integrated into the FINN framework for end-to-end synthesis of custom-tailored FPGA accelerators. The cost of hardware support for non-monotonicity and fine-granularity is characterized in comparison to an alternative approach utilizing existing operators via graph-level decomposition. We compare our method to prior work as well as the approach taken by the hls4ml framework. As an outlook, we demonstrate the prospects of using the multi-threshold representation during the training of a neural network as a form of quantization aware training.

I. INTRODUCTION

Quantization has emerged as the key model compression technique for optimizing deep neural network inference [1]–[3]. Custom FPGA-based accelerators particularly benefit from aggressive low-bit quantization, typically using 8-bit or lower precisions [3]–[9]. Streaming dataflow architectures exploiting pipelined model parallelism are well suited for such deployments, enabling efficient implementations of flexible quantization schemes. FINN [5], [6], [10] provides an end-to-end compilation flow for models trained and quantized with PyTorch [11] and Brevitas [12], with optimizations expressed through ONNX graph transformations [13], [14].

Quantization methods can be categorized by when quantization is applied – post-training quantization (PTQ) or quantization-aware training (QAT) – and what is quantized, i.e., weights, activations, or both [1]–[3]. Early work focused on quantizing weights and multiply-accumulate (MAC) operations in fully connected, convolutional, and attention layers. As these reach increasingly low bit widths, optimizing activations and layer tails, i.e., chains of element-wise operations following a layer, such as normalization, activation, and quantization, becomes critical [15]–[17]. Simultaneously, preserving accuracy requires expressive scale factors, such as floating-point scales, and fine-granular quantization schemes [15], [18]–[22].

At very low bit widths, implementing quantized functions through successive thresholding, also known as multi-threshold functions, has emerged as an effective optimization [5], [6], [15], [23]. In FINN, multi-threshold functions exactly represent quantized layer tail operations, including nonlinearities and floating-point scales, without costly floating-point inference. Here, exact means that no approximation beyond the inherent quantization error is introduced, unlike fixed-point approximations of floating-point values. Enabled by streamlining [15], [23], scales, biases, and non-linearities are absorbed into threshold values through algebraic transformations, reducing layer tail computations to threshold comparisons. In streaming dataflow architectures, these functions are specialized for each layer tail.

The multi-threshold implementation in FINN is limited to monotonically increasing functions and, in practice, supports only predefined activation–quantizer combinations, i.e., combinations of quantized identity and Relu. However, modern architectures employ diverse activation functions [24], [25], including non-monotonic variants such as Silu [26]. Moreover, FINN restricts quantization granularity to the final axis of the activation tensor. While SIRA [15] relaxes some of these constraints, it relies on expensive compile-time simulation of the layer tail. Consequently, we identify the lack of a systematic and lightweight compilation methodology for translating quantized layer tails into multi-threshold representation and corresponding hardware as a key barrier to a broader adoption.

To extend the flexibility and applicability of the multi-threshold representation, we make the following contributions:

  1. We formalize the multi-threshold representation, including its assumptions, constraints, and principles for effi-cient hardware acceleration.

  2. We extend the representation and hardware architecture to non-monotonic and fine-granular functions.

  3. We introduce an ONNX-based compiler integration converting quantized functions into multi-threshold representation and fusing operators through algebraic rules.

  4. We present an initial study of directly learning multi-threshold representations as a form of QAT, aligning training-time representation with the target hardware.

The remainder of this paper is structured as follows: Section II introduces background and formalism of the multi-threshold representation, Sections III and IV extend its applicability by addressing monotonicity and granularity limitations through corresponding hardware implementations. Section V presents our compiler integration for converting functions into multi-threshold representation. Section VI discusses related work and contrasts our approach. Section VII explores the prospects of learning multi-threshold representations during training. Section VIII concludes the paper.

References (35)