KernelEvolve: How Meta’s Ranking Engineer Agent Optimizes AI Infrastructure
KernelEvolve is Meta's agentic kernel-authoring system that treats kernel optimization as a search problem instead of one-shot LLM code generation. Monte Carlo tree search and evolutionary strategies explore hundreds of candidate kernels across Triton, CuTe DSL, FlyDSL, CUDA, HIP and MTIA C++. Nodes use configurable memory operators that draw on parent, sibling or no history. A retrieval-augmented, self-updating knowledge base supplies hardware documentation and distilled optimization skills, and an evaluation harness (TritonBench, PyTorch Profiler, NCU, Proton, MTIA Insight) feeds diagnoses of memory-bound, compute-bound or occupancy limits back to the LLM. Results include over 60% inference throughput gain for the Andromeda ads model on NVIDIA GPUs and over 25% training throughput gain on MTIA, achieved in hours rather than weeks of expert tuning.
Related posts
- Key research and product announcements at the AI Native Conf
Together AI hardMasterTogether AI announced seven research and product releases spanning GPU kernels, reinforcement learning infrastructure and inference optimization. FlashAttention-4 targets NVIDIA Blackwell and is reported 2.7x faster than Triton and 1.3x faster than cuDNN 9.13. A single-kernel Megakernel cut a voice agent's time-to-first-64-tokens from 281ms to 77ms, and together.compile beats torch.compile by 41% on a Flux Kontext benchmark. ThunderAgent schedules whole agentic workflows to avoid KV cache thrashing and leaked tool sandboxes, ATLAS-2 retrains speculative decoders online from live traffic, and cache-aware prefill-decode disaggregation sends warm and cold requests to separate tiers over an RDMA KV cache for 35-40% higher QPS.
- Meta introduces its first-generation AI inference accelerator
Meta Engineering hardMasterMTIA v1 is Meta's first custom inference ASIC for deep learning recommendation models: a TSMC 7nm, 800 MHz, 25 W chip delivering 102.4 INT8 TOPS, built from an 8x8 mesh of processing elements with customized RISC-V cores, fixed-function units, 128 KB local SRAM each, 128 MB shared on-chip SRAM and up to 128 GB LPDDR5. Twelve accelerators on dual M.2 boards sit in Yosemite V3 servers connected by PCIe switches. A PyTorch-integrated software stack lowers models through FX IR and LLVM, with hand-tuned kernels and a KNYFE DSL for generating kernels. On perf/W, MTIA beats an NNPI accelerator and a GPU on low- and medium-complexity DLRMs but trails the GPU on high-complexity models, and memory and interconnect bandwidth are the bottlenecks for future designs.
- Last year we built megakernels. This year we deleted them: The road to Together Compiler
Together AI hardMasterMegakernels for Llama 1B hit 990 TPS on H100 but were too inflexible to productionize, supporting only one model, batch size and precision. Applying CUDA Graphs plus Programmatic Dependent Launch (PDL) to default Torch Inductor kernels recovers 98% of that performance with no hand-written kernels, and agent-driven "multi-kernels" beat the old megakernels by up to 1.7x, exceeding 1100 TPS. The analysis also shows where Inductor falls short: workload-dependent flag effects across 607 config options, misleading isolated benchmarks (L2 flushes, zeroed inputs, CPU launch overhead in timings), and greedy pairwise fusion that ignores SM utilization. These findings shaped Together Compiler, a system that searches the optimization space and measures kernels inside real forward passes on real data.
- Together Compiler: Continual Compilation for AI inference
Together AI hardMasterTogether Compiler (TKCC) is an agent-driven continual optimization loop that recompiles inference engines as model, hardware and traffic shape drift. It avoids repeated engine restarts by using persistent engines that hot-reload candidate forward passes, cutting time-to-serving from 467s to 9s and raising experiment throughput 252x. A two-tier setup pairs fast few-layer engines for low-variance timing with slower many-layer engines that check results on real data distributions, which matters for MoE and sparse attention. A cost model combining hardware specs, microbenchmarks and measured forward passes picks the parallelism strategy, and the system reports up to 2.6x higher TPS on InferenceX AgentX, 1.7x over open-source megakernels on Llama 1B at batch size 1, and gains on non-LLM workloads.
- Custom Kernels for All from Codex and Claude
Hugging Face mediumAdeptHugging Face packaged CUDA kernel expertise (GPU architecture guides for H100/A100/T4, diffusers and transformers integration patterns, vectorized kernel templates, benchmark scripts) into an agent skill that lets Claude and Codex generate complete kernel-builder projects with PyTorch bindings. Agent-written RMSNorm kernels averaged 1.88x over PyTorch for LTX-Video and 1.94x for Qwen3-8B on H100 in BF16, with Qwen3 speedups growing from 1.58x at 128 tokens to 2.47x at 8192. End to end, LTX-Video gained only 6% (1.43x with torch.compile), consistent with RMSNorm taking about 5% of compute. The post also walks through building all PyTorch/CUDA variants with Nix and publishing to the Kernel Hub for one-line loading via get_kernel.