PIVOT- Input-aware Path Selection for Energy-efficient ViT Inference

Abhishek Moitra, Abhiroop Bhattacharjee, Priyadarshini Panda · DOI

Introduction

Vision Transformers (ViTs) have revolutionized computer vision, achieving state-of-the-art performance in tasks like image classification and object detection. However, their superior accuracy comes at a significant computational cost. The core of the Transformer architecture—the multi-head self-attention (MSA) module—is particularly resource-intensive, often accounting for 77% to 82% of the total inference latency.

While previous research has attempted to mitigate these costs through token pruning or attention sparsification, these approaches frequently encounter two major hurdles: hardware mismatch and input blindness. PIVOT (Input-aware Path Selection) addresses these challenges through a hardware-algorithm co-design framework that dynamically adjusts computation based on the complexity of the input image while remaining compatible with general-purpose processors (GPPs).

The Limitations of Current Optimization Techniques

Existing optimization strategies often struggle to translate theoretical FLOP reductions into real-world speedups.

  1. Hardware Mismatch: Techniques like attention sparsification create "holey" or sparse matrices. While these reduce the number of operations, standard CPUs and GPUs are optimized for dense matrix multiplications. Managing sparse data structures often introduces overhead that can make the "optimized" model slower than the original.
  2. Input Blindness: Most pruning methods apply a static reduction ratio to every image. In practice, an image of a simple object on a plain background requires significantly less computational "effort" to classify than a cluttered, complex scene. Treating all inputs equally leads to wasted energy on simple cases or accuracy loss on difficult ones.

The PIVOT Framework

PIVOT introduces a two-phase optimization strategy designed to maximize efficiency without sacrificing the dense computation patterns that modern hardware prefers.

Phase 1: Optimal Path Selection

The researchers utilized Centered Kernel Alignment (CKA) to analyze the redundancy between layers. By measuring the similarity between the outputs of different attention layers and their preceding Multi-Layer Perceptron (MLP) blocks, they identified that many attention modules in deeper layers contribute marginally to the final representation. PIVOT uses a "Path-Score" to determine which specific layers can be skipped to create different "effort levels" of the model.

To ensure the optimizations translate to actual energy savings, the framework employs PIVOT-Sim, a cycle-accurate simulator modeled after Xilinx FPGA architectures. This simulator allows the framework to search for the optimal balance between "Low Effort" (maximum layer skipping) and "High Effort" (minimal skipping) configurations that meet specific user-defined latency and energy targets.

Input-Aware Dynamic Inference

During inference, PIVOT employs a dynamic decision mechanism based on prediction entropy.

  1. An image is first processed by the Low Effort path.
  2. The model calculates the entropy (uncertainty) of the resulting prediction.
  3. If the entropy is below a certain threshold (indicating high confidence), the process stops.
  4. If the model is uncertain, it triggers a second pass through the High Effort path to ensure accuracy.

Key Insights and Results

PIVOT was evaluated using the ImageNet-1K dataset on popular architectures including DeiT-S and LVViT-S. The results demonstrate a significant leap over prior state-of-the-art methods:

  • Energy Efficiency: On an FPGA (ZCU102), PIVOT achieved a 2.7× reduction in Energy-Delay Product (EDP) compared to the LVViT-S baseline, with a negligible accuracy drop of only 0.2%.
  • Hardware Versatility: Because PIVOT skips entire blocks rather than creating sparse matrices, it is inherently "GPP-friendly." On standard hardware like the Nvidia V100 GPU and Intel Xeon CPUs, it delivered 1.8× higher throughput than competing methods like HeatViT.
  • The Softmax Bottleneck: A critical finding of the research is that the non-linear Softmax function can consume up to 63% of the total delay in certain ViT configurations. By skipping attention layers entirely, PIVOT directly bypasses this massive computational bottleneck.
  • Training Advantages: Training the various effort levels within the PIVOT framework is 2–3× faster than training a standard ViT from scratch, as the reduced-path models have fewer active parameters to optimize.

Conclusion and Future Work

PIVOT demonstrates that significant energy and latency gains are possible by acknowledging that not all images require the same amount of computational power. By combining hardware-aware path selection with dynamic, entropy-based inference, PIVOT bridges the gap between theoretical model compression and practical hardware acceleration.

While the current implementation uses static paths (pre-determined sequences of skipped layers), future work may explore even more granular dynamic path selection. Additionally, the authors suggest that the PIVOT-Sim framework could be extended to optimize other Transformer-based architectures, including Large Language Models (LLMs), where the computational demands are even more pressing.

Summary updated

BibTeX
@inproceedings{moitra2024pivot,
  author = {Abhishek Moitra and Abhiroop Bhattacharjee and Priyadarshini Panda},
  title = {{PIVOT- Input-aware Path Selection for Energy-efficient ViT Inference}},
  booktitle = {DAC},
  year = {2024},
  doi = {10.1145/3649329.3655679},
}
Figure