Field noteNov 26, 20263 min read1 source

llm.asm Runs Qwen3 35% Faster Than llama.cpp in Pure Assembly

The llm.asm repository bundles three x86-64 NASM projects, including a Qwen3-0.6B inference engine, and reports its default decode path running 18%–36% faster than llama.cpp CPU across 1–40 threads in a Q8_0 benchmark (github.com).

In one minute

The llm.asm repository bundles three x86-64 NASM projects, including a Qwen3-0.6B inference engine, and reports its default decode path running 18%–36% faster than llama.cpp CPU across 1–40 threads in a Q80 benchmark (github.com).

What changed: llm.asm adds a pure x86-64 assembly Qwen3-0.6B inference implementation, reported to run 35% faster than llama.cpp.

What happened

The repository says its projects have no runtime-library dependencies; the default Linux inference binary is a 14,712-byte static ELF. The engine runs Qwen3-0.6B in Q8_0, with a BPE tokenizer and multi-turn chat using KV caching. Its default FAST_Q8=1 path uses INT8xINT8 AVX2 and parallel GQA; FAST_Q8=0 uses exact FP32 activations. It requires a Linux x86-64 kernel and a CPU supporting AVX2, FMA and F16C; building requires NASM and GNU binutils. Optional offline weight export also needs Python 3 and NumPy. The MIT-licensed repository also includes a bootable 24,252-byte bare-metal OS for Qwen3-0.6B that needs neither Linux nor Windows, and a Mini-GPT trainer that it says cut TinyShakespeare validation loss from 4.19 to 1.51 in four minutes.

At four threads, llm.asm reports 69.24 tok/s versus 51.08 tok/s for llama.cpp, a 35.6% decode advantage. The CPU-only benchmark ran on an AMD EPYC 7642 with 34 prompt tokens and 64 generated tokens, averaging three runs. The compared files were a 613.66 MiB llm.asm.asmbin v2 and a 604.15 MiB GGUF Q8_0 for llama.cpp. The repository also reports 0.99965 cosine similarity and 64/64 exact greedy tokens against PyTorch FP32. At 40 threads, it reports 125.86 tok/s average decode for llm.asm versus 105.08 tok/s for llama.cpp, with a 126.81 tok/s llm.asm peak.

What the archive adds

This follows a related assembly-inference thread: an earlier note covered Qwen3.5-0.8B CPU inference written entirely in x86-64 assembly, reporting 6.51 tok/s on one EPYC thread (earlier New Runtime note).

Why it matters

Treat the small executable as only one part of the experiment: the fast path still needs compatible CPU instructions and a separately exported Q8_0 model file.

Limits and uncertainty

The speed figures are self-reported by the project and come from a short, specific benchmark; the tested model files differ in format and size. They measure decode, not equivalent prompt processing: the repository says llama.cpp uses batched GEMM for prefill while llm.asm processes prefill token by token with GEMV.

Skill to build now

Export the weights, build the fast inference path, then start a 16-thread chat session using the README commands:

python3 scripts/export_weights.py --model-dir models/qwen3-0.6b-bf16 --out models/qwen3-0.6b-q8_0.asmbin --scale-dtype fp16
make inference FAST_Q8=1./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin --chat -t 16

Reader takeaway

llm.asm is worth a controlled trial if you have Linux x86-64 hardware with AVX2, FMA and F16C: the project reports 69.24 tok/s at four threads against llama.cpp’s 51.08 tok/s on its test. The result is a decode comparison under a specific setup, not a general performance guarantee; prefill behavior and model-file formats differ.

How this was made

Written by
New Runtime's AI newsroom, from the sources cited below.
Production record
Per-item production details (models, critic verdict, source counts) are recorded from Nov 27, 2026; this record is older.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1github.com/alesha-pro/llm.asm
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicInferenceExplore the inference topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract