Better HN
topnewbestaskshowjobs
Log inSign up

markusheimerl

36 karma · joined Jul 31, 2024 (2y ago) · 9 submissions

Submissions

comment 5mo ago · link · parent

https://github.com/markusheimerl/gpt/blob/main/train.c - in this file, search for the line "const int batch_size = 15;" - reduce this number

comment 5mo ago · link · parent

Sure it could be extended to support LoRA finetuning but this implementation has the goal to be as lean and efficient as possible for a pre-training stack as you can be.

comment 5mo ago · link · parent

the data gets downloaded via curl from huggingface - sure you can make your own data, simply dump all text you want the model to be trained on into "corpus.txt" and skip "make data".

As the tokenizer adds substantial complexity, this implementation does not include any tokenziation logic and works on raw bytes. Feel free to add your own tokenzier with the help of the coding model of your choice.

You can stop the training using CTRL+C You can train on as little memory as you have. Simply reduce batch size and/or model dimensions in train.c You can change the context window size in train.c via the "seq_len" variable.

Regarding Ruby, LORA and quantization I'll have to refer you to the coding agent of your choice.

comment 5mo ago · link · parent

I did run it as a test on the NVIDIA Jetson Orin Nano Super Dev. Kit once - so yea it works on arm like a charm ;)

comment 5mo ago · link · parent

Reduce batch size in train.c

comment 5mo ago · link · parent

I deleted the numerical checks a while back after confirming the backward pass is correct to keep the code base lean - running https://github.com/markusheimerl/gpt/blob/main/transformer/a... is also somewhat of a confirmation that the backward pass is correct, since an analytically incorrect backward pass cant fit perfectly to synthetic data.

7.

Tiny hackable CUDA language model implementation(github.com ↗)

81 points · by markusheimerl · 5mo ago · 13 comments

8.

Stick in Bike Wheel OOP(imgflip.com ↗)

1 points · by markusheimerl · 2y ago · discuss