An embedded vision transformer with quantization-friendly simple attention, optimized buffers, and SIMD acceleration
摘要
Vision Transformer (ViT) is the key to state-of-the-art DNN models in computer vision. Due to the high memory requirement and computational burden of ViTs, a lightweight design and integer quantization are essential approaches . However, these lightweight implementations still target desktop-class hardware and high-end edge devices. The deployment on resource-restricted embedded devices remains a significant challenge. In this context, floating-point arithmetic avoidance, buffer management, and CPU’s SIMD leverage cannot be ignored to meet embedded system requirements, such as memory footprint and real-time execution. Therefore, we implement an ultra-lightweight ViT, i.e., a fully integer CNN-Transformer hybrid model with Simple attention by Post-Training Quantization (PTQ), targeting embedded hardware. Specifically, we introduce Normalization Equivalent Quantization (NEQ) to reduce l-1 normalization computation, and buffer optimization, e.g., Attention row buffer to mitigate