HyperAIHyperAI

Command Palette

Search for a command to run...

自律的進化探索のためのエージェント型変異オペレータ AVO

概要

エージェント型変異オペレータ(AVO)は、古典的な進化探索における固定された突然変異、交叉、および人手で設計されたヒューリスティクスを、自律的なコーディングエージェントで置き換える、新しい進化的変異オペレータの一群である。AVOは、言語モデルを所定のパイプライン内での候補生成に限定するのではなく、変異を自己指向型のエージェントループとして具現化する。このループは、現在の系統、ドメイン固有の知識ベース、および実行フィードバックを参照し、実装の編集を提案、修復、批評、検証することができる。我々は、AIにおいて最も積極的に最適化が進められているカーネルターゲットの一つであるアテンションを対象に、NVIDIA Blackwell (B200) GPU上でAVOを評価した。マルチヘッドアテンションにおける7日間の継続的な自律進化を通じて、AVOは評価した構成全体で、cuDNNを最大3.5%、FlashAttention-4を最大10.5%上回る性能のカーネルを発見した。発見された最適化はグループ化クエリアテンションにも容易に転用可能であり、わずか30分の追加の自律的適応により、cuDNNに対して最大7.0%、FlashAttention-4に対して最大9.3%の性能向上をもたらした。これらの結果は、エージェント型変異オペレータが、エージェントを候補生成器から変異オペレータへと昇格させることで、従来のLLM-in-the-loop型進化パイプラインを超克し、今日の最先端GPUハードウェアにおいて、熟練技術者が設計した最先端のアテンション実装を凌駕するカーネルを生み出す、性能に直結するマイクロアーキテクチャレベルの最適化を発見できることを示している。

One-sentence Summary

NVIDIA researchers propose Agentic Variation Operators (AVO), autonomous coding agents that replace fixed evolutionary operators by self-directing variation through a loop consulting lineage, a knowledge base, and execution feedback to propose, repair, critique, and verify implementation edits, and over 7 days of continuous evolution on multi-head attention discover kernels on Blackwell B200 GPUs outperforming cuDNN by up to 3.5% and FlashAttention-4 by up to 10.5%, with rapid transfer to grouped-query attention requiring only 30 minutes of adaptation to yield up to 7.0% and 9.3% gains respectively.

Key Contributions

  • Agentic Variation Operators (AVO) replace fixed evolutionary variation heuristics with autonomous coding agents that subsume sampling, generation, and evaluation into a single self-directed loop.
  • Applied to multi-head attention on NVIDIA Blackwell GPUs, AVO discovers kernels that outperform cuDNN by up to 3.5% and FlashAttention-4 by up to 10.5% after seven days of continuous evolution.
  • The discovered optimizations transfer to grouped-query attention with 30 minutes of additional adaptation, yielding improvements of up to 7.0% over cuDNN and 9.3% over FlashAttention-4.

Introduction

The authors address the challenge of using large language models in evolutionary code optimization, where prior systems confine the LLM to a single-turn candidate generator within a fixed pipeline. This limits the ability to perform the iterative, multi-step engineering required to surpass highly tuned implementations like attention kernels on GPUs, which demand studying hardware documentation, profiling, testing, and revising. To overcome this, they introduce Agentic Variation Operators (AVO), which replace the entire variation step with a self-directed coding agent that autonomously consults knowledge, evaluates candidates, and refines its approach over extended time horizons. Applied to multi-head attention on NVIDIA Blackwell B200 GPUs, AVO discovers micro-architectural optimizations that outperform cuDNN by up to 3.5% and FlashAttention-4 by up to 10.5%, with the learned techniques transferring to grouped-query attention in just 30 minutes of additional autonomous adaptation.

Method

The authors begin by detailing the complexity of attention computation on modern GPUs. Given query, key, and value matrices Q,K,VQ, K, VQ,K,V, attention computes O=softmax(QK/d)VO = \text{softmax}(QK^{\top}/\sqrt{d})VO=softmax(QK/d)V. While FlashAttention avoids materializing the full score matrix by processing key blocks sequentially, state-of-the-art kernels like FA4 on NVIDIA's Blackwell architecture employ warp specialization. Different warp groups handle matrix multiplications, online softmax, output rescaling, and data movement concurrently. Optimizing such highly tuned kernels requires deep hardware expertise and extensive profiling.

To automate this optimization, the authors propose Agentic Variation Operators (AVO). Traditional evolutionary search decomposes the variation operator into separate sampling and generation steps, confining the LLM to a fixed pipeline. AVO replaces this decomposition with a single autonomous agent run:

Vary(Pt)=Agent(Pt,K,f)\mathrm{Vary}(\mathcal{P}_t) = \mathrm{Agent}(\mathcal{P}_t, \mathcal{K}, \mathbf{f})Vary(Pt)=Agent(Pt,K,f)

where Pt\mathcal{P}_tPt is the full lineage of solutions and their scores, K\mathcal{K}K is a domain-specific knowledge base, and f\mathbf{f}f is the scoring function.

The input to the AVO system consists of three main components. The population Pt\mathcal{P}_tPt contains the lineage of prior CUDA kernel implementations and their scores. The knowledge base K\mathcal{K}K includes CUDA and PTX documentation, Blackwell architecture specifications, and reference GPU kernel codebases. The scoring function f\mathbf{f}f evaluates candidates on numerical correctness and throughput in TFLOPS; any candidate failing correctness checks receives a zero score regardless of throughput.

The core of the method is the AVO Main Agent Loop, which produces a new solution xt+1x_{t+1}xt+1 from the current lineage Pt\mathcal{P}_tPt. This autonomous loop involves several interconnected phases. During Planning, the agent proposes edits using the knowledge base and prior implementations. In Implementation, it applies code modifications. The Evaluation phase uses the scoring function f\mathbf{f}f to measure performance. If issues arise, the Bug-Fixing phase allows the agent to diagnose, repair, and adapt its plan. The agent frequently examines multiple prior implementations to identify bottlenecks and consults documentation to understand hardware constraints before implementing optimizations. This edit-evaluate-diagnose cycle repeats until a satisfactory xt+1x_{t+1}xt+1 is committed. A new version is persisted only when it passes correctness checks and matches or improves the benchmark score relative to the best committed version.

To ensure forward progress during long-running autonomous optimization, the authors incorporate an AVO Supervisor Agent. This supervisor monitors the main agent for stagnation, such as exhausting a line of exploration or entering unproductive edit cycles. When triggered, the supervisor reviews the overall evolutionary trajectory and provides conditional intervention to steer the search toward new candidate optimization directions.

The system operates as a continuous evolution loop. Each committed version is persisted as a git commit with its score, maintaining full state continuity across the entire process. In their evaluation, a 7-day run produced a final multi-head attention kernel spanning 40 successive versions, with the main agent autonomously deciding when to attempt new optimizations or shift strategies, while the supervisor intervened during periods of stagnation.

Experiment

The evaluation uses an agentic variation operator (AVO) to evolve CUDA attention kernels on NVIDIA B200 GPUs, benchmarking against cuDNN and FlashAttention-4 across multi-head and grouped-query attention configurations. AVO autonomously discovers optimizations that yield consistent throughput gains over both baselines, with the largest improvements coming from architectural changes like branchless rescaling, pipeline overlap, and register rebalancing, while later versions provide fine-grained tuning. The agent successfully adapts its evolved MHA kernel to GQA in under an hour, demonstrating that the discovered optimizations generalize beyond the original search space. Overall, the experiments show that agent-driven evolution can produce expert-level kernel optimizations by jointly reasoning about multiple hardware subsystems through iterative profiling and code modification.

Three agent-discovered kernel optimizations each improved throughput, with gains varying by attention type. Branchless accumulator rescaling delivered a large 8.1% improvement on non-causal attention but only 1.6% on causal, because the branchless path applies only to unmasked key blocks. Pipeline overlap and register rebalancing added further gains, primarily for non-causal scenarios where the correction warp is on the critical path. Branchless accumulator rescaling provides a substantial 8.1% geomean throughput gain on non-causal attention, but only 1.6% on causal attention, as the optimization is limited to fully unmasked key-block iterations. Register rebalancing across warp groups yields a 2.1% improvement on non-causal attention and negligible impact on causal, because the correction warp runs concurrently with the second GEMM only in the non-causal pipeline.

Agent-discovered kernel optimizations improved throughput, with gains concentrated in non-causal attention. The branchless accumulator rescaling was highly effective for non-causal scenarios but offered limited benefit on causal attention because it only applies to unmasked key blocks. Additional pipeline overlap and register rebalancing further boosted non-causal performance, where the correction warp lies on the critical path, while causal attention saw minimal improvement.


AIでAIを構築

アイデアからローンチまで — 無料のAIコーディング支援、すぐに使える環境、最高のGPU価格でAI開発を加速。

AI コーディング補助
すぐに使える GPU
最適な料金体系

HyperAI Newsletters

最新情報を購読する
北京時間 毎週月曜日の午前9時 に、その週の最新情報をメールでお届けします
メール配信サービスは MailChimp によって提供されています