Skip to content
AloneMathPublic

About

Build your 124M GPT.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build-GPT

You can train a GPT-2 124M-sized model with just a single GPU.

Requirements

pip install torch tiktoken numpy tqdm argparse multiprocessing math time os

Quick start

1. Download the dataset

Quick test first: 2 small shards of 1M tokens (~1 minute)

python dataset.py --total_tokens 2e6 --shard_size 1e6

Then the real run: 10 shards x 100M = 1B tokens (~2 GB)

python dataset.py 

2. Train

python gpt.py
python train.py

Project layout

dataset.py           
gpt.py        
train.py
data/fineweb_edu                   
log/                    

License

MIT

About

Build your 124M GPT.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages