AsmEvo: Agentic Assembly-Level Optimization of AMD GPU Kernels with Functional Equivalence Verification
Organizations: Advanced Micro Devices, Inc. (AMD) · Southern University of Science and Technology, Shenzhen, China
Abstract
High-performance ML systems increasingly rely on GPU kernels whose editable source is unavailable, generated, or too distant from final machine code to expose remaining optimizations. Existing LLM kernel optimizers and autotuners mainly operate on CUDA, Triton, HIP, or tensor-program source and validate against reference implementations. We study a stricter setting: optimizing an already compiled AMDGPU code object, where the deployed binary is the only behavioral oracle. We present AsmEvo, an agentic assembly-level optimizer for AMD GPU kernels. Given an AMDGPU code object K0, AsmEvo reconstructs a reassemblable representation, proposes low-level edits with a long-horizon agent, rebuilds an ABI-preserving optimized object, and accepts candidates only after differential verification against K0 under identical launches. AsmEvo combines code-object recovery, metadata-aware rebuilding, profiling-guided hot-window editing, correctness-gated timing, and conservative in-place patch fallback. We conduct extensive experiments with AsmEvo on various AMD GPU kernels. On MI308X, AsmEvo improves 29 of 30 selected KernelBench kernels, reaching 1.35x geometric-mean and 3.88x maximum speedup. On MI300X production workloads, it improves all evaluated AITer binaries and vLLM/SGLang Triton assembly kernels, reaching 1.09x/1.31x and 1.18x/1.34x geometric-mean/maximum speedups, respectively, while preserving functional equivalence.
Figures & tables
| Source | Size | Coverage |
|---|---|---|
| KernelBench L1 | 15 | activations, losses, reductions/norms, depthwise conv, matmul, pooling |
| KernelBench L2 | 15 | fused GEMM/matmul and conv pipelines, normalization, activations, pooling, reductions |
| AITer | 4 | code-object MoE, FP8 FMHA, BF16 FMHA, BF16 FMHA backward |
| Triton JIT | 4 | vLLM/SGLang A8W8 GEMM, MoE, MoE LoRA, AWQ GEMM |
| Split | Kernels | Improved | Geo. | Max | Attempts/K | Commits/K | GPU | Best case |
|---|---|---|---|---|---|---|---|---|
| KernelBench L1 | 15 | 15 (100%) | 1.56 | 3.88 | 119.3 | 7.2 | MI308X | Depthwise Conv2D |
| KernelBench L2 | 15 | 14 (93%) | 1.17 | 2.55 | 156.4 | 6.8 | MI308X | Matmul+Swish+Sum+GroupNorm |
| All KernelBench | 30 | 29 (97%) | 1.35 | 3.88 | 137.8 | 7.0 | MI308X | Depthwise Conv2D |
| Source | Kernel | Speedup |
|---|---|---|
| AITer | aiter_fmoe_fp8_blockscale subgu256 | 1.310 |
| AITer | aiter_fmha_hd128_fp8_causal | 1.007 |
| AITer | new_aiter_fmha_hd192x128 bf16_causal | 1.025 |
| AITer | new_aiter_fmha_bwd_hd128 bf16_causal_a32 | 1.049 |
| vLLM | gemm_a8w8_blockscale | 1.234 |
| SGLang | sglang_fused_moe lora_kernel | 1.025 |
GPU Kernel Optimization
GPU kernel optimization improves the speed and memory efficiency of computations by tailoring code to GPU hardware and workloads.
See all 209 papers