God Does Not Play Dice: Enforcing Batch Invariance in Agentic Kernel Generation
Abstract
Large language model (LLM) serving systems dynamically batch user requests for GPU execution, so the same request may be processed alongside different requests across runs. If the GPU kernels lack batch invariance (BI), this changing batch context can alter the numerical output for an unchanged input, undermining reproducibility. Existing kernel generation agents focus on correctness and efficiency but overlook BI. We find 19 confirmed BI violations among 83 batch-applicable released artifacts. To address this limitation, we propose , which combines contract-guided static dependency analysis with dynamic validation of bitwise consistency across batch contexts. is designed as a plug-in component for general kernel agents, allowing their original optimization capabilities to be reused while adding BI enforcement. We integrate it as successive acceptance gates in the optimization loop, rejecting structurally risky or dynamically non-invariant candidates before performance benchmarking and returning feedback to the agent. Experiments across three agent frameworks under baseline and BI-aware generation on real world LLM serving tasks show that improves the BI pass rate from 67.6\% to 91.9\% while retaining 91.8\% of the baseline geometric mean speedup. These results demonstrate that can be incorporated into kernel optimization by agents as an additional reliability objective alongside correctness and speed.
Create a lesson
Metadata
- Categories
- cs.AI, cs.LG, cs.SE
Related papers
From Manufacturing Event Logs to Simulation: Enabling SMEs with Agentic AI for SimPy Simulation Generation
Shared title terminologycs.AIRichard Reider, Lina Döring, Sebastian Lang et al.
EpiAgent: Epistemic Self-Play for LLM Agents
Shared title terminologycs.AIXuanfa Jin, Xinyu Cui, Zhijian Ma et al.
SciGame: Let Agents Play the Scientific Discovery Games in the Real and Counterfactual World
Shared title terminologycs.AIYusheng Zhao, Bowei He, Xue Liu et al.
What Does an Ontology Catch? Curated, LLM-Generated and Data-Derived Ontologies as Checkers of LLM Agents over Knowledge Graphs
Shared title terminologycs.AIMichal Orzechowski, Rund Tawfiq, Tomasz Kosciolek
LM-DSB: A Lightweight Multi-agent System for Automated Daily Safety Bulletin Generation in Construction
Shared title terminologycs.AIXianxiang Zhao, Advik Mehta, Falak Sethi et al.
Fin-RSI: A Unified Library of Financial Skills, Checks, and Self-Improvement for LLM Agents
Shared title terminologycs.AIWanghao Ye, Shwai He, Sihan Chen et al.