LLM training in simple, raw C and CUDA
open sourceMITfree
llm.c trains LLMs in simple, pure C and CUDA, without PyTorch or Python, with a parallel PyTorch reference implementation. Its focus is pretraining, in particular reproducing the GPT-2 and GPT-3 model series, with a step-by-step guide to reproducing GPT-2 (124M), plus simpler single-GPU fp32 files for learning CUDA. It's by Andrej Karpathy.
Problems it solves
- reproduce GPT-2 training from scratch
- learn how LLM training works in CUDA
- train a small GPT without PyTorch
Features
- LLM pretraining in pure C/CUDA
- GPT-2 and GPT-3 reproduction
- PyTorch reference implementation
- simple fp32 single-GPU files
