Developer Runs Autonomous Qwen 27B Agent for 21 Days to Write CUDA Kernels
A developer ran an autonomous Qwen 27B LLM agent loop on a single consumer NVIDIA RTX 3090 GPU for 21 days to build a custom CUDA inference engine optimized for itself. Despite producing lower prefill speeds than llama.cpp (~250 vs ~700 tokens/sec) and needing 12 human nudges, the agent successfully generated functional working kernels. This experiment proves that open-weight mid-sized LLMs running on consumer hardware can maintain long-horizon goals over hundreds of subagent cycles and millions of tokens. It demonstrates the growing feasibility of autonomous software engineering while highlighting practical bottlenecks like protocol management and compaction overhead. The setup involved 180 subagents and over 230 million processed tokens, undergoing 699 context compactions that accounted for about 83 hours (17% of total runtime). The system also managed a trick 'suicide loop' architecture, where the local vLLM serving engine had to safely shut down and restart on the same GPU to allow the generated CUDA kernels to run benchmarks without running out of VRAM.
## BACKGROUND
CUDA is NVIDIA's parallel computing platform that allows developers to write low-level code (kernels) to accelerate compute-intensive operations like LLM inference. During LLM execution, the prefill phase processes initial prompt tokens before text generation begins, while context compaction summarizes past interaction history to stay within context length limits.