{"slug": "someone-recodes-their-inference-into-assembly-language", "title": "Someone recodes their inference into assembly language", "summary": "Alexey Fateev reported on X that he built a 24,252-byte pure x86-64 assembly Multiboot OS, asm-llm-os.elf, that runs Qwen3-0.6B up to 54% faster than native Linux llama.cpp, booting in 74 to 94 ms straight into 64-bit Long Mode and serving multi-turn KV-cache chat over VGA, PS/2 keyboard and serial. On a diskless Proxmox VM with a 12-core Intel Xeon E5-2670 v3 and 2 GiB RAM, the system boots to the prompt in under 5 seconds (95 ms kernel boot) and decodes at 78 tok/s with up to 111.5 tok/s prefill, mapping the 614 MiB Q8_0 weights directly from physical RAM. A separate 14.7 KB Linux ELF build (FAST_Q8=1 INT8xINT8 AVX2+F16C) beats llama.cpp by 18% to 36% from 1 to 40 threads, and 2 MiB huge pages add another 10% on bare metal.", "body_md": "This is cool.\n\nFrom [X.com](http://X.com) [Alexey Fateev on X: \"I deleted Linux completely, baked Qwen3-0.6B into a 24 KB pure x86-64 assembly OS, and it runs up to 54% faster than native Linux llama.cpp. The entire Multiboot OS binary (asm-llm-os.elf) is 24,252 bytes, written from scratch without Linux, Windows, C, Rust, or libc. It boots… / X](https://x.com/superalesha/status/2125682626056839259)\n\nI deleted Linux completely, baked Qwen3-0.6B into a 24 KB pure x86-64 assembly OS, and it runs up to 54% faster than native Linux llama.cpp. The entire Multiboot OS binary (asm-llm-os.elf) is 24,252 bytes, written from scratch without Linux, Windows, C, Rust, or libc. It boots in 74 to 94 ms straight into 64-bit Long Mode, wakes every CPU core over APIC, maps the 614 MiB Q8_0 weights directly from physical RAM, and drops you into a live multi-turn KV-cache chat over VGA, PS/2 keyboard, and serial. I ran head-to-head CPU benchmarks against llama.cpp (Q8_0, -ngl 0) on the same AMD EPYC 7642:\n\nOn a diskless 0 GB Proxmox VM (2014 12-core Intel Xeon E5-2670 v3, 2 GiB RAM), it boots straight to the prompt in under 5 seconds (95 ms kernel boot) and runs live out of RAM at 78 tok/s decode and up to 111.5 tok/s prefill, with a hybrid BIOS+UEFI ISO builder included too. Output stays bit-exact across thread counts and matches all 64 greedy tokens against PyTorch FP32 (0.99965 cosine). The 14.7 KB Linux ELF build (FAST_Q8=1 INT8xINT8 AVX2+F16C) also beats llama.cpp by 18% to 36% from 1 to 40 threads, and booting bare metal with 2 MiB huge pages squeezes out another 10% on top. Repo, ISO builder, and Proxmox setup guide are in the reply below.", "url": "https://wpnews.pro/news/someone-recodes-their-inference-into-assembly-language", "canonical_source": "https://forum.level1techs.com/t/someone-recodes-their-inference-into-assembly-language/261163#post_1", "published_at": "2026-11-26 02:17:32+00:00", "updated_at": "2026-11-26 02:44:24.936639+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "ai-research", "developer-tools"], "entities": ["Alexey Fateev", "Qwen3-0.6B", "llama.cpp", "AMD EPYC 7642", "Intel Xeon E5-2670 v3", "Proxmox", "PyTorch", "asm-llm-os.elf"], "also_reported_by": [], "takeaway": "A hand-written x86-64 assembly runtime with INT8xINT8 AVX2+F16C kernels beat llama.cpp by 18% to 36% across 1 to 40 threads on Qwen3-0.6B Q8_0, and 2 MiB huge pages added another 10% on bare metal.", "recommendation": {"advice": "Build INT8xINT8 AVX2+F16C kernels and enable 2 MiB huge pages when serving small Q8_0 models on CPU; the source measured 18-36% over llama.cpp plus 10% from huge pages.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/someone-recodes-their-inference-into-assembly-language", "markdown": "https://wpnews.pro/news/someone-recodes-their-inference-into-assembly-language.md", "text": "https://wpnews.pro/news/someone-recodes-their-inference-into-assembly-language.txt", "jsonld": "https://wpnews.pro/news/someone-recodes-their-inference-into-assembly-language.jsonld"}}