MadWeightsOpen weights research. The Raw Uncut.
TESTING ·

llm.asm against llama.cpp on one Xeon Gold 6132: 31% to 75% faster generation, 1.8 to 3.5 times slower prompt reading

llm.asm is an inference engine for Qwen3-0.6B written in x86-64 assembly. Its repository reports generation 18% to 36% faster than llama.cpp on an AMD EPYC 7642. We ran the same test on one socket of a Xeon Gold 6132. llm.asm generated 31% to 75% faster than llama.cpp 1.1.0, and its 64 tokens matched a full-precision PyTorch run exactly. llama.cpp read the prompt 1.8 to 3.5 times faster. Putting the weights on 2 MiB pages did not help either engine.

MODEL
Qwen3-0.6B
QUANTIZATION
Q8_0
HARDWARE
1 × Xeon Gold 6132 · 14 cores
ENGINES
llm.asm 677cd6c · llama.cpp 1.1.0
TEST
34 prompt tokens · 64 generated · greedy
+31% to +75%
generation speed over llama.cpp, 1 to 14 threads
64 of 64
generated tokens equal to a full-precision PyTorch run
1.8 to 3.5 times
llama.cpp's lead in prompt reading

The server was not idle during these runs. That limit applies to every figure below.

Setup

  • llm.asm: github.com/alesha-pro/llm.asm at commit 677cd6c, MIT licence, built with NASM 2.16.03. The binary is 15,064 bytes, as its README states.
  • llama.cpp: version 1.1.0, CPU only, in two builds. One uses the compiler's native target, which on this processor includes AVX-512. The other targets AVX2, FMA and F16C, the instruction sets llm.asm uses.
  • Model: Qwen3-0.6B. llm.asm reads its own Q8_0 file, exported by the repository's script from the official BF16 weights (613.66 MiB). llama.cpp reads the official Qwen3-0.6B-Q8_0.gguf (639,446,688 bytes).
  • Processor: Xeon Gold 6132, 14 cores, 2.6 GHz. We pinned threads to the physical cores of one socket and bound memory to the same socket.
  • We held both model files in a RAM disk, so storage plays no part.

Method

  • The test is the one in the llm.asm repository: its benchmark prompt is 34 tokens with the chat template, and we generated 64 tokens by greedy decoding.
  • For llama.cpp we ran llama-bench with a 34-token prompt test and a 64-token generation test, as the repository's table does.
  • We measured each engine and thread count 12 times in four rounds of three measurements, and we alternated the engines inside each round.
  • Figures are medians. The range is the lowest and highest of the 12.
  • The server's virtual machines and its GPU inference service kept running. The GPUs were idle at the start of every measurement. The one-minute load average before a measurement was between 3.7 and 7.9.

Results: generation

Tokens per second.

Threadsllama.cpp, native buildllama.cpp, AVX2 buildllm.asmllm.asm over the AVX2 build
113.8 (13.7 to 13.9)14.5 (14.3 to 14.7)19.0 (18.9 to 19.1)+30.8%
437.4 (37.0 to 37.7)39.9 (39.4 to 40.4)54.1 (34.3 to 62.9)+35.5%
855.6 (53.7 to 55.8)57.3 (55.5 to 58.8)88.9 (82.5 to 94.8)+55.1%
1456.9 (54.9 to 58.2)59.1 (58.2 to 61.2)103.2 (76.2 to 106.3)+74.7%

llama.cpp gained little from 8 to 14 threads. llm.asm kept gaining.

The AVX2 build of llama.cpp was 3% to 7% faster than the native build at every thread count, so it is the baseline for the comparison.

Results: reading the prompt

Tokens per second on the 34-token prompt, medians.

Threadsllama.cpp, native buildllama.cpp, AVX2 buildllm.asm
146.945.325.4
4173.8170.280.9
8324.1308.7119.2
14454.1402.4131.6

llm.asm reads a prompt one token at a time. llama.cpp reads it as a batch. The repository says the same about its own figures.

Where the speed comes from

llm.asm has two build modes. The default quantizes activations to 8 bits and multiplies 8-bit weights by 8-bit activations. The other keeps activations in 32-bit floats. At 8 threads the float mode generated 50.9 tokens per second in a single run, which is below llama.cpp. The gain is in the 8-bit kernel.

Both modes produced the same text on the test prompt.

Output against a full-precision run

We ran the official Qwen3-0.6B weights in PyTorch 2.14.1 at 32-bit precision on the same 34 prompt tokens, greedy, for 64 tokens.

  • llm.asm produced the same 64 tokens as the PyTorch run. So did PyTorch on a GPU at 32 bits.
  • llama.cpp's answer differs from the first token. Its first token was the reference's third choice, 0.94 below the top logit. Following llama.cpp's own text, 60 of its 64 tokens were the reference's top choice at that position.
  • We gave both engines identical prompt tokens. We checked the token lists.
  • PyTorch at BF16 on a GPU also left the 32-bit sequence, after 38 tokens.

This check used one prompt. We have not found out whether the difference comes from the GGUF file's quantization or from the engine.

2 MiB pages

The repository reports about 10% from 2 MiB pages in its bare-metal build. We tested the Linux build with the weights in a RAM disk backed by 2 MiB pages, and tested llama.cpp the same way. We ran a separate test with nine measurements per cell and report generation in tokens per second:

Threadsllm.asm, 4 KiB pagesllm.asm, 2 MiB pagesllama.cpp, 4 KiB pagesllama.cpp, 2 MiB pages
119.119.213.814.0
456.161.737.436.2
889.084.655.350.8
14102.389.055.852.1

The kernel reported 612 MiB mapped with 2 MiB pages during a run, so the run used the large pages. There was no gain at one thread, and both engines were slower at 8 and 14 threads. We have not found the cause of the slowdown. llama.cpp in this table is the native build.

Limits

  • The server was shared. Other work ran on the same socket during every measurement, which is the likely source of the wide ranges at 4 and 14 threads for llm.asm.
  • The test covered one model, one prompt length, and 64 generated tokens. Nothing here measures long prompts or long outputs.
  • The two engines read different Q8_0 files made by different exporters from the same weights.
  • llama-bench generates from an empty context. llm.asm generated after its 34-token prompt. At these lengths the difference in attention work is small, and it counts against llm.asm.
  • The output check is a single prompt.
  • The float-mode figure for llm.asm is a single run.
  • A run at 28 threads across both sockets was slower than 14 threads for both engines. Memory was bound to one socket, so we do not report it as a comparison.
  • llm.asm is a command-line program for one model family, with its own weight format and a 2,048-token default context. It has no server. These figures compare kernels. They do not show that it can replace llama.cpp.

Open questions

  • The same test on an idle machine.
  • Why 2 MiB pages slowed both engines at 8 and 14 threads.
  • Whether llama.cpp's different first token comes from the GGUF file or from its Q8_0 arithmetic.
  • How an 8-bit activation kernel would affect accuracy on a larger model and on more than one prompt.