# Cursor's Multi-Agent System Speeds Up NVIDIA CUDA Kernels by 38% Without Human Intervention
Cursor's multi-agent AI system autonomously optimized 235 CUDA kernels for the NVIDIA Blackwell B200 architecture, achieving an average speedup of 38% over the baseline implementation. The experiment ran for three weeks and required no developer intervention—a task that typically takes kernel engineers months—was solved fully automatically.
Multi-Agent Optimization Architecture
The Cursor system used two types of agents: a planner and executors. The planner distributed tasks among the autonomous executors, monitored performance metrics, and rebalanced the workload in real time. All coordination happened through a single markdown file containing execution rules, test scenarios, and interaction protocols.
Each executor worked independently on its subset of kernels, applying low-level optimization techniques:
- Manual operation pipelining
- Fine-tuning data loading across memory levels (registers, shared memory, global memory)
- Selecting optimal block and grid parameters
- Generating PTX (Parallel Thread Execution) code—NVIDIA's assembly-like intermediate representation
This approach bypassed the limitations of traditional compilers and applied heuristics available only to GPU programming experts.
Testing and Validation Methodology
The optimized kernels underwent validation on a cluster of 27 NVIDIA B200 GPUs using the SOL-ExecBench benchmark. This tool checks not only computational correctness but also physical realizability of results:
- Comparison with reference implementations from cuBLAS and other NVIDIA libraries
- Assessment of proximity to the B200's theoretical throughput limit
- Detection of "cheating" attempts—for example, incorrect caching usage or input data substitution
If a result exceeded the architecture's physical capabilities, the run was rejected as invalid. Despite the strict criteria, the system successfully completed all 235 tasks in a single cycle without retries.
Two Generation Modes: CUDA C++ and CuTe DSL
The experiment was conducted in two programming modes:
- CUDA C++ with inline PTX: direct access to the GPU's ISA (Instruction Set Architecture), allowing control over registers and instructions at a near-assembly level.
- CuTe DSL: NVIDIA's new domain-specific API focused on tensor operations and optimization for Blackwell architectures. Since CuTe is barely present in AI model training data, this mode tested the agent's ability to learn from official documentation "from scratch".
Both modes demonstrated high effectiveness, confirming the universality of Cursor's approach to low-level code generation.
Breakthrough in GEMM Optimization
The GEMM kernel (General Matrix Multiply) generated fully autonomously by the system drew particular attention. This is a fundamental linear algebra operation underlying nearly all stages of neural network training and inference.
Comparison results:
- Achieved 86% of the performance of the reference cuBLAS kernel
- On some small matrices—9% superiority over cuBLAS
- cuBLAS, for reference, is hand-optimized by NVIDIA's team over years
Given that GEMM is a "bottleneck" in most AI workloads, even modest speedups here yield significant gains at the system level.
Statistics and Practical Significance
The 38% figure represents the geometric mean speedup across all 235 tasks relative to the baseline obtained with a single AI agent. However, key details matter:
- In 149 out of 235 cases (63%), it outperformed this baseline
- Speedups varied by kernel type: from 5% to over 2×
- The biggest gains were seen in kernels with regular memory access patterns
This is already Cursor's second successful project in kernel optimization for Blackwell. In the summer of 2025, the system rewrote its own training MoE layer (Mixture of Experts) from scratch, achieving 1.5× end-to-end speedup.
What Matters
- Multi-agent systems can replace months of manual work by kernel engineers
- Automatic optimization reaches 86% of cuBLAS levels—the NVIDIA gold standard
- The approach works with both traditional CUDA C++ and new DSLs like CuTe
- 63% of kernels showed improvement over a single AI agent
- The experiment validates the viability of autonomous AI systems in high-performance computing
— Editorial Team
No comments yet.