😀 😀 I really do love how llama2.c was translated to a zillion languages I've never heard about. Looking forward to that with the training too! The design space is a lot wider too because you can train stuff, not just inference a fixed, given thing.
@karpathy
-
Forward/Backward Implementation Complete, Now Optimizing with CUDA
By
–
Once you have the forward/backward, the rest of it (data loader, Adam update, etc) are mostly trivial. The real fun starts now though: I am now porting this to CUDA layer by layer so that it can be made efficient, perhaps even coming within reasonable fraction of PyTorch, but
-

Memory Allocation Strategy in LLM Training Implementation
By
–
You can look at the raw training implementation here: https://
github.com/karpathy/llm.c
/blob/master/train_gpt2.c
… You'll see that we allocate all the required memory a single time in the beginning in one large block of 1D memory. From there on during training, no memory gets created or destroyed, so we stay at -

Implementing Neural Network Layers with Memory Pointer Management
By
–
Once you have all the layers, you just string all it all together. Not gonna lie, this was quite tedious and masochistic to write because you have to make sure all the pointers and tensor offsets are correctly arranged. Left: we allocate a single 1D array of memory and then
-
llm.c: Train GPT-2 in Pure C Without Heavy Dependencies
By
–
Have you ever wanted to train LLMs in pure C without 245MB of PyTorch and 107MB of cPython? No? Well now you can! With llm.c: https://
github.com/karpathy/llm.c To start, implements GPT-2 training on CPU/fp32 in only ~1,000 lines of clean code. It compiles and runs instantly, and exactly -
Terminal Upgrade on MacBook: AI-Native Tools and Workflow Integration
By
–
Yeah that’s my default Terminal on my new MacBook now. So far great upgrade. A lot of what makes VS Code so great, and AI native.
Very eager to upgrade a lot of tools. AI unlocked a ton of potential but no one wants to copy paste things around. You fall back on it if you have to -
Evaluating Cursor as VS Code Alternative for Low Latency Applications
By
–
Very interesting, will have to try! Seems like the perfect fit as a very latency sensitive, very high value application.
Currently (and awkwardly) half of my open code windows are VS Code and half are Cursor, still evaluating. -
Focusing on Transformers Over ResNets
By
–
So I’ve heard too, not sure.
(fwiw I’d be inclined to focus on the Transformer and ignore ResNets, too) -
Tinygrad’s Public Quest to Build Commodity Petaflop Compute
By
–
Follow along the @__tinygrad__ saga, who are (very publicly!) trying to build your commodity ~petaflop compute node. tinybox specs: https://
tinygrad.org
the youtube videos form @realGeorgeHotz are actually quite great and entertaining, featuring the signature blend of