hn.today

54% faster LLM token generation by removing the Linux OS and llama.cpp

twitter.com16 points5 comments
Screenshot of 54% faster LLM token generation by removing the Linux OS and llama.cpp

The project replaces a conventional operating system and inference framework with a tiny x86-64 assembly program that boots directly into a chat interface for Qwen3-0.6B. Its 24,252-byte Multiboot executable reportedly starts in 74-94 milliseconds, initializes CPU cores, accesses the model’s 614 MiB of Q8_0 weights in physical memory, and supports multi-turn conversation using a KV cache. Users interact through VGA text display and a PS/2 keyboard, with serial output also available. The accompanying setup supports BIOS and UEFI boot, including a diskless Proxmox virtual machine.

On an AMD EPYC 7642, the assembly implementation reportedly generated tokens 42% faster than llama.cpp with one thread, 54% faster with four, 46% faster with eight, and 31% faster with sixteen; the best listed result was 136.6 tokens per second. In a virtual machine with an older Xeon and 2 GiB of RAM, it reached 78 tokens per second decoding and 111.5 during prompt processing. The author says outputs are identical across thread counts and that all 64 greedy tokens matched a PyTorch FP32 comparison, with 0.99965 cosine similarity. A separate small Linux executable also reportedly outperformed llama.cpp by 18-36%, while bare-metal operation with 2 MiB huge pages added about 10% more speed. The code and build instructions are available under an MIT license.

Read on twitter.com5 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 AI

The daily digest

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