acceptodds
Under review as a conference paper at ICLR 2027

Glueball: Agentic Generation and Verification of Hardware-Aware Gluon Kernels

Abstract

Modern GPUs provide increasingly powerful features to improve performance, yet effectively harnessing them requires reasoning about complex execution behavior. Large Language Model (LLM) agents are exceptionally well suited to exploring this optimization space through iterative code generation, with pre-defined test-suites executed on bare metal providing correctness guarantees and performance feedback. However, numerical testing alone provides limited coverage of the input and execution space, making it possible for agents to overfit to tested inputs while missing correctness violations arising from subtle hardware-execution semantics. To address these limitations, we present Glueball, the first system to equip LLM agents with theorem-proving tools to reason about correctness during GPU kernel generation and optimization. Glueball targets Gluon, a tile-level Domain Specific Language (DSL) within the Triton ecosystem that provides direct, fine-grained access to GPU hardware beyond the abstractions exposed by Triton's higher-level programming model. Our system coordinates optimization across single and multi-kernel workloads, using end-to-end model performance, as well as theorem-prover guidance, as optimization feedback to evolve the kernels. Our results show improved kernel bug detection, while evaluations on real-world workloads demonstrate end-to-end performance competitive with already performant Triton baselines.

Primary area:
infrastructure, software libraries, hardware, systems, etc.
Keywords:
GPU Kernel Optimization, LLM-assisted theorem proving, Neurosymbolic AI, Large Language Models, GPU Programming, Code Generation, Kernel Correctness, LLM Agents, Agentic Workflow, Gluon, Triton

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_tnhVOpenReview ↗
Rating
2(+1)
Confidence
4
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper introduces Glueball, which equips LLM agents with theorem-proving tools to reason about correctness during GPU kernel generation and optimization for Gluon. Glueball translates reference Triton kernels into initially unoptimized Gluon implementations and iteratively improves them using a multi-agent pipeline that combines profiling, optimization proposal generation, implementation, correctness checking, and end-to-end benchmarking. The evaluation results show that improved kernel bug detection rate after applying Glueball's pipeline into current LLMs.

Critical strengths
  • Nice idea of intergating formal methods with compiler infrastructure for gpu kernel agents. The paper presents a compelling idea of exposing compiler IR and hardware-specific semantics to theorem-proving tools, allowing agents to reason about issues such as races, synchronization, and layout constraints rather than relying only on testing.
  • Evaluation on realistic workloads. The system is tested on real model workloads and standalone kernels, with end-to-end performance measurements and a dedicated correctness suite, making the evaluation more practical.
Critical weaknesses

I appreciate the opportunity to review this paper, and I find the overall direction interesting. However, I believe the work still has substantial room for improvement as an ICLR paper.

  1. The novelty of introducing theorem proving into a tile-based GPU DSL/compiler stack is somewhat limited. To my knowledge, TileLang has already been progressively integrating Z3 since late 2025 to prove properties of symbolic expressions and check hardware-related constraints such as TMA legality. Therefore, I think the paper should more clearly articulate what is fundamentally new about Glueball beyond exposing existing compiler/hardware constraints to an LLM-accessible theorem prover. In my view, the more interesting novelty may lie in how theorem proving is integrated into the agentic optimization loop, rather than in the use of Z3 itself.

  2. The presentation, particularly in the evaluation section, needs significant improvement. One concrete issue is the use of the term baseline. Figure 3 uses the reference Triton implementation as the performance baseline, whereas Figure 4 uses “Baseline” to refer to the same LLM without the full Glueball correctness pipeline. These are very different notions of baseline, but the distinction is not made sufficiently explicit, which made the evaluation unnecessarily difficult to follow.

  3. The evaluation does not sufficiently compare against strong contemporary coding-agent workflows. Modern coding agents can already generate and iteratively debug reasonably strong GPU kernels when equipped with execution, profiling, and compiler feedback. While adding theorem-prover feedback is intuitively well motivated and the paper demonstrates that it can help, the current evaluation mainly compares Glueball against variants of the authors’ own workflow with parts of the correctness pipeline removed. I would like to see a comparison against a strong general-purpose coding-agent harness, e.g., GPT-6 Astra with Codex, in terms of both final performance/correctness and total inference or api cost. This would help establish the incremental value of theorem proving beyond what a strong execution-driven agent can already achieve.

  4. The system overhead of formal reasoning is not sufficiently characterized. Introducing symbolic execution, Z3 queries, additional verification agents, and counterexample synthesis may significantly increase the time and token cost required to obtain a valid optimized kernel. Although the appendix reports overall wall-clock time and token consumption, it does not isolate the overhead attributable to the verification machinery. A useful evaluation would report metrics such as the fraction of runtime/token cost spent on theorem proving/LLM response/compilation.

  5. The performance results are not yet compelling enough. For example, all tested agents fail to outperform the Triton baseline on Mamba-2, with the best results remaining around parity or slightly below it. The paper itself attributes this to the difficulty of improving an already strong software-pipelined Triton schedule. I would encourage the authors to further strengthen the optimization results and evaluate on a broader range of GPU architectures. Currently, all experiments are conducted on a single NVIDIA DGX Spark / GB10 platform.

Questions for authors
  • Are all formal proofs currently restricted to individual symbolic regions? How are these regions partitioned in practice, and approximately how many symbolic regions does a typical kernel contain?
  • In the evaluated cases, what evidence do you have that it is sufficient to establish whole-kernel correctness rather than only local correctness within each symbolic region?
6 comments

We sincerely thank you for your careful review.

1. Novelty and relationship to TileLang. We respectfully disagree that TileLang's integration of Z3 is directly comparable to Glueball. The use of Z3 in TileLang is primarily for compiler-side reasoning about symbolic expressions and hardware constraints, supporting specific compiler transformations and legality checks. Glueball uses theorem provers for a fundamentally different purpose: providing an LLM agent with an interactive means of finding counterexamples to the correctness of its generated optimizations. As illustrated in Figure 2 of the paper, our correctness pipeline explicitly searches for inequivalence between reference and candidate kernels, while Figure 5 demonstrates how the agent uses Z3 to identify an asynchronous race and derive a concrete execution witness. Crucially, this verification feedback is integrated into the iterative optimization loop (Figure 1), allowing counterexamples to guide subsequent kernel revisions. We believe this integration, rather than simply exposing Z3 to an LLM, is a central contribution of Glueball.

We'd also like to draw attention to the fact that verification can be approached from two complementary perspectives: attempting to prove that a program is correct for all possible executions, or attempting to demonstrate that it is incorrect by finding a counterexample. Glueball deliberately adopts the latter. Rather than requiring a complete formal model of every aspect of the compiler and hardware, we use targeted formal models to search for concrete violations of equivalence and hardware properties. If no counterexample is found by the verification pipeline, Glueball accepts the candidate as correct within the scope of its checks. We believe this approach is particularly valuable for GPU optimization, where hardware evolves rapidly and constructing complete formal models of new features is both difficult and sometimes impossible given the limited availability of hardware specifications.

2. Presentation and baseline terminology. We agree that the use of the term baseline in Figures 3 and 4 is ambiguous. In Figure 3, the reference Triton implementation is the performance baseline against which speedups are measured. In Figure 4, the baseline refers to the same LLM agent operating without Glueball's correctness pipeline. We will distinguish these explicitly throughout the paper, referring to them as the Triton reference and LLM-only (without correctness pipeline), respectively. We will also revise the figure captions and evaluation text to make the experimental comparisons clearer.

3. Comparison against contemporary coding agents. We agree that comparison against strong general-purpose coding agents is important to establish the incremental value of Glueball. We have therefore conducted an additional comparison against GPT-6 Astra with Codex, allowing it to use the available command-line tools for compilation, execution, profiling, and debugging, without Glueball's formal verification tools. We evaluated both approaches on the same six optimization workloads. The following table reports speedups relative to the reference Triton implementations:

ExperimentGPT-6 Astra + CodexDeepSeek V4 ProDeepSeek V4 FlashMeta Muse SparkGPT-6 Sol
GPT-OSS1.13x1.07x0.97x0.91x0.92x
Qwen-3.5 MoE0.99x1.07x1.08x1.00x0.85x
Mamba-21.00x0.99x0.96x0.96x0.96x
Cross-Entropy1.02x1.55x0.98x0.82x1.67x
Llama-4 RoPE1.10x1.07x1.07x1.01x1.05x
Neighborhood Attention4.69x23.08x24.85x24.53x24.52x

Notably, even a substantially cheaper model such as DeepSeek V4 Pro, when equipped with Glueball, achieves greater or comparable overall performance to GPT-6 Astra with Codex. These results demonstrate the value of the specialized optimization workflow, rather than relying solely on the capabilities of the underlying foundation model. We will include these comparison results in the final version of our paper.

4. System overhead. We agree that the overhead of formal reasoning should be characterized separately from the overall optimization cost. We have therefore broken down both token consumption by agent stage and tool usage by category across the four evaluated models.

The correctness pipeline, which includes the symbolic execution and Z3 tools, accounts for between 31.8% and 68.2% of total token consumption, depending on the model.

ModelCorrectness pipelineOptimizerDocumentation agentSetup, profiling, translation
DeepSeek V4 Pro33.1%33.9%13.8%19.2%
DeepSeek V4 Flash56.5%27.6%5.4%10.5%
Meta Muse Spark31.8%31.1%9.1%28.0%
GPT-6 Sol68.2%22.0%0.0%9.8%

Theorem-prover tools account for a relatively small proportion of total tool calls. The following table breaks down tool usage between symbolic execution/Z3, shell and CLI operations, and other general tools:

ModelTotal callsSymbolization / Z3Shell / CLIOther general tools
DeepSeek V4 Pro17,311136 (0.8%)9,624 (55.6%)7,551 (43.6%)
DeepSeek V4 Flash34,338411 (1.2%)23,682 (69.0%)10,245 (29.8%)
Meta Muse Spark6,599215 (3.3%)3,315 (50.2%)3,069 (46.5%)
GPT-6 Sol3,191653 (20.5%)899 (28.2%)1,639 (51.4%)

These results show that, although the correctness pipeline accounts for a substantial proportion of LLM inference, the actual theorem-prover interactions require relatively few tool calls for most models. We will include these breakdowns in the revised appendix to provide a clearer characterization of the system's inference and tool-use overhead. Percentages may differ slightly from 100% due to rounding.

5. Performance results and hardware coverage. We believe there are two important aspects of our evaluation that should be considered when interpreting the performance results. Firstly, while much of the existing kernel-generation literature evaluates against PyTorch eager or Inductor implementations, Glueball is evaluated against human-written and expert-tuned Triton kernels, a substantially stronger baseline. Secondly, our objective is to optimize entire model architectures rather than isolated kernels. Consequently, some seemingly modest end-to-end improvements are actually driven by much larger speedups in individual kernels, whose contributions are diluted at the model level because they account for only a fraction of total execution time. Regarding the Mamba-2 experiment, we acknowledge that none of the evaluated agents, including GPT-6 Astra with Codex, substantially outperforms the Triton reference.

We acknowledge that our current evaluation is limited to a single NVIDIA DGX Spark / GB10 platform, and will make this limitation explicit, identifying evaluation across additional GPU architectures as a direction for future work.

6. Symbolic-region partitioning. The equivalence checks operate over individual symbolic regions rather than a single monolithic representation of the entire kernel. The number of regions depends on kernel complexity: across our evaluations, this ranges from just 1 symbolic region for very simple kernels within models to over 15 regions for complex kernels like those involved in Mamba-2. The median number of regions across all experiments and models was 8.

7. Whole-kernel correctness. We would like to clarify that Glueball does not attempt to construct a single formal proof of whole-kernel equivalence by composing the individual symbolic-region proofs. Rather, our objective is to find a concrete execution or input that demonstrates inequivalence, with region-level checks forming part of a broader counterexample-search process.

Thank you for clarifying the positioning and contributions of Glueball. I now have a better understanding of the intended scope of the work, and I will raise my rating to Weak Reject.

My remaining suggestions are mainly about strengthening the evaluation:

  1. Support for more advanced asynchronous architectures. GB10 is a relatively simple, edge-oriented SM120 architecture. Compared with SM80, its main additional asynchronous capability relevant to this work is TMA. I encourage the authors to further strengthen the paper by evaluating Glueball on at least one architecture that supports asynchronous MMA instructions, such as Hopper. This would help demonstrate the generality of the proposed approach across more sophisticated asynchronous execution mechanisms.

  2. Per-case API cost for coding-agent baselines. For the comparison with baseline coding agents, I suggest reporting the API cost for each test case. This information would make the comparisons more informative.

  3. Model workloads performance. I do not consider the current model workloads experiment to be well suited to substantiating the paper's claims. I nevertheless appreciate the authors' transparency in reporting and explaining the lack of performance improvements. I suspect that the main reason may be the choice of GB10 as the evaluation platform, where the optimization opportunities are relatively limited. Therefore, I would again encourage the authors to strengthen the evaluation by considering architectures with more exloring space for agents, as suggested in Point 1.

I hope these suggestions will be helpful in further strengthening the paper.

Reviewer_ShwjOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

The paper presents Glueball, framework for generating and optimizing GPU kernels in Gluon, with a particular emphasis on integrating formal verification into the optimization process. Its main technical contribution is a Gluon-to-Z3 library that enables LLM agents to reason about the correctness and hardware-specific properties. The authors evaluate Glueball on several models and kernels, showing improved bug detection and good performance results.

Critical strengths
  1. Good idea in terms of integration of formal verification into the agentic kernel optimization pipeline.

  2. A detailed and thorough implementation plan and results are shown.

Critical weaknesses
  1. If I understand correctly, the verification process does not establish any theoretical guarantee. It's just a tool that the agent can use, but it does not guarantee that the optimized GPU kernel is equivalent to the original one before optimization. Then the contribution is only on the "mitigating potential bugs" side, which makes the claim much less interesting.

  2. What if the agent makes a wrong correctness judgment on constructing the symbolic models / wrong Z3 queries? There is no guarantee that the agent uses the formal verification tool in a correct manner.

  3. Could you please check this paper, "Equivalence Checking of ML GPU Kernels" https://arxiv.org/pdf/2511.12638 recently appeared on OOPSLA. I found this paper highly relevant, and should be discussed. In my opinion, a more end-to-end GPU kernel verification tool should be adopted here rather than trusting the agent to construct the proof of equivalence.

  4. Is there an ablation study on whether incorporating each of the components of the introduced system helps?

Questions for authors

Please see the weakness sections.

1 comment

We sincerely thank you for your careful review.

1. Scope of guarantees. We acknowledge that Glueball does not establish formal, end-to-end equivalence guarantees between arbitrary reference and optimized kernels. This is a deliberate trade-off to support a broader class of practical GPU workloads. Glueball can alternatively operate in a more conservative mode, rejecting kernels only when a concrete counterexample has been successfully reproduced on hardware. This prevents a potentially incorrect Z3 model alone from causing a kernel to be rejected, although the absence of a counterexample does not establish correctness. For our correctness-suite evaluation, however, we deliberately use a less conservative criterion: to evaluate the other components of the harness, we count an agent-reported Z3 data race as an incorrect verdict even when no executable counterexample has been reproduced. Consequently, some false positives can arise from incorrect translations into Z3.

2. Counterexample-driven verification versus proving correctness. More broadly, we believe this reflects a fundamental trade-off in practical program verification. A verification system must either reject programs whose correctness it cannot establish, potentially excluding valid optimizations, or accept programs whose correctness has not been conclusively established, potentially admitting bugs. Glueball deliberately adopts the latter approach to preserve a broader optimization space. This also highlights a fundamental difference in philosophy between Glueball and VOLTA: whereas VOLTA aims to prove that two kernels are equivalent, Glueball primarily aims to identify incorrectness by finding concrete counterexamples. We believe this approach is particularly important for rapidly evolving GPU architectures, where new hardware features introduce increasingly complex execution semantics, and the information necessary to construct complete formal models may not even be publicly available from hardware vendors. Requiring complete formal models before exploring such features would severely restrict the practical utility of an optimization system.

3. Comparison with VOLTA (Equivalence Checking of ML GPU Kernels). We appreciate the reviewer bringing this closely related work to our attention and will include a discussion in the revised paper. VOLTA makes an important contribution by establishing soundness and completeness results for equivalence checking within its supported class of kernels. However, these guarantees rely on several restrictions that limit its applicability to the workloads Glueball targets:

VOLTA limitationRelevance to Glueball's target workloads
Requires statically known tensor dimensions, memory addresses, and branch conditions.Excludes important data-dependent execution patterns, such as dynamic expert routing in Mixture-of-Experts (MoE) kernels, which Glueball targets (e.g., Qwen-3.5 MoE).
Compares corresponding CTAs independently, excluding optimizations that redistribute work across CTAs.Particularly relevant on Hopper and Blackwell, where CTA clusters can cooperate in GEMM computations. Such cross-CTA optimizations fall outside VOLTA's equivalence-checking assumptions.
Does not support asynchronous primitives such as wgmma.Excludes important asynchronous execution patterns used by modern GPU kernels, which Glueball explicitly targets through its hardware-specific Z3 models.

We emphasize that VOLTA and Glueball make different design choices rather than claiming that one universally subsumes the other. VOLTA provides stronger formal guarantees over a restricted class of kernels, whereas Glueball sacrifices these guarantees to support a broader range of practical workloads, including data-dependent operations, asynchronous execution, and optimization across entire model architectures. Glueball therefore addresses a complementary problem: integrating verification feedback into an agentic optimization workflow that can explore hardware-specific transformations beyond the scope of existing end-to-end equivalence checkers.

4. Ablation study. We have conducted an additional ablation study using DeepSeek V4 Pro (High), isolating the contributions of symbolic execution and our Gluon-to-Z3 library and refer to point 2 in our response to reviewer STV5.

Reviewer_STV5OpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper has clear presentation on the idea, using Gluon, integrating formal verification, improving the kernel correctness and performance.

Critical strengths

good presentation, clear motivation, clear expected benefit,

Critical weaknesses

there is a reason that formal verification has limitation, has been little used for kernel debuging. Author could have clarified why/how this approach, especially hybrid approach, resolved such a gap reasonably. good to give more solid abalation and more stories, how much portion it happened and the approach resolved them.

Although the idea and method is solid, empirical improvement seems to be weak. The author demonstrated couple of good show cases with deep dive behavior, but difficult to find standard benchmakring suite results with different task levels.

More comparision needed to other class of approach, to clarify the strength.

Questions for authors

how much can this approach be extended to other hardware (e.g., AMD GPU, Google TPU, AWS Trainium) or other DSL?

2 comments

We sincerely thank you for your careful review.

1. Justifying our approach and comparison with other approaches. Existing GPU verification approaches make different trade-offs between verification scope and tractability. For example, GPUVerify and Faial primarily focus on specific concurrency properties, rather than functional equivalence of optimized kernels. More recently, VOLTA introduces functional equivalence checking, but relies on restrictive assumptions, including statically known tensor dimensions, pointer targets, and branch conditions. In particular, its requirement that conditional branches be statically resolvable precludes important data-dependent execution patterns, such as dynamic expert routing in Mixture-of-Experts (MoE) kernels, which Glueball targets.

Furthermore, few existing approaches support the increasingly asynchronous execution models of modern GPUs. Formally modelling asynchronous copies, memory barriers, and tensor core execution introduces substantial complexity, making it difficult to extend traditional verification techniques to modern hardware. Instead of trying to mathematically show the correctness of a GPU kernel, Glueball instead focusses on counter-example generation to support broader practical verification coverage.

2. Ablation of the correctness system. To quantify the contribution of the two most important components of Glueball's correctness pipeline, we conducted an additional ablation study using DeepSeek V4 Pro (High), separating symbolic execution and our Gluon-to-Z3 library. We find that frontier models already possess relatively strong bug-detection capabilities, even for asynchronous code. However, the formal tools substantially reduce the reasoning (and thus tokens) required to identify these defects:

ConfigurationBugs detected (/30)Mean tokens (M)
Both components280.93
Z3 library only281.21
Symbolic execution only271.40
Neither (base model)271.52

The reduction is particularly pronounced for asynchronous bugs. For example, identifying incorrect asynchronous barrier/fence ordering takes 1.24M tokens on average with both components, compared with 3.69M without either. Detecting a missing synchronization fence similarly falls from 3.33M to 1.77M tokens on average across tests in this bug class. By providing explicit models of asynchronous hardware behaviour, theorem-prover execution avoids requiring the LLM to reconstruct these semantics through lengthy reasoning traces. Symbolic execution alone also helps resolve ambiguities in asynchronous code, while the dedicated Z3 library provides a more direct and token-efficient means of checking these properties. Perhaps more importantly, the tools substantially reduce false positives, which is critical for allowing the optimizer to explore more aggressive transformations:

ConfigurationFalse positives (/21)Mean tokens (M)Mean tool calls
Both components03.6347.6
Z3 library only03.5243.6
Symbolic execution only04.2950.9
Neither (base model)74.4471.2

These results demonstrate that the primary contribution of the formal tools is not simply increasing raw bug-detection accuracy, but making correctness judgements substantially more reliable and efficient. In particular, reducing false positives from 7 to 0 prevents the optimizer from unnecessarily rejecting valid asynchronous implementations, allowing it to explore more aggressive hardware-specific optimizations. We will add the full ablation results in the final version of the paper.

3. Discussing our empirical improvements. Regarding the performance improvements, we emphasize that, unlike much of the existing kernel-generation literature, which evaluates against PyTorch eager or Inductor implementations, Glueball is evaluated against human-written and expert-tuned Triton kernels, a substantially stronger baseline. Furthermore, our objective is to optimize entire model architectures across representative input shapes, rather than maximize the performance of isolated kernels. We achieve end-to-end improvements on GPT-OSS and Qwen-3.5 MoE, while recovering near-parity performance on the particularly challenging Mamba-2 workload, whose reference implementation already employs an effective software-pipelined schedule. We believe that achieving these results while simultaneously providing correctness checking for the resulting optimized models is an important step beyond existing approaches focused primarily on isolated kernel optimization.

4. Extending the approach to new hardware and DSLs. The approach is not fundamentally tied to NVIDIA hardware, and we believe it can be extended to other accelerator architectures with relatively little modification to its overall methodology. The primary engineering effort lies in developing the formal Z3 models of the target hardware's execution semantics. Much of our TTIR symbolic execution infrastructure is already applicable to other hardware targets supported by Triton, since TTIR captures higher-level tensor computations independently of many hardware-specific details. However, hardware-specific information exposed in TTGIR, such as synchronization primitives and asynchronous operations, must be reflected in the corresponding symbolic models. For example, extending Glueball to AMD GPUs would require modelling the relevant AMD-specific hardware semantics, but would allow much of the existing symbolic execution infrastructure to be reused.

The methodology is also extensible to other accelerator ecosystems, such as TPUs and Trainium, by developing corresponding Triton backends and formal hardware models. It is not restricted to Gluon either: other tile-based DSLs, such as NVIDIA's cuTile, are natural targets because they abstract away thread-level execution details. Lower-level representations such as PTX could also be supported, although this would require explicitly modelling thread-level execution semantics.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.