Saved in:
Bibliographic Details
Main Authors: Ma, Xing, Zhou, Yangjie, Sun, Wu, Liu, Zihan, Leng, Jingwen, Lin, Yun, Sun, Shixuan, Guo, Minyi, Dong, Jin Song
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2605.05023
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917464481202176
author Ma, Xing
Zhou, Yangjie
Sun, Wu
Liu, Zihan
Leng, Jingwen
Lin, Yun
Sun, Shixuan
Guo, Minyi
Dong, Jin Song
author_facet Ma, Xing
Zhou, Yangjie
Sun, Wu
Liu, Zihan
Leng, Jingwen
Lin, Yun
Sun, Shixuan
Guo, Minyi
Dong, Jin Song
contents Efficient CUDA implementations of attention mechanisms are critical to modern deep learning systems, yet supporting diverse and evolving attention variants remains challenging. Existing frameworks and compilers trade performance for flexibility, while expert-written kernels achieve high efficiency but are difficult to adapt. Recent work explores large language models (LLMs) for GPU kernel generation, but prior studies report unstable correctness and significant performance gaps for complex operators such as attention. We present CuBridge, an LLM-based framework that adapts expert-written attention kernels through a structured lift-transfer-lower workflow. CuBridge starts from expert-written CUDA attention kernels and lifts them into an executable intermediate representation that makes execution orchestration explicit while abstracting low-level CUDA syntax. Given a user-provided PyTorch specification, CuBridge generates and verifies a target IR program, then reconstructs optimized CUDA code via reference-guided lowering. Across diverse attention variants and GPU platforms, CuBridge consistently produces correct kernels and substantially outperforms general frameworks, compiler-based approaches, and prior LLM-based methods.
format Preprint
id arxiv_https___arxiv_org_abs_2605_05023
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle CuBridge: An LLM-Based Framework for Understanding and Reconstructing High-Performance Attention Kernels
Ma, Xing
Zhou, Yangjie
Sun, Wu
Liu, Zihan
Leng, Jingwen
Lin, Yun
Sun, Shixuan
Guo, Minyi
Dong, Jin Song
Machine Learning
Efficient CUDA implementations of attention mechanisms are critical to modern deep learning systems, yet supporting diverse and evolving attention variants remains challenging. Existing frameworks and compilers trade performance for flexibility, while expert-written kernels achieve high efficiency but are difficult to adapt. Recent work explores large language models (LLMs) for GPU kernel generation, but prior studies report unstable correctness and significant performance gaps for complex operators such as attention. We present CuBridge, an LLM-based framework that adapts expert-written attention kernels through a structured lift-transfer-lower workflow. CuBridge starts from expert-written CUDA attention kernels and lifts them into an executable intermediate representation that makes execution orchestration explicit while abstracting low-level CUDA syntax. Given a user-provided PyTorch specification, CuBridge generates and verifies a target IR program, then reconstructs optimized CUDA code via reference-guided lowering. Across diverse attention variants and GPU platforms, CuBridge consistently produces correct kernels and substantially outperforms general frameworks, compiler-based approaches, and prior LLM-based methods.
title CuBridge: An LLM-Based Framework for Understanding and Reconstructing High-Performance Attention Kernels
topic Machine Learning
url https://arxiv.org/abs/2605.05023