one year on
Karpathy releases llm.c, a pure C/CUDA implementation for training LLMs
The project aims to strip away Python dependencies and provide a minimal, educational, yet performant codebase for training GPT-2 and GPT-3 series models.
Andrej Karpathy today released llm.c, a new open-source project that implements large language model training in ‘simple, pure C/CUDA’ with no need for 245MB of PyTorch or 107MB of cPython. The repository currently supports reproducing the GPT-2 series, including the 124M parameter model, and says it can reproduce other models from the GPT-2 and GPT-3 series.
The project includes a reference CPU implementation in roughly 1,000 lines of clean C code, as well as a faster CUDA version that the README says is a bit faster than PyTorch Nightly, by about 7%. Karpathy frames the project as both an educational tool and a practical training framework, aiming to keep the mainline code simple while incorporating library calls like cuBLAS and cuDNN for speed.
On Hacker News, where the project drew 1,050 points and 168 comments, the reception was enthusiastic but tempered. Commenters noted that the CUDA portion is still ‘aspirational’ at this point, and some raised concerns about hand-rolled gradients. However, many welcomed the stripped-down approach as a refreshing alternative to Python’s heavy dependency chains.
Looking forward to the videos promised by Karpathy once the project stabilizes.
Expressed appreciation for shedding Python dependencies and getting 'down to the metal'.
Praised Karpathy's high-quality, open contributions to the AI community.
One year later — open only if you can handle spoilers
llm.c gained steady adoption as a teaching tool and benchmark baseline, especially after Karpathy released follow-up video tutorials. The project accumulated over 30,000 GitHub stars and sparked numerous community ports to languages like Rust, Zig, and Mojo. It never displaced PyTorch for production training, but became a favorite for understanding transformer internals at the bare-metal level.
The Weekly Replay · free by email
This week, one year ago — every Sunday.
One email each Sunday: the week's replayed AI news, with the one-year-later annotations included. Written like it's breaking — dated like it isn't.
Free · double opt-in · unsubscribe anytime · privacy