You can train a GPT-2 124M-sized model with just a single GPU.
pip install torch tiktoken numpy tqdm argparse multiprocessing math time osQuick test first: 2 small shards of 1M tokens (~1 minute)
python dataset.py --total_tokens 2e6 --shard_size 1e6Then the real run: 10 shards x 100M = 1B tokens (~2 GB)
python dataset.py python gpt.pypython train.pydataset.py
gpt.py
train.py
data/fineweb_edu
log/