TRT-ViT:TensorRT-oriented视觉Transformer
TRT-ViT: TensorRT-oriented Vision Transformer
摘要:
我们从实际应用的角度重新审视现有的优秀Transformers。它们中的大多数甚至不如基本的ResNets系列高效,并且偏离了现实的部署场景。这可能是由于目前衡量计算效率的标准,如FLOP或参数是片面的,次优的,硬件不敏感的。因此,本文直接将特定硬件上的TensorRT延迟视为效率指标,从而提供更全面的反馈,包括计算能力,内存成本和带宽。基于一系列受控实验,这项工作得出了面向TensorRT和部署友好的网络设计的四个实用指南,例如,在阶段级的早期CNN和晚期Transformer,在块级的早期Transformer和晚期CNN。因此,提出了一系列面向TensortRT的Transformers,缩写为TRT-ViT。大量的实验表明,TRT-ViT在各种视觉任务的延迟/准确性权衡方面显著优于现有的ConvNets和视觉Transformer,例如,图像分类、目标检测和语义分割。例如,在82.7%的ImageNet-1 k top-1准确率下,TRT-ViT比CSWin快2.7 $\times$,比Twins快2.0 $\times$。在MS-COCO目标检测任务上,TRT-ViT实现了与Twins相当的性能,而推理速度提高了2.8 $\times$。
英文摘要:
We revisit the existing excellent Transformers from the perspective of practical application. Most of them are not even as efficient as the basic ResNets series and deviate from the realistic deployment scenario. It may be due to the current criterion to measure computation efficiency, such as FLOPs or parameters is one-sided, sub-optimal, and hardware-insensitive. Thus, this paper directly treats the TensorRT latency on the specific hardware as an efficiency metric, which provides more comprehensive feedback involving computational capacity, memory cost, and bandwidth. Based on a series of controlled experiments, this work derives four practical guidelines for TensorRT-oriented and deployment-friendly network design, e.g., early CNN and late Transformer at stage-level, early Transformer and late CNN at block-level. Accordingly, a family of TensortRT-oriented Transformers is presented, abbreviated as TRT-ViT. Extensive experiments demonstrate that TRT-ViT significantly outperforms existing ConvNets and vision Transformers with respect to the latency/accuracy trade-off across diverse visual tasks, e.g., image classification, object detection and semantic segmentation. For example, at 82.7% ImageNet-1k top-1 accuracy, TRT-ViT is 2.7$\times$ faster than CSWin and 2.0$\times$ faster than Twins. On the MS-COCO object detection task, TRT-ViT achieves comparable performance with Twins, while the inference speed is increased by 2.8$\times$.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。