ResearchBrief

Developer removed Linux and sped up AI model by 54%, most of the gain is also on Linux

Alexey Fateev’s llm.asm kernel, written entirely in assembly, ran a small language model 54% faster than llama.cpp. According to TechRadar, about two-thirds of the gain is still achieved with Linux running.

Close-up of a computer processor chip on circuit board
Photo: He Junhui / Unsplash · Illustrative image

Developer Alexey Fateev ran Alibaba’s Qwen3-0.6B model on an x86-64 kernel written solely in NASM assembly and released under the MIT license, as part of the llm.asm project he announced on X on November 25, 2026. The kernel was 24,252 bytes in its first version; the model weights were roughly 614 MiB.

Tests were run on a 48-core AMD EPYC 7642 processor using four threads. The kernel generated 78.89 tokens per second, while llama.cpp averaged 51.08. The 54% gap is between the kernel’s best result and the average of llama.cpp’s three runs. When the same inference engine ran as a normal Linux program, it reached 69.24 tokens/sec, meaning about two-thirds of the gain was seen even with Linux running. Removing Linux contributed between 7% and 14%, depending on thread count.

Fateev attributes most of the bare-metal gain to 2 MiB memory pages. Linux supports these as well, but llama.cpp was not tested with that setting. The kernel was also measured inside a virtual machine (QEMU/KVM), not on real hardware.

On prompt processing, however, llm.asm trails behind: on a 34-token prompt it managed 26.7 to 160.8 tokens/sec, while llama.cpp reached 56 to 1,113 tokens/sec.

Source

This article was compiled with AI assistance from the source above and translated from our Turkish edition.
How we make our stories Spotted an error? Let us know.