Research Papers 论文研究 5h ago Updated 1h ago 更新于 1小时前 45

DataKernelBench: Can LLMs Optimize Database Queries on GPUs? DataKernelBench:LLM能优化GPU上的数据库查询吗?

DataKernelBench is introduced as a new benchmark that translates SQL queries into PyTorch TorchPlan programs to evaluate LLMs optimizing database-style GPU kernels, filling a gap left by existing benchmarks focused on ML operators. The strongest full-query CUDA configuration achieves a 2.11× speedup over baseline at full pass rate across ten models on TPC-H SF10 with an H100 GPU. Higher-performing LLM implementations commonly leverage kernel fusion and execution-strategy changes, with stronger m 提出DataKernelBench基准测试,填补LLM优化GPU数据库查询的评估空白 将SQL转换为验证过的PyTorch TorchPlan程序,通过执行引导修复优化CUDA/Triton代码 最强模型在TPC-H SF10上实现2.11倍加速,扩展至SF100实现2.54倍加速 高性能实现依赖内核融合和执行策略变更,工作负载上下文比硬件上下文更重要 更强模型从完整查询专业化中获益最多

58
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • DataKernelBench is introduced as a new benchmark that translates SQL queries into PyTorch TorchPlan programs to evaluate LLMs optimizing database-style GPU kernels, filling a gap left by existing benchmarks focused on ML operators.
  • The strongest full-query CUDA configuration achieves a 2.11× speedup over baseline at full pass rate across ten models on TPC-H SF10 with an H100 GPU.
  • Higher-performing LLM implementations commonly leverage kernel fusion and execution-strategy changes, with stronger models benefiting most from full-query specialization.
  • Workload context proves more impactful than hardware context in determining optimization quality.
  • Scaling to larger datasets via Dask-cuDF integration on four H100 GPUs (TPC-H SF100) achieves a 2.54× speedup through on-demand partition loading.

Why It Matters

This work addresses a critical gap in LLM evaluation by shifting focus from ML-centric kernel benchmarks to irregular, data-movement-heavy database operators that dominate real-world GPU-accelerated query workloads. For AI practitioners and database researchers, it demonstrates that LLMs can meaningfully optimize production-grade query kernels, opening the door to automated performance tuning that previously required deep domain expertise.

Technical Details

  • Benchmark pipeline: SQL queries are translated into validated PyTorch TorchPlan programs, which LLMs then optimize as either core tensor-bounded snippets or full queries, targeting CUDA or Triton implementations via execution-guided repair.
  • Evaluation setup: Tested across ten proprietary and open-weight LLMs on TPC-H SF10 using a single H100 GPU, with baseline comparisons at full pass rate.
  • Key optimization patterns: Successful implementations frequently employ kernel fusion and execution-strategy modifications rather than naive code generation.
  • Large-scale extension: TorchPlan is extended with Dask-cuDF to handle datasets exceeding GPU memory, enabling on-demand partition loading across four H100 GPUs for TPC-H SF100.
  • Cross-domain scope: The paper spans cs.CL, cs.AI, cs.DB, cs.LG, and cs.PL, reflecting its interdisciplinary nature at the intersection of language models, databases, and systems programming.

Industry Insight

  • Automated LLM-driven kernel optimization could significantly reduce the engineering bottleneck in GPU-accelerated database systems, where hand-written kernels currently dominate performance-critical paths.
  • The finding that workload context matters more than hardware context suggests that benchmarking and training LLMs for code generation should prioritize diverse, realistic query patterns over hardware-specific tuning.
  • The successful integration of Dask-cuDF for out-of-GPU-memory workloads signals a practical path toward deploying LLM-optimized kernels in production environments with large-scale data, making this approach viable beyond controlled benchmark settings.

TL;DR

  • 提出DataKernelBench基准测试,填补LLM优化GPU数据库查询的评估空白
  • 将SQL转换为验证过的PyTorch TorchPlan程序,通过执行引导修复优化CUDA/Triton代码
  • 最强模型在TPC-H SF10上实现2.11倍加速,扩展至SF100实现2.54倍加速
  • 高性能实现依赖内核融合和执行策略变更,工作负载上下文比硬件上下文更重要
  • 更强模型从完整查询专业化中获益最多

为什么值得看

填补了LLM在数据库查询优化领域的基准测试空白,为AI辅助数据库性能优化提供了新的评估框架。

技术解析

  • DataKernelBench将SQL查询转换为验证过的PyTorch TorchPlan程序,支持LLM优化核心张量受限片段或完整查询
  • 使用执行引导修复(execution-guided repair)机制,在CUDA和Triton两种语言环境下评估模型性能
  • 在TPC-H SF10基准测试上,使用H100 GPU测试了10个专有和开源LLM模型
  • 扩展TorchPlan集成Dask-cuDF实现按需分区加载,支持超出GPU内存的大规模数据集(TPC-H SF100,四卡H100)

行业启示

  • LLM在数据库查询优化领域展现出显著性能提升潜力,2-2.5倍加速具有实际应用价值
  • 工作负载上下文比硬件配置更重要,提示优化策略应更关注查询模式而非单纯依赖硬件升级
  • 内核融合和执行策略优化是提升性能的关键技术路径,为后续研究提供明确方向

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Benchmark 基准测试 GPU GPU Research 科学研究 Evaluation 评测