Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Show HN: NanoEuler – GPT-2 scale model in pure C/CUDA from scratch

A developer built NanoEuler, a GPT-2-scale language model written entirely in pure C and CUDA from scratch, without any intermediary frameworks. The project aims to understand the low-level composition of LLMs, the correlation between parameters and data, and GPU optimization. It was trained on Shakespeare.txt up to 23 million parameters and includes SFT for chatbot-like behavior.

Background

The author built a small language model (~23M parameters, roughly GPT-2 scale) entirely in C and CUDA — no PyTorch, TensorFlow, or any high-level framework. This is unusual and educational: most ML work abstracts away GPU programming. Doing it in raw CUDA forces deep understanding of how neural networks train and run on hardware. The author trained on Shakespeare's text (a classic pedagogical exercise from Andrej Karpathy's "nanoGPT") and applied SFT (Supervised Fine-Tuning) to make it chatbot-like. The project was motivated by the author's ambition to work at Anthropic (the company behind Claude).