---
type: "post"
id: "a-14-kb-linux-elf-runs-qwen3-0-ea8914"
slug: "a-14-kb-linux-elf-runs-qwen3-0-ea8914"
title: "A 14 KB Linux ELF runs Qwen3-0.6B 18 to 36 percent faster than llama.cpp CPU inference."
description: "llm.asm is a Qwen3-0.6B inference engine written in x86-64 NASM assembly for Linux (github.com)."
retrieval_nugget: "llm.asm is a Qwen3-0.6B inference engine written in x86-64 NASM assembly for Linux (github.com). Its authors report decoding 18–36% faster than llama.cpp across tested thread counts on an AMD EPYC 7642, using CPU-only inference, greedy decoding and a three-run mean."
published_at: "2026-11-26"
updated_at: "2026-11-26"
record_date: "2026-11-26"
date_kind: "published_at"
topics: ["inference"]
entities: ["llm.asm","Qwen3-0.6B","llama.cpp"]
related_patterns: []
novelty_label: "new_fact"
what_changed: "A separate x86-64 assembly inference engine for Qwen3-0.6B is reported to run 18–36% faster than llama.cpp in CPU tests."
prior_refs: ["https://newruntime.com/posts/qwen3-5-assembly-qwen3-5-0-8b-cpu-01f599/"]
source_url: "https://github.com/alesha-pro/llm.asm/blob/main/01-qwen3-inference"
source_urls: ["https://github.com/alesha-pro/llm.asm/blob/main/01-qwen3-inference"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:a-14-kb-linux-elf-runs-qwen3-0-ea8914"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/a-14-kb-linux-elf-runs-qwen3-0-ea8914/","markdown":"https://newruntime.com/posts/a-14-kb-linux-elf-runs-qwen3-0-ea8914.md","json":"https://newruntime.com/posts/a-14-kb-linux-elf-runs-qwen3-0-ea8914.json"}
markdown_url: "https://newruntime.com/posts/a-14-kb-linux-elf-runs-qwen3-0-ea8914.md"
challenged_patterns: ["hardware-adoption-is-routed-through-familiar-ai-software-stacks"]
---

# A 14 KB Linux ELF runs Qwen3-0.6B 18 to 36 percent faster than llama.cpp CPU inference.

## Retrieval answer

llm.asm is a Qwen3-0.6B inference engine written in x86-64 NASM assembly for Linux (github.com). Its authors report decoding 18–36% faster than llama.cpp across tested thread counts on an AMD EPYC 7642, using CPU-only inference, greedy decoding and a three-run mean.

## Summary

llm.asm is a Qwen3-0.6B inference engine written in x86-64 NASM assembly for Linux ([github.com](https://github.com/alesha-pro/llm.asm/blob/main/01-qwen3-inference)). Its authors report decoding 18–36% faster than llama.cpp across tested thread counts on an AMD EPYC 7642, using CPU-only inference, greedy decoding and a three-run mean.

## What happened

The default `FAST_Q8=1` build is a stripped, statically linked ELF executable of 14,712 bytes, with no runtime dependency on gcc, libc, libm, a dynamic linker or shared objects. It needs Linux on x86-64 with AVX2, FMA and F16C; AVX-512 and VNNI are not required. Building requires NASM and binutils.

Before inference, download Qwen3-0.6B weights and tokenizer files, then use Python to export an `.asmbin` file. The default Q8_0 export with FP16 scales occupies 613.66 MiB. The fast path quantizes activations to Q8_0 once per matrix multiplication and uses an INT8-by-INT8 AVX2 kernel. The tokenizer accepts UTF-8, including Cyrillic; `--chat` starts multi-turn chat with KV-cache retention, and `--think` enables Qwen3 reasoning mode. The legacy `FAST_Q8=0` build uses Q8_0 weights with FP32 activations and produces a slightly smaller 14,008-byte executable.

The decode test used a single 34-token prompt and fixed generation of 64 tokens. At 16 threads, the project reports 121.86 tok/s for `FAST_Q8=1` versus 103.03 ± 0.09 tok/s for llama.cpp; its peak on the tested EPYC was 126.8 tok/s. In a single-prompt verification against PyTorch FP32, both generated the same 64 greedy tokens despite differing logits.

## What the archive adds

This follows earlier coverage of Qwen3.5-0.8B CPU inference implemented entirely in x86-64 assembly, which reported 6.51 tok/s on one EPYC thread ([earlier New Runtime note](https://newruntime.com/posts/qwen3-5-assembly-qwen3-5-0-8b-cpu-01f599/)). The models and tests differ, so the figures are not a direct performance comparison.

## Why it matters

Treat the tiny executable as a compact runtime, not a tiny deployment: you still need supported x86-64 CPU features and a separately prepared weight file hundreds of MiB in size.

## Limits and uncertainty

The speed figures are the project’s own results for a three-run, CPU-only greedy decode test on one EPYC model, with one prompt and fixed output length. The project notes that llama.cpp uses batched GEMM for prefill while asm-llm processes prefill token by token with GEMV, so the decode comparison does not establish prefill performance. The matching-token check covers one prompt and does not establish general numerical parity or model quality.

## Skill to build now

From the repository root, the documented fast-path build and test sequence is `make inference test-math FAST_Q8=1`, then `make check`. First install NASM and binutils, and prepare the `.asmbin` weights as described in the guide.

## Reader takeaway

llm.asm is worth trying if you want a small, statically linked Linux runtime for Qwen3-0.6B on AVX2-class x86-64 hardware. The headline speedup is the project’s result for a specific decode workload, not evidence of a general win across prompts, prefill, models or hardware; model weights remain a separate 613.66 MiB artifact.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Inference](https://newruntime.com/topics/inference.md): Explore the inference topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
