Qwen3-0.6B, the smallest model in Alibaba’s Qwen3 family, decodes at about 103 tokens per second on a 48-core AMD EPYC 7642 when llama.cpp runs it on CPU alone. Alexey Fateev, who publishes as alesha-pro on GitHub, reports that his hand-written assembly engine, llm.asm, gets the same Q8_0 model to 122 to 126 tokens per second on that machine, and that booting it inside his own 24,252-byte operating system pushes it to about 135. His X post announcing the operating system on November 25, 2026 drew about 1.3 million views, mostly on the strength of one line: up to 54% faster than llama.cpp.
The chart at the top of this page puts his published numbers on one scale, along with a second experiment in which Claude Opus 5.5 and Gemini 4 Neon each wrote an inference engine for the same model directly in machine code. The sections below go through the thread-by-thread results, what the 54% compares, which design choices account for the gap, and what changes when the hardware is not a 256 MiB-cache server.
Qwen3-0.6B CPU benchmark: llm.asm vs llama.cpp by thread count
On the author’s AMD EPYC 7642, llm.asm decodes Qwen3-0.6B faster than llama.cpp at every thread count from 1 to 40, by 18% to 36% on Linux and by more inside its bare-metal OS. llama.cpp stops scaling at about 16 threads; the assembly builds stop a little higher.
All three runs use the same server (47 cores online, 256 MiB of L3 cache, DDR4, no GPU), the same 34-token prompt and 64 generated tokens, and an average of three runs. llama.cpp loads the standard 604.15 MiB Q8_0 GGUF with -ngl 0; llm.asm loads its own 613.66 MiB .asmbin export of the same 8-bit weights.
| Thr. | llama.cpp | llm.asm Linux | llm.asm OS |
|---|---|---|---|
| 1 | 16.63 | 20.70 | 23.67* |
| 4 | 51.08 | 69.24 | 78.89* |
| 8 | 80.79 | 103.64 | 118.08 |
| 16 | 103.03 | 121.86 | 134.94 |
| 24 | 104.11 | 123.72 | 132.90 |
| 32 | 103.82 | 122.51 | 133.75 |
| 40 | 105.08 | 125.86 | – |
Decode speed in tok/s for Qwen3-0.6B Q8_0, as published in the llm.asm README (November 2026). “llm.asm OS” is the bare-metal build, run as a KVM guest with one vCPU per thread, and has no 40-thread run; * marks peak rather than average values.
The curves also show where each engine stops scaling. All three climb steeply up to 8 threads and then flatten: llama.cpp near 104 tok/s, the Linux assembly build near 123 and the bare-metal build near 133. Past 16 threads, extra cores add at most a few percent for any of them on this machine.
When a 0.6B model is not enough. A model this size is what fits a CPU-only budget; tasks that need a larger hosted model usually mean juggling one API key per provider. A shared gateway such as PackyAPI is one option for calling several vendors' models through a single key; it has no bearing on the local CPU numbers in this article.
Disclosure: this page contains an affiliate link. If you sign up through it, we may earn a commission at no extra cost to you.
llm.asm 54% faster claim: kernel gain vs bare-metal gain
The “up to 54% faster” figure compares the bare-metal OS at 4 threads, 78.89 tok/s, with llama.cpp running on Linux at 4 threads, 51.08 tok/s. It stacks two separate gains: a faster decode kernel, which the Linux build already shows, and roughly 10% more from running without Linux underneath.
Split that way, the numbers are easier to judge:
- Kernel gain. The Linux build is a 14,712-byte static ELF that runs as an ordinary process. Against llama.cpp on the same OS it is 18% to 36% faster: +24.5% at 1 thread, +35.6% at 4, +28.3% at 8 and 18% to 20% from 16 threads up.
- OS gain. The bare-metal build compiles the same math, matmul, tokenizer and transformer files into a bootable kernel. The author credits its extra speed to mapping all memory with 2 MiB pages, so walking through the 614 MiB of weights never touches 4 KiB page tables.
- Peak vs mean. The 1- and 4-thread bare-metal figures in the comparison are peak values; the averages are 23.46 and 78.17 tok/s. At 4 threads the gap over llama.cpp is still 53%.
The same table holds a less quoted result. With FAST_Q8=0, which keeps activations in FP32 and matches a Python Q8_0 reference exactly, llm.asm runs at 7.18 tok/s on one thread against llama.cpp’s 16.63, and it trails llama.cpp at every thread count up to 40. Writing the engine in assembly did not make it fast by itself. The speedup arrives with the FAST_Q8=1 path described below.
Qwen3-0.6B architecture in assembly: what the 14 KB engine implements
The engine implements the full Qwen3-0.6B forward pass: 28 transformer layers with grouped-query attention (16 query heads sharing 8 key-value heads), QK-Norm, rotary position embeddings and SwiGLU feed-forward blocks, plus the BPE tokenizer and Qwen3 chat template. The official model card lists 0.6 billion parameters, 0.44 billion of them outside the embeddings.
Everything a runtime library would normally supply is written by hand in NASM: expf and sincosf, RMSNorm, softmax and SiLU, the AVX2 matrix-vector kernels, a thread pool built on raw clone() and futex() system calls, and a multi-turn chat mode that keeps the KV cache between turns. The weights are not inside the 14 KB; they live in the separate 614 MiB .asmbin file that a one-time Python script exports from the Hugging Face checkpoint. Even the rotary-embedding frequencies are computed in hand-written FP64 code, the same rotation covered in our comparison of full, partial and no RoPE.
The bare-metal build wraps 4,167 lines of operating system code around that core. It boots through Multiboot, switches the CPU into 64-bit long mode, reads the ACPI tables to find every core, wakes them with INIT-SIPI-SIPI interrupts and hands each one a slice of every matrix multiply and attention step. Input and output go through the VGA text screen, a PS/2 keyboard and the serial port. The author measures 74 to 94 ms from boot to the chat prompt under KVM.
How llm.asm runs Qwen3-0.6B faster: INT8 kernels, FP16 scales and huge pages
llm.asm runs Qwen3-0.6B faster than llama.cpp by doing the decode math in 8-bit integers end to end and by cutting the memory traffic around each matrix-vector product. The README attributes the FAST_Q8=1 gain to five changes:
- INT8 × INT8 dot products. Activations are quantized to 8 bits so each multiply runs through the AVX2
vpmaddubswandvpmaddwdinstructions against the Q8_0 weights, instead of converting weights to FP32 first. - FP16 block scales. The v2 weight format stores each block’s scale as FP16 and expands it with the F16C
vcvtph2psinstruction, trimming the file from 649 MiB to 614 MiB. - Next-row prefetch. Each kernel requests the next weight row before it needs it, walking memory in one direction.
- Head-major KV cache. Keys and values for each attention head sit contiguously, so attention reads them in one sweep.
- Parallel GQA attention. Attention is split across threads, as the matrix products are.
In decoding, each new token has to read essentially every weight once, so a 0.6B model at 8 bits moves close to its whole 614 MiB weight file from memory for every token. That is why all three curves flatten past 16 threads: more cores cannot fetch weights faster than DDR4 delivers them, and the engines that waste less work per byte reach a higher ceiling. This reading of the plateau is ours; the author does not publish a memory-bandwidth profile. GPU inference engines chase the same per-token overhead with different tools, as in Together AI’s move from megakernels to CUDA Graphs.
Accuracy is the price of the INT8 path, and the author measures it. The FAST_Q8=1 build matches a PyTorch FP32 run of Qwen3-0.6B with a cosine similarity of 0.99965 and reproduces all 64 greedy tokens of the test output, and its results are identical bit for bit from 1 to 40 threads. A single 64-token greedy comparison is enough to show the kernels compute the right thing; it says little about output quality over long generations.
Claude Opus 5.5 vs Gemini 4 Neon: machine-code engines for Qwen3-0.6B
Gemini 4 Neon’s engine is the fastest in the whole comparison, at up to 188.35 tok/s on 32 threads, 81.4% ahead of llama.cpp; Claude Opus 5.5’s is the smallest, at 7,331 bytes, and finished first. A day after the OS post, Fateev gave both models the same job in separate sandboxes: write a Linux inference engine for Qwen3-0.6B Q8_0 as raw hexadecimal machine code, with no compiler, assembler or linker, match the reference greedy output token for token, and beat llama.cpp on the same EPYC 7642. Both engines passed all 16 accuracy checks (4 prompts at 1, 4, 8 and 16 threads) and both beat llama.cpp at every thread count.
| Threads | llama.cpp | Opus 5.5 | Gemini 4 Neon |
|---|---|---|---|
| 1 | 16.63 | 21.44 | 22.27 |
| 8 | 80.79 | 100.17 | 124.11 |
| 16 | 103.03 | 123.50 | 171.05 |
| 32 | 103.82 | 125.13 | 188.35 |
| 40 | 105.08 | 116.05 | 181.04 |
Decode tok/s, mean of 3 runs, from the machine-code-llm-battle README. The 4- and 24-thread rows are omitted here.
| Claude Opus 5.5 (xhigh, Claude Code) | Gemini 4 Neon (xhigh, Antigravity) | |
|---|---|---|
| Binary size | 7,331 bytes | 10,752 bytes |
| Time to finish | about 65 minutes | 1 hour 43 minutes |
| Turns | 175 | 90 |
| API cost at list price | $21.40 | $16.72 |
Opus took the conventional route: FP32 activations against the 8-bit weights, a matrix-vector kernel that handles four rows at a time, software prefetch, weights copied into a transparent-huge-page buffer, and threads pinned per core complex. Its engine beats llama.cpp by 10.4% to 28.9%, numbers close to the human-written Linux build.
Neon’s engine went further on two fronts. Its first try with INT8 activations got one token wrong where the top two candidates differed by a logit gap of 0.0005, so it switched to 16-bit activations per 32-value block. It also exploited the EPYC 7642’s 256 MiB L3 cache: it keeps 15 of the 28 layers, 239 MiB of weights, resident in cache and streams the rest past it with non-temporal prefetches. Serving almost 40% of the weights from cache is the most plausible reason it keeps scaling past the 16-thread ceiling the other engines hit, and it ties the result to this chip. For how the two models compare on ordinary agentic work, see our Gemini 4 Neon benchmarks and the Claude Opus 5.5 cost-per-task breakdown.
Running Qwen3-0.6B on your own CPU: what carries over
On a different CPU, expect a smaller and less predictable gap than the EPYC numbers. Every figure above comes from one server with an unusually large 256 MiB L3 cache, measured by the person who wrote the engines, and the battle README states that both machine-code engines pin threads for that chip’s layout. Neon’s cache trick cannot work the same way on a desktop chip whose L3 is far smaller than the 239 MiB it pinned.
The author’s second machine shows the scale of the change. On a 2014 12-core Intel Xeon E5-2670 v3 running as a diskless Proxmox VM, the bare-metal OS decodes at 53.66 to 55.43 tok/s and prefills at about 87 tok/s, per the README. His X post quoted 78 tok/s decode and 111.5 tok/s prefill for the same VM; the README’s measured table shows the lower numbers above. No llama.cpp baseline was published for the Xeon, so its speedup is unknown.

The bare-metal OS on a diskless Proxmox VE VM (Intel Xeon E5-2670 v3, 12 cores, 2 GiB RAM). Screenshot from the llm.asm repository.
Three more conditions shape what you would see:
- Decode only. The comparison covers token generation. For the prompt, llama.cpp processes all tokens in one batched matrix multiply while llm.asm runs them one at a time, so the README does not claim a prefill win.
- Short context. The bare-metal OS defaults to a 2,048-token KV cache and resets the conversation when it fills; the model itself supports 32,768 tokens.
- Unstated baseline details. The README gives llama.cpp’s model file and
-ngl 0setting but not its version, build flags or thread affinity, all of which move CPU results.
If you run small local models through GGUF files, the usual path still applies: a Q8_0 or smaller quant in llama.cpp or a wrapper such as Ollama, as in our Inkling 2 Mini Ollama setup and Hy4 Flash GGUF guide. llm.asm reads only its own .asmbin format, needs AVX2, FMA and F16C, and its inference engine is written for Qwen3-0.6B alone. It is closer to a proof of how much headroom sits above a general-purpose runtime than a drop-in replacement. Small Qwen3 models also show up as draft models for speculative decoding, where raw decode speed of the small model matters directly; our draft-model calibration article covers that pairing.
How to reproduce the llm.asm Qwen3-0.6B benchmark
To reproduce the benchmark you need an x86-64 Linux machine with AVX2, FMA and F16C (Intel Haswell, AMD Excavator or newer), nasm and GNU binutils, and Python with NumPy for the one-time weight export. The steps below follow the repository README.
- Clone the repository and download the Qwen/Qwen3-0.6B checkpoint from Hugging Face into
models/qwen3-0.6b-bf16. - Export the weights to the v2 format:
python3 scripts/export_weights.py --model-dir models/qwen3-0.6b-bf16 --out models/qwen3-0.6b-q8_0.asmbin --scale-dtype fp16. - Build the Linux engine with
make inference FAST_Q8=1, then run./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin -p "Explain how a CPU cache works in 3 concise sentences." -n 128 -t 16. Add--chatfor a multi-turn session. - For the bare-metal OS, run
make os FAST_Q8=1and boot it under QEMU with KVM:qemu-system-x86_64 -enable-kvm -cpu host -m 2G -smp 16 -kernel build/asm-llm-os.elf -initrd models/qwen3-0.6b-q8_0.asmbin -nographic. Type/benchat theasm-llm>prompt for the built-in benchmark. - Run llama.cpp’s
llama-benchwith the Q8_0 GGUF and-ngl 0on the same machine and thread counts, so both numbers share hardware and settings.

Boot screen under QEMU KVM on the EPYC 7642 with 16 cores. It was taken with the legacy v1 weight file (649 MiB) and shows 81.31 tok/s decode, below the 134.94 tok/s the benchmark table lists for the v2 format at 16 vCPUs. Screenshot from the llm.asm repository.
The ISO builder (make os-iso) packs the kernel, GRUB and model into one bootable image for BIOS or UEFI. On Proxmox, the README sets --cpu host so the guest sees AVX2 and FMA, and --balloon 0 so the 2 GiB of RAM stays contiguous for the 649 MiB model and the 449 MiB KV-cache and scratch arena.
References
- Alexey Fateev (alesha-pro), llm.asm README, MIT license, commit 48feccb, November 2026: benchmark table, architecture and verification.
- Alexey Fateev, 02-baremetal-os README, November 2026: KVM scaling, Proxmox results and boot steps.
- Alexey Fateev, machine-code-llm-battle README, November 2026: Claude Opus 5.5 vs Gemini 4 Neon engines.
- Alexey Fateev, X post announcing the bare-metal OS, November 25, 2026.
- Qwen team, Qwen/Qwen3-0.6B model card, Hugging Face.