Article may be outdated

This article is 17 days old. Some details may have changed since publication.

Hacker News·3 min read·hard

Microgpt in pure C hits 10M tps on Apple m5

D
dhorthy
Microgpt in pure C hits 10M tps on Apple m5
AI Summary

A developer has created a dependency-free, character-level GPT model written entirely in C that runs efficiently on modern hardware. The project demonstrates high-performance inference capabilities, achieving over 10 million tokens per second on an Apple M5 chip.

Why it matters

This project showcases the potential for extreme optimization in AI, proving that language models can be run with minimal overhead and high efficiency.

Dive DeeperCreate a free account to unlock

The most atomic way to train and inference a GPT in pure, dependency-free C.

A character-level transformer with forward pass, backprop, Adam and sampling, in one C file with nothing beyond libc. It trains on ~32k names in a couple of seconds and generates new ones.

make run Or run it directly, on any corpus with one item per line:

./microgpt data/names.txt Builds on macOS, Linux and Windows (MSYS2), on ARM64 with NEON and x86-64 with AVX2. The Makefile picks the flags for the host.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in