一款新的AI驱动CUDA核函数优化工具近日在Hacker News发布。1该工具基于LangGraph框架构建,集成大模型API,能够自动化地执行GPU核函数代码生成、正确性验证、性能基准测试和迭代优化全流程。1优化器通过自主探索不同的核函数实现方式和启动配置参数,在验证正确性的前提下保留性能最优的版本。1
该工具默认采用OpenAI的gpt-4-mini模型,支持通过GPU性能计数器查询和NVIDIA文档研究来辅助优化决策。1用户可启用--use-nsight标志来激活Nsight Compute性能分析功能,或使用--nvidia-research标志获取NVIDIA的官方优化指导。1性能排名基于跨多个性能测试用例的几何平均延迟计算,默认配置为10次预热启动和100次测量启动。1
该项目要求运行环境包括Python 3.12+、NVIDIA GPU、CUDA Toolkit、CMake 3.24+、C++17编译器和OpenAI API密钥。1工具已在Windows RTX 3060笔记本GPU上开发完成,源代码已开源并可从GitHub获取。1
A developer has unveiled an agentic CUDA kernel optimizer on Hacker News, an automated tool designed to improve GPU code performance through iterative refinement 1. The system leverages the LangGraph framework and large language model APIs to streamline the entire optimization workflow, executing cycles of code generation, correctness validation, performance benchmarking, and incremental improvements without manual intervention 1.
The optimizer functions as an autonomous agent that explores multiple kernel implementations and launch configurations, systematically evaluating each variant and retaining the fastest verified solution 1. It integrates OpenAI's API—using gpt-4-mini by default—alongside GPU performance counter queries and NVIDIA documentation research capabilities 1. Users can enable extended profiling through the --use-nsight flag for Nsight Compute analysis and invoke the --nvidia-research flag to access NVIDIA optimization recommendations 1. Performance rankings are computed using geometric mean latency across test cases, with a default configuration of 10 warmup executions and 100 measurement runs 1.
The tool requires Python 3.12 or later, an NVIDIA GPU, CUDA Toolkit, CMake 3.24 or higher, a C++17 compatible compiler, and an OpenAI API key 1. The project was developed on a Windows RTX 3060 laptop GPU and is available as open source on GitHub 1.
评论
还没有评论,欢迎留下第一条。