Developer releases assembly AI toolkit, claiming up to 35.6% faster CPU decoding
llm.asm includes a Linux runtime, a bootable chat system and a GPT trainer. Its tiny executables still need separate model weights.
Loading page…
llm.asm includes a Linux runtime, a bootable chat system and a GPT trainer. Its tiny executables still need separate model weights.
Listen to this story
Alexey Fateev’s MIT-licensed llm.asm offers a way to run and train language models using hand-written x86-64 assembly, including a Linux runtime that does not require replacing an existing operating system. The project reports that an optimized four-thread Linux build decodes Qwen3-0.6B 35.6% faster than llama.cpp on one AMD EPYC 7642 system. Its larger bare-metal speed claim comes from a separate virtualized setup, and the Linux test measures generation rather than prompt processing—so the results are promising but specific to these configurations.
The Linux comparison used Qwen3-0.6B in Q8_0 format, a 34-token prompt and 64 generated tokens, averaging three runs.
The project reports matching all 64 tested greedy-choice tokens against PyTorch FP32, but this check does not establish broader model accuracy.
The bootable system reportedly starts in 74–94 milliseconds; its 54% speed advantage was measured under KVM against native Linux llama.cpp.
Developer Alexey Fateev has shared llm.asm, an MIT-licensed project for running and training language models in hand-written assembly code. For developers running Qwen3-0.6B on CPUs, the project claims its Linux runtime generates text 18%–36% faster than llama.cpp on one AMD EPYC 7642 system.
Fateev publicly described the bootable version on November 25, saying he had removed Linux and built a system that starts directly into Qwen3 chat. Tom’s Hardware covered the release on November 28. The repository also provides a Linux-hosted inference program, so trying the assembly implementation does not require replacing an operating system.
The CPU decoding test measures answer generation after prompt processing. It uses Qwen3-0.6B in the Q8_0 reduced-precision format, with GPU computation disabled for llama.cpp. Each measurement averages three runs using a 34-token prompt and 64 generated tokens—the pieces of text a model processes and produces.
The faster Linux build uses eight-bit integer calculations, CPU vector instructions and a memory layout designed for this model. It divides attention calculations across threads and prefetches upcoming weight data. The alternative build, using full-precision intermediate values, trails llama.cpp at every listed thread count. The speed claim therefore belongs to a particular optimized path, not assembly language alone.
Prompt processing is separate: llama.cpp processes the benchmark prompt in a batch, while llm.asm handles it token by token. The decoding advantage does not establish an equivalent long-input processing gain. For output checking, the project reports matching all 64 tested greedy-choice tokens against PyTorch FP32 and identical results across thread counts.
The bootable version reuses the core model calculations and tokenizer, replacing Linux services with its own memory, processor and input/output code. It offers multi-turn chat through VGA, PS/2 keyboard and serial interfaces. The project reports a 74–94 millisecond boot for its 24,252-byte system binary.
That version produces the larger, roughly 54% gain: 78.89 tokens per second at four virtual CPUs under KVM, versus 51.08 for native Linux llama.cpp. It is a different execution configuration, not independent verification of the Linux assembly benchmark.
Neither tiny executable contains the model. The Linux binary is 14,712 bytes; its exported Qwen weights occupy a separate 613.66 MiB file. The project also includes a 32,944-byte Mini-GPT trainer with a hand-written backward pass, AdamW optimizer and live terminal loss display.
Building requires NASM and GNU binutils, plus an x86-64 CPU supporting AVX2, FMA and F16C instructions. The Linux programs need no shared runtime libraries, though preparing Qwen’s model file uses Python. After building the runtime and exporting the weights, open chat with:
./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin --chat -t 16For the bootable route, Fateev supplies an ISO builder and QEMU/KVM and Proxmox setup instructions. Users can test that configuration in a virtual machine rather than erase their existing Linux installation.
Loading discussion...
Join the conversation
Explain when speed would outweigh flexibility for you.
Be the first to share a perspective or an experience.
Reader comments
Newest comments first. Replies stay oldest first.