microgpt

microgpt (optimized + CUDA)

microgpt logo

A minimal GPT project with two aligned implementations:

What this repo focuses on

Core model/training recipe (both paths):

Repository layout

Quick start (Python)

python microgpt.py

If input.txt is missing, the script downloads the default names dataset automatically.

Quick start (CUDA / Windows)

Prerequisites:

Build:

cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_CUDA_ARCHITECTURES=86
cmake --build build --config Release

Run:

.\build\Release\microgpt_cuda.exe --help
.\build\Release\microgpt_cuda.exe

Smoke test:

.\build\Release\microgpt_cuda.exe --steps 5 --samples 3

CUDA CLI options

Important implementation notes

Code converter page

Open microgpt_optimized.html in a browser to switch between:

This is useful for checking one-to-one conceptual mapping between the two codebases.

Credits

Original microgpt idea and baseline by @karpathy: