Optimizing GPU kernels presents a significantly greater challenge for large language models (LLMs) than standard code generation tasks, as it requires understanding hardware architecture, parallel optimization strategies, and performance profiling outputs. Most existing LLM-based approaches to kernel generation rely on simple prompting and feedback loops, incorporating hardware awareness only indirectly through profiling feedback. We introduce KernelFoundry, an evolutionary framework that efficiently explores the GPU kernel design space through three key mechanisms: (1) MAP-Elites quality-diversity search with kernel-specific behavioral dimensions to sustain exploration across diverse optimization strategies; (2) meta-prompt evolution, which co-evolves prompts with kernels to uncover task-specific optimization strategies, and (3) template-based parameter optimization to tune kernels to inputs and hardware. We evaluate this framework on KernelBench, robust-kbench, and custom tasks, generating SYCL kernels as a cross-platform GPU programming model and CUDA kernels for comparison to prior work. Our approach consistently outperforms the baseline methods, achieving an average speedup of 2.3x on KernelBench for SYCL. Moreover, KernelFoundry is implemented as a distributed framework with remote access to diverse hardware, enabling rapid benchmarking and featuring a flexible user input layer that supports kernel generation for a wide range of real-world use cases beyond benchmarking.


翻译:优化GPU内核对于大型语言模型(LLM)而言,其挑战性远超标准代码生成任务,因为这需要理解硬件架构、并行优化策略以及性能分析输出。现有基于LLM的内核生成方法大多依赖简单的提示和反馈循环,仅通过性能分析反馈间接地融入硬件感知。本文提出KernelFoundry,一种进化式框架,通过三项关键机制高效探索GPU内核设计空间:(1)采用MAP-Elites质量多样性搜索,结合内核特定的行为维度,以维持跨多样化优化策略的探索;(2)元提示进化,使提示与内核协同进化,从而发掘面向特定任务的优化策略;(3)基于模板的参数优化,根据输入和硬件调整内核配置。我们在KernelBench、robust-kbench及自定义任务上评估该框架,生成作为跨平台GPU编程模型的SYCL内核,并生成CUDA内核以与先前工作进行对比。本方法在各项基准测试中均稳定优于基线方法,在KernelBench的SYCL内核上平均实现2.3倍的加速比。此外,KernelFoundry被实现为具备远程多样化硬件访问能力的分布式框架,支持快速基准测试,并配备灵活的用户输入层,可支持基准测试之外广泛实际应用场景的内核生成。

0
下载
关闭预览

相关内容

【ICML 2024】零阶优化器微调大模型,大幅降低内存
专知会员服务
32+阅读 · 2024年7月8日
大模型如何迭代?北大等《大型语言模型自我进化》综述
【硬核书】Linux核心编程|Linux Kernel Programming,741页pdf
专知会员服务
80+阅读 · 2021年3月26日
盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
以BERT为例,如何优化机器学习模型性能?
专知
10+阅读 · 2019年10月3日
Deformable Kernels,用于图像/视频去噪,即将开源
极市平台
13+阅读 · 2019年8月29日
GPU 显存不足怎么办?
AINLP
13+阅读 · 2019年8月16日
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
深度学习的GPU:深度学习中使用GPU的经验和建议
数据挖掘入门与实战
11+阅读 · 2018年1月3日
国家自然科学基金
8+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
7+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
13+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
7+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
11+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关VIP内容
【ICML 2024】零阶优化器微调大模型,大幅降低内存
专知会员服务
32+阅读 · 2024年7月8日
大模型如何迭代?北大等《大型语言模型自我进化》综述
【硬核书】Linux核心编程|Linux Kernel Programming,741页pdf
专知会员服务
80+阅读 · 2021年3月26日
相关基金
国家自然科学基金
8+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员