---
type: "post"
id: "llm-asm-runs-qwen3-35-faster-than-llama-3e11e8"
slug: "llm-asm-runs-qwen3-35-faster-than-llama-3e11e8"
title: "llm.asm Runs Qwen3 35% Faster Than llama.cpp in Pure Assembly"
description: "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)."
retrieval_nugget: "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)."
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: "llm.asm adds a pure x86-64 assembly Qwen3-0.6B inference implementation, reported to run 35% faster than llama.cpp."
prior_refs: ["https://newruntime.com/posts/qwen3-5-assembly-qwen3-5-0-8b-cpu-01f599/"]
source_url: "https://github.com/alesha-pro/llm.asm"
source_urls: ["https://github.com/alesha-pro/llm.asm"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:llm-asm-runs-qwen3-35-faster-than-llama-3e11e8"
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/llm-asm-runs-qwen3-35-faster-than-llama-3e11e8/","markdown":"https://newruntime.com/posts/llm-asm-runs-qwen3-35-faster-than-llama-3e11e8.md","json":"https://newruntime.com/posts/llm-asm-runs-qwen3-35-faster-than-llama-3e11e8.json"}
markdown_url: "https://newruntime.com/posts/llm-asm-runs-qwen3-35-faster-than-llama-3e11e8.md"
---

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

## Retrieval answer

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).

## Summary

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](https://github.com/alesha-pro/llm.asm)).

## 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](https://newruntime.com/posts/qwen3-5-assembly-qwen3-5-0-8b-cpu-01f599/)).

## 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:

```sh
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.

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)
