Back to articles
AI Agents

AI Agent Beats FlashMLA by 9.8% After Writing Its Own Kernel

3 min read

A 22.5-hour public experiment points to a deeper role for AI agents in systems engineering: not merely assisting with code, but autonomously searching for faster low-level implementations.

According to QbitAI, Facewall Intelligence’s ForgeKernel optimized the FlashMLA Prefill kernel on an NVIDIA B200. The agent was given the kernel’s mathematical definition and constraints from the target hardware, but not DeepSeek’s original source code. No human engineer wrote the implementation directly. The final version reportedly took 472 microseconds, compared with 518 microseconds for the reference implementation—a 9.8% improvement.

What happened during the experiment

FlashMLA is a core attention operator, so improvements at this level can affect model inference efficiency. ForgeKernel did not produce a single candidate and stop. It repeatedly generated code, compiled it, checked correctness, measured performance, and used the results to guide the next attempt.

  • The first correct version took 1,834 microseconds.
  • In less than four hours, runtime fell to 593 microseconds.
  • The agent first surpassed its own previous version and later overtook FlashMLA.
  • The process completed 42 iterations, retained 32 versions, and used one B200 for 22 GPU-hours.

The report says the agent eventually identified contention between Q loading and KV movement for memory bandwidth. By changing the request rhythm, it cut runtime by a further 2.4%. Such decisions traditionally depend on engineers who understand the behavior of a specific GPU and its memory system.

More than code generation

ForgeKernel’s central idea is not simply asking a language model to produce CUDA. It treats optimization as an organized, iterative process. Architecture exploration is separated from implementation and divided into milestones. Hardware observations that have been experimentally confirmed are stored in a knowledge base. The best current implementation becomes the benchmark for the next round of self-improvement.

This design addresses a weakness of goal-only optimization. A model may be effective at tuning details while committing too early to an unsuitable overall architecture. Milestones and competitive self-comparison give it more opportunities to explore alternative routes.

The source material cites a related paper reporting that a goal-driven method beat human-maintained open-source libraries on eight of ten operators tested on B200. In another comparison, ForgeKernel matched or exceeded expert implementations in 24 of 29 cases. These figures are based on project disclosures and media reporting; test configurations and reproducibility still require broader public verification.

Why cross-chip support matters

ForgeKernel had reportedly ranked first on three Ascend hardware benchmarks covering 950DT, 950PR, and A3. The implementation details differ between CUDA and Ascend, but the system keeps the same high-level optimization process and changes the profiling tools used to learn each platform’s characteristics.

If this approach transfers reliably, chip vendors may be able to shorten the gap between launching new hardware and obtaining a useful operator library. The economic implication is also important: when generation, compilation, and testing are largely automated, customizing kernels for a particular model or accelerator becomes less expensive to justify.

That does not eliminate human experts. They still define objectives, build evaluation environments, inspect correctness, and decide which improvements matter. Their role shifts from manually polishing every line to designing the conditions under which an agent can search, test, and improve.

If the open-source release can be reproduced by the wider community, kernel optimization could become one of the earlier practical examples of recursive self-improvement. AI would not only use software tools; it would participate in building faster tools for AI itself.

Source: QbitAI

Comments

Checking sign-in status...

Loading comments...

Related articles