Llm.C
LLM training in simple, raw C/CUDA
About
LLMs in simple, pure C/CUDA with no need for 245MB of PyTorch or 107MB of cPython. Current focus is on pretraining, in particular reproducing the GPT-2 and GPT-3 miniseries, along with a parallel PyTorch reference implementation in train_gpt2.py. You'll recognize this file as a slightly tweaked nanoGPT, an earlier project of mine. Currently, llm.c is a bit faster than PyTorch Nightly (by about 7%). In addition to the bleeding edge mainline code in train_gpt2.cu, we have a simple reference CPU fp32 implementation in ~1,000 lines of clean code in one file train_gpt2.c. I'd like this repo to only maintain C and CUDA code. Ports to other languages or repos are very welcome, but should be done in separate repos, and I am happy to link to them below in the "notable forks" section. Developer coordination happens in the Discussions and on Discord, either the #llmc channel on the Zero to Hero channel, or on #llmdotc on GPU MODE Discord.
Open Source Health
- Stars
- 30,987
- Forks
- 3,762
- License
- MIT
- Last commit
- 1 years ago
Alternatives to Llm.C
The Algorithmby TwitterSource code for the X Recommendation Algorithm
Recommendersby TensorFlowTensorFlow Recommenders is a library for building recommender system models using TensorFlow.- RPG_KDD2025by FacebookresearchThis repository provides the code for implementing RPG described in our KDD'25 paper "Generating Long Semantic IDs in Parallel for Recommendation".
- Pairecby AlibabaA Go web framework for quickly building recommendation online services based on JSON configuration.
Textrankby Summa NLPTextRank implementation for Python 3.
Resources & Links
Related Categories
Using Llm.C?
Track its cost next to the rest of your stack and get a reminder before it renews.
Add to my stackVendor
Karpathy
Publisher of Nn Zero To Hero, Char Rnn and Llm.C