Token pruning methods for Vision Transformers (ViTs) promise quadratic reductions in attention FLOPs by dropping uninformative patches. Yet standard variable-length attention APIs -- including FlashAttention-2's varlen and PyTorch's NestedTensor SDPA -- fail to translate these savings into proportional wall-clock gains at the short post-pruning sequence lengths typical of ViTs ($\leq$197 tokens). We identify a dispatch-overhead bottleneck: at these lengths, host-side kernel dispatch consumes ${\sim}$50\,$μ$s regardless of workload, exceeding the actual GPU compute time at moderate-to-high pruning rates. We present a lightweight bidirectional Triton attention kernel whose dispatch floor is ${\sim}$24\,$μ$s -- roughly 2.17$\times$ lower than FlashAttention-2 varlen -- allowing pruning savings to become visible in wall-clock time. Integrated into a complete pack-attend-unpack pipeline and evaluated on an NVIDIA RTX 4000 Ada Generation GPU, our system achieves 1.88$\times$ end-to-end throughput over padded PyTorch SDPA at standard 224$\times$224 inputs, scaling to 2.51$\times$ at 384$\times$384. Against FlashAttention-2 varlen -- the strongest baseline -- our kernel delivers 9-12\% higher throughput at serving batch sizes (BS=1-4), and 2.17$\times$ lower kernel latency at 80\% token pruning. Numerical correctness is verified with max absolute logit difference $<$0.004 and bit-exact top-1 predictions.


翻译:暂无翻译

0
下载
关闭预览

相关内容

【NeurIPS2024】注意力迁移对视觉Transformer的惊人有效性研究
【CVPR2023】BiFormer:基于双层路由注意力的视觉Transformer
专知会员服务
35+阅读 · 2023年3月20日
用于识别任务的视觉 Transformer 综述
专知会员服务
76+阅读 · 2023年2月25日
【CVPR2022】基于粗-精视觉Transformer的仿射医学图像配准
专知会员服务
36+阅读 · 2022年4月2日
【AAAI2022】基于双流更新的视觉Transformer动态加速方法
专知会员服务
24+阅读 · 2021年12月11日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
WWW 2020 开源论文 | 异构图Transformer
PaperWeekly
13+阅读 · 2020年4月3日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
20+阅读 · 2021年9月21日
Arxiv
19+阅读 · 2021年4月8日
Arxiv
19+阅读 · 2020年12月23日
VIP会员
最新内容
边缘计算的军事应用
专知会员服务
6+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
8+阅读 · 8月8日
《多域冲突比较支持模型》60页
专知会员服务
13+阅读 · 8月7日
相关VIP内容
【NeurIPS2024】注意力迁移对视觉Transformer的惊人有效性研究
【CVPR2023】BiFormer:基于双层路由注意力的视觉Transformer
专知会员服务
35+阅读 · 2023年3月20日
用于识别任务的视觉 Transformer 综述
专知会员服务
76+阅读 · 2023年2月25日
【CVPR2022】基于粗-精视觉Transformer的仿射医学图像配准
专知会员服务
36+阅读 · 2022年4月2日
【AAAI2022】基于双流更新的视觉Transformer动态加速方法
专知会员服务
24+阅读 · 2021年12月11日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
相关资讯
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
WWW 2020 开源论文 | 异构图Transformer
PaperWeekly
13+阅读 · 2020年4月3日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员