一句话:提出首个利用视频 CODEC 辅助算法-加速器协同设计的视频 Transformer 加速框架,跳过时空冗余计算。
视频 Transformer(VidT)在视频理解任务中精度领先,但处理大量视频帧仍带来严重性能瓶颈,难以部署到资源受限平台。现有面向 Vision Transformer 的加速器常忽略 VidT 固有的时间冗余,且引入稀疏注意力预测模块会带来显著开销。本文提出 CMC,首个由视频 CODEC 辅助的算法-加速器协同设计框架。算法层面,提出对 CODEC 友好的矩阵间与矩阵内预测算法,在线识别信息性数据,并设计恢复算法,在时间与空间域安全跳过非信息性数据的计算,通过复制信息性数据特征来恢复结果以保持精度。硬件层面,扩展视频 CODEC 以低开销高效实现上述预测,并设计专用 CMC 架构,包含带细粒度缓冲区管理的恢复引擎,将算法节省转化为实际加速。实验表明,CMC 相比先进 ViT 加速器 HeatViT、A100 GPU 和 Xeon CPU 分别取得 2.1×、8.8× 和 42.4× 加速,且精度损失可忽略。
Video Transformers (VidTs) have reached the forefront of accuracy in various video understanding tasks. Despite their remarkable achievements, the processing requirements for a large number of video frames still present a significant performance bottleneck, impeding their deployment to resource-constrained platforms. While accelerators meticulously designed for Vision Transformers (ViTs) have emerged, they may not be the optimal solution for VidTs, primarily due to two reasons. These accelerators tend to overlook the inherent temporal redundancy that characterizes VidTs, limiting their chance for further performance enhancement. Moreover, incorporating a sparse attention prediction module within these accelerators incurs a considerable overhead. To this end, we move our attention to the video CODEC, which is essential for video preprocessing and can be utilized to detect the temporal and spatial similarity in raw video frames, showcasing the potential of exploring the temporal and spatial redundancy in VidTs while avoiding significant costs on prediction. This paper proposes CMC, the first CODEC assisted algorithm-accelerator co-design framework (CMC) for VidT acceleration. Specifically, from the algorithm aspects, we offer CODEC-friendly inter- and intra-matrix prediction algorithms to identify the informative data on-the-fly. We then design a recovery algorithm so that we can safely skip the computation on non-informative data in the temporal and spatial domains and recover their results by copying the informative data's features to reserve accuracy. From the hardware aspects, we propose to augment the video CODEC to make it efficiently implement inter- and intra-matrix prediction algorithms with negligible costs. Additionally, we propose a specialized CMC architecture that includes a recovery engine with fine-grained buffer management to translate the computational saving in the algorithm to real speedup. Experiments show that CMC can achieve 2.1×, 8.8×, and 42.4× speedup over state-of-the-art ViT accelerator HeatViT, A100 GPU, and Xeon CPU with negligible accuracy loss.