AVO 将 LLM coding agent 提升为进化搜索的 variation operator,在 NVIDIA B200 上经 7 天自主进化产出 attention kernel:causal MHA 超越 cuDNN 至多 3.5%、FA4 至多 10.5%,峰值 1668 TFLOPS (BF16);优化 30 分钟迁移至 GQA。
现有 LLM-augmented evolutionary search 框架(FunSearch、AlphaEvolve、LoongFlow)将 LLM 限制在固定流水线的 Generate 环节:框架负责 Sample(亲本选择)和 evaluation,LLM 仅做单轮代码生成。LLM 无法自主查阅硬件文档、运行 profiler、诊断编译/正确性失败、或根据累积反馈修改优化策略。对 Blackwell 上已被深度手工优化的 attention kernel(FA4 历经数月人工调优、cuDNN 为闭源专用实现),进一步提升需要跨越文档阅读 → profiling → 代码修改 → 编译测试 → 诊断的多步工程循环,单轮生成无法支撑。
AVO (Agentic Variation Operators) 用一个自主 coding agent 替代进化搜索的整个 Vary 算子。传统分解:
$$\texttt{Vary}(\mathcal{P}_t) = \texttt{Generate}(\texttt{Sample}(\mathcal{P}_t))$$
AVO 替换为:
$$\texttt{Vary}(\mathcal{P}_t) = \texttt{Agent}(\mathcal{P}_t, \mathcal{K}, \mathbf{f})$$
Agent 输入三要素:
单次 variation step 内部是 edit → evaluate → diagnose 自主循环:agent 自行决定查阅哪些文档、修改哪段代码、运行哪些测试、如何诊断失败。成功提交条件为通过正确性检查且吞吐 ≥ 当前最优。跨步骤通过 git commit 维持 lineage 连续性。持续进化通过 self-supervision 机制维持:当 agent 停滞或陷入无效编辑循环时,supervisor 审视整体进化轨迹并提出新的候选优化方向,重新引导探索。
核心技术壁垒:让通用 coding agent 在长时间自主运行中积累跨多个硬件子系统(同步/内存序、流水线调度、寄存器分配)的联合优化能力。7 天内 500+ 优化方向的系统性探索远超人类工程师同等时间产出,而三个代表性优化(§5 详述)均需联合推理多个 GPU 子系统,非单一参数调优。
| 配置 | vs cuDNN | vs FA4 | 峰值 |
|---|---|---|---|
| MHA causal (all seq_len) | +0.4% ~ +3.5% | +5.0% ~ +10.5% | 1668 TFLOPS |
| MHA non-causal (seq ≥ 16K) | +1.8% ~ +2.4% | — | — |
| MHA non-causal (seq < 16K) | 测量噪声内 | 测量噪声内 | — |
| GQA causal (group 4/8) | 至多 +7.0% | 至多 +9.3% | — |
| GQA non-causal (group 4/8) | 至多 +6.0% | 至多 +4.5% | — |
进化轨迹:40 committed versions / 7 天,5 个架构拐点。GQA 适配仅需额外 30 分钟自主运行。

Paper Figure 1。左:传统 evolutionary search (FunSearch / AlphaEvolve 等) 遵循 fixed pipeline,LLM 仅参与 single-turn generation。右:AVO 将整个 variation operator 替换为自主 agent,可自行查阅 previous solutions、evaluation utilities、tools 和 persistent memory,进行迭代式 plan → implement → test → debug。
关键对比:传统方案中 Sample 和 evaluation 由框架硬编码控制,LLM 无法在生成过程中获得 execution feedback 或主动查阅文档。AVO 中 agent 拥有完整自主权——包括何时查阅 $\mathcal{P}_t$ 中的历史版本、何时运行 profiler、何时改变优化策略。

Paper Figure 2。AVO 的核心结构:自主 coding agent 以完整进化谱系 $\mathcal{P}_t$、领域知识库 $\mathcal{K}$、评分函数 $\mathbf{f}$ 为输入,内部执行多轮 edit-evaluate-diagnose 循环。
目标运算:scaled dot-product attention $O = \mathrm{softmax}(QK^\top / \sqrt{d}) \, V$,forward prefilling,BF16 精度,head dimension 128。
目标硬件与 warp-specialized pipeline (B200 Blackwell):
AVO 在此 warp-specialized pipeline 上进化,从 seed kernel 出发经 40 版本迭代,逐步发现跨子系统优化。
| 符号 | 含义 |
|---|---|
| $\mathcal{P}_t$ | 进化谱系:所有已 commit 的 solution-score 对 $\{(x_i, \mathbf{f}(x_i))\}$ |
| $x_i$ | 第 $i$ 个 candidate solution(CUDA kernel 源码 + inline PTX) |
| $\mathbf{f}$ | 多维评分函数:$(f_1, \ldots, f_n)$,每维为一个 benchmark 配置的 TFLOPS |
| $\mathcal{K}$ | 领域知识库:CUDA guides + PTX ISA + Blackwell spec + FA4 source |
| $\texttt{Vary}$ | Variation operator:从 $\mathcal{P}_t$ 产生新 candidate |
| $\texttt{Sample}$ | 亲本选择(传统方案,score/diversity-based heuristics) |
| $\texttt{Generate}$ | LLM 单轮生成(传统方案) |
| $\texttt{Agent}$ | AVO 的自主 coding agent,替代 Sample + Generate + evaluation |
Eq. 1 — $\mathcal{P}_{t+1} = \texttt{Update}(\mathcal{P}_t, (x_{t+1}, \mathbf{f}(x_{t+1})))$, $x_{t+1} = \texttt{Vary}(\mathcal{P}_t)$:进化主循环。Vary 产生候选,Update 将其加入群体(可能剪枝低分成员)。所有进化搜索共享的框架性定义。
Eq. 2/3 — $\texttt{Vary}(\mathcal{P}_t) = \texttt{Generate}(\texttt{Sample}(\mathcal{P}_t))$:传统 LLM-augmented evolutionary search 的 Vary 分解。AlphaEvolve 用 island-based MAP-Elites + fitness/diversity heuristics 做 Sample;LoongFlow 用 Boltzmann selection + fixed Plan-Execute-Summarize pipeline。LLM 仅参与 Generate。
Eq. 4 — $\texttt{Vary}(\mathcal{P}_t) = \texttt{Agent}(\mathcal{P}_t, \mathcal{K}, \mathbf{f})$:AVO 的核心形式化。整个 Vary 被替换为单个 autonomous agent 调用,agent 同时承担亲本选择、候选生成和中间评估。$\mathcal{K}$ 和 $\mathbf{f}$ 的直接可访问性是与传统分解的结构性区别。
本文形式化为定义性(描述框架结构),非分析性(无定理/收敛证明)。主要证据为实证。

Paper Figure 3。B200, head\_dim=128, 16 heads, BF16, total tokens 固定 32K。左 non-causal,右 causal。
Causal MHA 是 AVO 的主要优势区域:所有 4 个 seq\_len 配置全面超越两条 baseline,最大增益出现在 seq\_len=32K(cuDNN +3.5%, FA4 +10.5%)。Non-causal 在短序列(4K, 8K)处与 baseline 在测量噪声内,长序列(16K, 32K)有 +1.8%~2.4% 增益。Causal 与 non-causal 的不对称性源于 branchless rescaling 优化仅应用于 fully unmasked 的 K-block iterations——causal 模式下存在 fully masked blocks 仍需原始分支逻辑。

Paper Figure 4。32 query heads, head\_dim=128, BF16。Group size 8 (Qwen3-30B-A3B) 和 group size 4 (Qwen3-8B) 两种配置,causal 和 non-causal。
GQA 结果验证了 MHA 进化中发现的优化并非针对 MHA 特定 compute pattern 过拟合:在不同 query/KV head 比例下均保持优势。Causal GQA 上 cuDNN 至多 +7.0%、FA4 至多 +9.3%;non-causal 至多 +6.0% / +4.5%。GQA 适配仅需 30 分钟 agent 自主运行,无人工指导。

Paper Figure 5。绿色实线为 running-best geometric mean;绿色圆点标记刷新最优的版本;虚线为 cuDNN / FA4 geometric mean baseline。40 committed versions / 7 天。
40 个 committed versions 背后是 500+ 个已探索的候选优化方向(包括正确性失败、吞吐回退、编译失败的尝试)。吞吐呈阶梯状提升:v1–v20 为粗粒度增益(缩小与 baseline 的差距),v21–v40 为细粒度 cycle-level 调度和资源分配(增益递减但持续积累)。
5 个架构拐点对应阶梯跳跃:
| 优化 | 版本 | Non-causal | Causal | 攻击的瓶颈 |
|---|---|---|---|---|
| Branchless accumulator rescaling | v19→v20 | +8.1% | +1.6% | warp sync + blocking memory fence |
| Correction/MMA pipeline overlap | v29→v30 | +1.1% | +0.4% | correction warp idle during 2nd PV GEMM |
| Register rebalancing | v32→v33 | +2.1% | ~0% | correction warp register spill to local mem |
Branchless rescaling(最大单项增益):online softmax 中 running maximum 变化时需 rescale output accumulator。v19 用条件分支检查是否需要 rescale——分支引入 warp synchronization 开销并阻止使用轻量 memory fence。v20 改为 branchless speculative 路径:总是计算 rescale factor,不需要时用 predicated select 替换为 1.0(乘 1.0 的代价远小于分支同步代价)。消除分支 → 消除 warp divergence → blocking fence 替换为 non-blocking ordering fence。Non-causal 增益远大于 causal,因为 branchless 路径仅应用于 fully unmasked K-block iterations。
Correction/MMA overlap:dual Q-stage pipeline 中,v29 的 correction warp 需等待两个 PV GEMM 均完成才开始 normalize。v30 让 correction warp 在第一个 PV GEMM 完成后即开始工作,与第二个 PV GEMM 重叠执行——串行依赖转为 pipeline 并行。
Register rebalancing:Blackwell 每 SM 2048 warp-registers。FA4 分配 192 / 80 / 48(softmax 8 warps / correction 4 warps / remaining 4 warps)。Profiling 发现 correction warp group 在 80 寄存器下 spill 到 local memory。v33 重新分配为 184 / 88 / 56——可行因为 AVO kernel 的 softmax 用 packed arithmetic 处理 score values,184 寄存器仍有充足 headroom;correction warp 在 §5.2 pipeline overlap 后位于 critical path,8 个额外寄存器减少 spill 消除 stall。
| 步骤 | 论点 | 证据来源 | 依赖 |
|---|---|---|---|
| 1 | 现有 LLM-in-loop evolutionary search 将 LLM 限制在 single-turn Generate,无法自主诊断、查阅文档或迭代修改 | §2.1: FunSearch / AlphaEvolve / LoongFlow 的 fixed pipeline 分析 | — |
| 2 | 自主 coding agent 具备 planning + tool use + persistent memory,可执行多步工程循环 | §1: SWE-bench / SWE-agent / Claude Code / Codex / VibeTensor | 步骤 1 的 gap |
| 3 | AVO 将自主 agent 替代整个 Vary operator,agent 拥有 $\mathcal{P}_t$ / $\mathcal{K}$ / $\mathbf{f}$ 的完整访问权 | §3.1: Eq. 4 形式化 + §3.2: edit-evaluate-diagnose 循环 | 步骤 1 + 2 |
| 4 | AVO 在 B200 attention kernel 上超越 cuDNN 和 FA4 | §4.2 Fig. 3 (MHA) + §4.3 Fig. 4 (GQA) | 步骤 3 的实例化 |
| 5 | agent 发现的优化是真实硬件级多子系统联合推理,非表面代码变换 | §5.1–5.3: branchless rescaling / pipeline overlap / register rebalancing + Table 1 ablation | 步骤 4 的质量分析 |
| 6 | MHA 优化可迁移至 GQA,说明发现的优化具有泛化性 | §4.3: 30 min 自主适配 + Fig. 4 全配置超越 baseline | 步骤 4 + 5 |
[实现未公开]
AVO 使用 NVIDIA 内部开发的通用 coding agent,kernel 源码未开放。
可追踪的外部依赖:
71bf77c)关键实现细节:
Software → Hardware 反向启示: