Views
No views yet
llm.kittens C++/CUDA trainer, which is a fork of Karpathy's llm.c with some optimisations for SM120, and multi-stack kernel optimisations.safetensors weights.
It was trained on a single RTX 5090 in 14 hours.model.safetensors20000 / 200000.7857400.875080207135 tokens/s2531.04 ms39.7%2605.014347 ms248,894,656 bytes124,475,9041.33 to 1.58 for the 768-hidden-size 1- and 2-layer attention-head ablations in Figure 24. This run's 0.875080 validation loss is lower, but the comparison is not apples-to-apples: this model is a 12-layer GPT-2-style model using GPT-2 tokenization, a 1024-token context, and a different implementation/training setup.d121212768102450,257dev/data/tinystories.py in llm.kittens.1./train_gpt2cu \
2 -i "dev/data/tinystories/TinyStories_train.bin" \
3 -j "dev/data/tinystories/TinyStories_val.bin" \
4 -o "log124M/5090_S" \
5 -v 250 -s 20000 -g 144 \
6 -h 0 \
7 -b 64 -t 1024 -d 524288 \
8 -r 0 \
9 -z 1 \
10 -c 0.1 \
11 -l 0.0006 -q 0.0 -u 700 -n 5000 \
12 -y 0 \
13 -e "d12" \
14 -x 20000641024524,288 tokens20,000llm.kittens6e-4700 steps0.00.115000 steps1Once upon a time, there was a little boy named Timmy. Timmy loved going to school and playing with his friends. One day, Timmy woke up and felt very hot. He asked his mom if his head hurt. His mom said it might be burnt. Timmy's mom recommended they switch their shirts outside so he would feel better.
2
3Timmy went outside and saw his friends playing. He wanted to join them, but he remembered his mom's recommendation. He switched his shirt right away and felt much cooler. Timmy was happy he listened to his mom and his friends.
4
5Later, during recess, Timmy's friend asked him to go on the slide.model.safetensors: BF16 Transformers weights.config.json: GPT-2 model configuration.generation_config.json: default generation settings.tokenizer.json: GPT-2 tokenizer.vocab.json and merges.txt: GPT-2 BPE vocabulary files.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_id = "adamroberts/tinystories-5090"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16)
7
8inputs = tokenizer("Once upon a time", return_tensors="pt")
9with torch.inference_mode():
10 outputs = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.8)
11
12print(tokenizer.decode(outputs[0], skip_special_tokens=True))https://github.com/adamdroberts/llm.kittenshttps://arxiv.org/abs/2305.07759