arXiv:2610.36576cs.LGOct 2026

Manuscript Offprint

arXiv:2610.36576

Less is more: learning what to profile for GPU kernel optimization

Yihan Wang, Peiyu Liu, Runyu Chen, Wei Xu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language models have recently shown strong potential for automatically optimizing GPU kernels, yet their effectiveness depends critically on the hardware information available to the kernel optimization model. Existing systems typically rely on predefined profiling strategies, leaving what to profile largely outside the optimization process. We show that effective profiling is not simply about collecting more information: increasing the number of profiling metrics does not monotonically improve kernel optimization, while the most useful profiling information varies across kernels. Our theoretical analysis further shows that, under such heterogeneous profiling utility, kernel-conditioned selection can outperform any single fixed profiling configuration. Motivated by this observation, we propose AutoProfiler, a feedback-driven framework for learning a deterministic profiling tree from optimization feedback. The tree is iteratively refined through REWRITE and SPLIT operations, with an LLM generating candidate modifications and empirical evaluation determining their acceptance. Once constructed, the tree quickly gathers the required profiling information for any kernel, allowing the LLM rewriter to be invoked only once. Experiments on KernelBench show that our approach improves kernel optimization over fixed profiling configurations under constrained profiling budgets. These results suggest that hardware profiling should evolve from static metric collection toward profiling reasoning, making profiling itself a new dimension for improving kernel optimization. The codes are available at https://github.com/Satissss/AutoProfiler.

1 INTRODUCTION

LLM-based systems have recently shown strong potential for automatically rewriting GPU kernels to improve execution efficiency Ouyang et al. (2025); Zhang et al. (2025); Gai et al. (2026a). To better guide the rewriting process, recent systems increasingly incorporate hardware profiling to expose runtime bottlenecks and provide actionable optimization feedback Zhang et al. (2025); Gai et al. (2026a). However, existing approaches typically collect a predefined set of profiling signals before optimization. While simple and reusable, this design overlooks two fundamental properties of hardware profiling: profiling information is costly to acquire, and its utility is inherently kernel-dependent.

This raises a fundamental question: What profiling information is actually needed for effective kernel optimization? We investigate this question from two complementary perspectives. First, more profiling is not necessarily better. Empirically, increasing the number of profiling metrics does not monotonically improve kernel optimization, suggesting that more profiling information does not necessarily translate into better optimization. Second, the useful information is kernel-dependent. Our theoretical analysis shows that when profiling utility varies across kernels, kernel-conditioned

∗^{*}Corresponding author.

Figure

Figure 1: Overview and motivation of our profiling reasoning framework. Left: Traditional kernel optimization and its key challenges, where redundant profiling signals introduce noisy feedback (a) and repeated profiling rounds incur high latency and LLM overhead (b). Right: Our AutoProfiler method utilizes tree-based sequential profiling to selectively acquire informative signals, achieving effective optimization with reduced profiling overhead.

selection can outperform any single fixed configuration, which is further supported by our empirical oracle analysis. Together, these findings suggest that effective profiling is not about collecting more information, but about identifying the right information for each kernel.

To this end, we propose AutoProfiler, which learns a kernel-conditioned profiling policy that adaptively acquires profiling metrics before invoking the kernel rewriter. We formulate profiling as sequential information acquisition and represent the policy with a deterministic profiling tree, which selects subsequent measurements based on previously observed profiling results. The tree is refined through optimization feedback: an LLM proposes structural REWRITE to deepen the tree by collecting more profiling information, and SPLIT to widen the tree for kernels with different profiling needs, while empirical paired evaluation determines whether a proposed modification is accepted. The LLM is used only during policy construction, leaving inference-time routing fully deterministic.

Experiments on KernelBench show that AutoProfiler improves kernel optimization over fixed profiling configurations under a constrained profiling budget, while recovering a substantial portion of the gain available from kernel-conditioned selection. Interestingly, the learned profiling policy remains effective across iterative optimization rounds, enabling continued gains without repeated LLM-based profiling decisions. Together, these results point to a promising direction for self-improving kernel generation: using more targeted profiling to provide effective feedback at lower cost, thereby supporting continued improvement through iterative optimization.

References (19)