Deep learning compilers and vendor libraries deliver strong baseline performance but are bounded by finite, engineer-curated catalogs. When these omit needed optimizations, practitioners substitute hand-written CUDA or CUTLASS, demanding expertise in GPU microarchitecture and C++ template metaprogramming. Recent LLM-based agents target kernel generation in raw CUDA, forcing rediscovery of optimizations already encoded in mature libraries. We present FACT (Framework for Agentic CUTLASS Transpilation), a framework that employs a three-stage, agent-driven workflow optimizing PyTorch modules through multi-pattern composition while grounding synthesis in CUTLASS C++. (1) Pattern discovery: an LLM agent inspects the traced graph, matches subgraphs to optimization rules, retrieves vetted examples from an architecture-specific index, and outputs prioritized patterns. (2) Pattern realization: each pattern is implemented as a CUTLASS kernel wrapped in a PyTorch extension, verified, and auto-tuned by sweeping parameters inferred from the CUTLASS hierarchy. (3) Pattern composition: extensions are loaded together into a single composed module for end-to-end benchmarking. We evaluate the workflow using KernelBench's evaluation framework and provided modules on an NVIDIA A100. On Level 1, we apply the workflow to three GEMM workloads (square matrix multiply, batched matrix multiply, and large-$K$ matrix multiply). Auto-tuned CUTLASS kernels improve over PyTorch cuBLAS baseline by $1.06\times$--$1.18\times$. On Level 3 MiniGPT block, composing fused multi-head attention with fused MLP GEMM+GELU yields $2.79\times$ end-to-end speedup. Our work couples agentic graph-level pattern discovery with auto-tuning and a dynamic pattern table, offering a practical path from traced PyTorch to deployable kernels by automating CUTLASS kernel synthesis and auto-tuning.


翻译:深度学习编译器与厂商库虽能提供强劲的基线性能,但其优化目录受限于工程预定义的有限集合。当这些库缺失所需优化时,从业者不得不手工编写CUDA或CUTLASS代码,这要求掌握GPU微架构与C++模板元编程的专业知识。近期基于大语言模型的智能体虽致力于原始CUDA内核生成,却迫使其重复发掘成熟库中已编码的优化策略。本文提出FACT(面向智能体CUTLASS转译的框架),通过三阶段智能体驱动工作流,将CUTLASS C++作为基础语言,以多模式组合优化PyTorch模块:(1)模式发现:LLM智能体检查迹图,将子图匹配至优化规则,从架构特定的索引中检索验证样例,输出优先级排序的模式;(2)模式实现:每个模式实现为封装于PyTorch扩展中的CUTLASS内核,通过扫描CUTLASS层级结构推断参数进行自动调优与验证;(3)模式组合:将所有扩展加载至单一组合模块中,进行端到端基准测试。我们利用KernelBench评估框架及提供的模块,在NVIDIA A100上评估该工作流。在Level 1任务中,对三种GEMM负载(平方矩阵乘法、批量矩阵乘法、大K矩阵乘法)应用工作流,自动调优的CUTLASS内核相比PyTorch cuBLAS基线提升为1.06倍至1.18倍。在Level 3的MiniGPT模块中,将融合多头注意力与融合MLP GEMM+GELU进行组合,实现2.79倍端到端加速。本工作将智能体级图模式发现与自动调优及动态模式表相结合,通过自动化CUTLASS内核合成与自动调优,为从迹化PyTorch到可部署内核提供了一条实用路径。

0
下载
关闭预览

相关内容

智能体工程(Agent Engineering)
专知会员服务
37+阅读 · 2025年12月31日
基于深度学习的程序合成研究进展
专知会员服务
17+阅读 · 2024年11月14日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
【AAAI2021】对比聚类,Contrastive Clustering
专知
26+阅读 · 2021年1月30日
深度学习TensorFlow实现集合
专知
10+阅读 · 2018年9月8日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
VIP会员
相关主题
最新内容
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
2+阅读 · 今天11:43
网状网络及其在军事领域的运用
专知会员服务
5+阅读 · 今天6:18
无美国参与的欧洲战争方式(万字长文)
专知会员服务
6+阅读 · 今天5:54
《国防领域敏感性分析白皮书》
专知会员服务
7+阅读 · 今天3:42
综述 | 从问答到任务完成:Agent系统与Harness设计
Agentic RL:框架、实践与长程智能体训练
专知会员服务
7+阅读 · 6月24日
重新思考无人机时代的生存能力
专知会员服务
9+阅读 · 6月24日
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
7+阅读 · 6月24日
在人工智能加速决策环境中拓展OODA循环
专知会员服务
9+阅读 · 6月24日
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员