Kernel Forge: LLM 기반 CUDA 커널 생성 및 최적화를 위한 에이전트 하네스
Kernel Forge: An Agent Harness for LLM-based Generation and Optimization of CUDA Kernels
한국어 초록
머신러닝 모델은 일상적인 소프트웨어에 점점 더 깊이 내장되고 있으며, 실행 시간의 대부분은 행렬 곱(matrix multiplication), 합성곱(convolution), 정규화(normalization)와 같은 소수의 연산 커널(kernel)에서 소비됩니다. 이러한 커널을 최적화하는 것은 지연 시간과 비용을 줄이는 가장 직접적인 방법 중 하나이지만, 전통적으로 숙련된 엔지니어가 저수준 GPU 코드를 직접 작성해야 했습니다. 대규모 언어 모델(LLM)을 기반으로 구축된 에이전트(agent) 시스템은 이제 훨씬 적은 인력 투입으로 커널을 생성하고 최적화할 수 있지만, 기존 도구들은 주로 무작위로 생성된 텐서 및 고립된 커널을 대상으로 평가되고, 개발자가 수동으로 재통합해야 하는 독립형 CUDA 코드를 출력하며, 대부분 LLM PyTorch 모델만을 대상으로 하고 결과 검사 및 디버깅 지원이 제한적입니다. 본 논문에서는 수정되지 않은 임의의 PyTorch 모델을 그대로 입력받는 오픈소스 엔드투엔드 에이전트 하네스인 Kernel Forge를 소개합니다. Kernel Forge는 비전, 디퓨전(diffusion), LLM 워크로드를 지원하고, 단일 선형 개선 체인 대신 몬테카를로 트리 탐색(MCTS)을 활용하여 여러 최적화 경로를 탐색하며, 진행 상황 모니터링, 후보 커널 검사 및 실패 디버깅을 위한 그래픽 사용자 인터페이스(GUI)를 함께 제공합니다. GB10 GPU가 탑재된 NVIDIA DGX Spark 환경에서 비전, 디퓨전 및 LLM 워크로드에 걸친 4개의 PyTorch 모델을 대상으로 Kernel Forge를 평가했습니다. 커널당 단 50회의 최적화 반복(iteration)만으로 14개 커널을 최적화하여 PyTorch eager 모드를 능가했으며, ResNet-50의 adaptive_avgpool2d에서 $1.52\times$, Stable Diffusion 3.5 Medium의 group_norm에서 $1.70\times$, Gemma 4 E2B의 소프트맥스(softmax)에서 $2.83\times$, Qwen 3.5 35B-A3B의 소프트맥스에서 $1.54\times$의 속도 향상을 달성했습니다.
원문 초록
Machine learning models are increasingly embedded in everyday software, and most of their runtime is spent in a small set of compute kernels such as matrix multiplication, convolution, and normalization. Optimizing these kernels is one of the most direct ways to reduce latency and cost, but it has traditionally required expert engineers to hand-write low-level GPU code. Agentic systems built on large language models (LLMs) can now generate and optimize kernels with far less human effort, yet existing tools are largely evaluated on randomly generated tensors and isolated kernels, emit standalone CUDA code that developers must manually reintegrate, mostly target only LLM PyTorch models, and offer limited support for inspecting and debugging results. We present Kernel Forge, an open-source, end-to-end agentic harness that accepts any unmodified PyTorch model in place. Kernel Forge supports vision, diffusion, and LLM workloads, uses Monte Carlo Tree Search (MCTS) to explore multiple optimization paths rather than a single linear refinement chain, and ships with a graphical user interface for monitoring progress, inspecting candidate kernels, and debugging failures. We evaluate Kernel Forge on four PyTorch models spanning vision, diffusion, and LLM workloads on an NVIDIA DGX Spark with GB10 GPU. With only 50 optimization iterations per kernel, it optimizes 14 kernels to outperform PyTorch eager mode, reaching $1.52\times$ on adaptive\_avgpool2d in ResNet-50, $1.70\times$ on group\_norm in Stable Diffusion 3.5 Medium, $2.83\times$ on softmax in Gemma 4 E2B, and $1.54\times$ on softmax in Qwen 3.5 35B-A3B.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2607.24762v1제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.