hn.today

Bare-metal C LLM engine for a 2006 PS3 (150.7 tok/s, 137x llama.cpp)

github.com10 points3 comments
Screenshot of Bare-metal C LLM engine for a 2006 PS3 (150.7 tok/s, 137x llama.cpp)

cell-llm is a from-scratch C inference engine designed for Linux on the 2006 PlayStation 3, using its PowerPC processor and six Synergistic Processing Units rather than llama.cpp, CUDA, Python, or machine-learning frameworks. On a real console, it ran the 135-million-parameter SmolLM2-Instruct model, quantized to four bits and held in the PS3’s 215 MiB of usable memory. The project reports peak generation of 150.72 tokens per second and 185.8 tokens per second for prompt processing. That is 137 times the speed of the best tested two-thread llama.cpp build on the same machine; the comparison also shows 0.93 tokens per second for the engine’s PowerPC-only version. The results apply to this model and setup, not to larger models or other hardware.

The speed comes from distributing matrix operations across all six SPUs and tailoring data movement and arithmetic to the Cell processor. The engine uses a big-endian, four-bit weight format, integer vector operations, aligned DMA transfers, fused neural-network operations, and an eight-bit key-value cache. It also uses SIMD on the PowerPC for normalization and positional encoding. The reported language-model output layer moves data at 17.36 GB/s, with nearly even workload distribution among the SPUs. The project includes benchmarking and profiling tools, interactive terminal chat, and a lightweight web server compatible with OpenAI-style chat requests. It offers a compact alternative to general-purpose inference software, but requires PS3 Linux, SPU development tools, and model conversion.

Read on github.com3 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.