Quantized Qwen3-0.6B weights occupy about 614 MiB. The bootable llm.asm kernel from Alexey Fateev occupies 24,252 bytes. The kernel file contains boot, device and inference code. The loader supplies the weights separately, and the running model needs memory for its KV cache and scratch space. The most informative baseline is the author’s own Linux assembly program. It shares the core operators with the bootable version, revealing how much of the decode gain was already present on Linux.

From loading the weights to producing a token

A Multiboot loader places the kernel and a separate model module in guest memory. The kernel enters 64-bit mode, establishes an identity mapping with 2 MiB pages and binds the model at its physical address, avoiding another copy of the weights. It reserves about 449 MiB for KV and scratch space. The local APIC wakes the other cores, which share quantized matrix multiplication and grouped-query attention work. A keyboard, VGA display and serial port provide the local chat interface.

Ready to accept input and ready to show an answer are two distinct points on the timeline. In a 16-vCPU KVM run on an AMD EPYC 7642, the kernel was ready at 84.88 ms. Prefilling 34 input tokens took 211.89 ms, and the first token appeared 312.87 ms after boot. For a short interaction, reading the prompt still accounts for a substantial part of the wait even after kernel startup falls below a tenth of a second.

Console listing 16 online cores, a 649 MiB model and a 449 MiB arena, with separate prefill, decode and boot timingsView original ↗

This separate run uses the 649 MiB weights. The console reports both kernel readiness at 84.89 ms and boot to first token at 304.80 ms.

Three runtimes separate two sources of speedup

The project compared CPU-only llama.cpp, a Linux assembly executable and the bootable assembly kernel under KVM on the same EPYC 7642. The workload used Qwen3-0.6B with Q8_0 weights, 34 prompt tokens and 64 generated tokens. These two thread counts from the project’s head-to-head table show decode speed in tokens per second.

Threads llama.cpp on CPU Linux assembly Bootable kernel under KVM
4 51.08 69.24 78.89
16 103.03 121.86 134.94

At four threads, the gain from 51.08 to 69.24 already appears on Linux. The assembly path uses INT8 dot products for weights and activations, converts block scales with F16C and lays out the KV cache contiguously by attention head. Moving to the bootable kernel takes the four-thread result from 69.24 to 78.89. The author attributes the additional gain to large pages reducing page-table walks. The port also changes inter-core synchronization, so this comparison measures the combined effect of the runtime changes.

Prefill and decode scale differently. In the separate Phase 2 scaling table, going from 16 to 24 vCPUs raises prefill from 160.46 to 190.67 tokens/s, while decode slips from 134.94 to 133.07 tokens/s. For this model and short input, the core count best suited to reading the prompt differs from the one best suited to producing tokens sequentially.

What persists across turns, and what the parity check covers

The kernel writes the assistant’s end-of-turn marker into the KV cache and retains the position reached so far. Only new tokens need prefill on the next turn. The default context is 2,048 tokens. If the occupied positions plus the incoming prompt and a 64-token reserve reach that limit, the console reports that the cache is full and resets it. A long conversation can therefore lose its earlier context even when every individual turn generates successfully.

The project checks five prompts against the Linux assembly path, comparing input tokens, generated tokens and output bytes. Cases include Russian UTF-8 text, arithmetic and thinking mode. The checks can catch changes in tokenization, parallel computation and output encoding introduced by the port. The performance tables measure local decoding for one conversation. They establish how fast an interactive model runs in this CPU guest, leaving queueing latency under concurrent use an open question. Phase 2 implementation and verification · Three-way CPU comparison