What this is about
Our language model engine was built for a desktop graphics card. A phone is a very different machine. It has a different kind of processor, a small battery, little spare memory and no fan. We tried to run our Mojo code on two phones to find out what breaks and what holds.
This article explains why a phone is a worthwhile test, what we checked, and what the results do and do not show. We keep the claims narrow on purpose.
Why it matters
Many people own a phone and no gaming PC. If language models are to run locally for them, the code has to work on that chip. There is also a lesson for any program: code that works on one machine has not been proven on another.
A phone is also a stress test. Memory is tight, heat limits speed, and the processor design is not the one in a desktop. If a check passes there, the check is meaningful. If it fails, we learn something we could not learn on one desktop.
What we hoped to learn
Three questions sit behind the checks.
- Same numbers? If our kernels, written in Mojo, do the same arithmetic as llama.cpp, a widely used engine, does the phone give the same answer to the bit? Answers that match exactly are easier to trust than answers that are merely close.
- Steady speed? A phone that is fast on average but stalls now and then is a poor experience. We wanted to see the worst runs, not only the middle.
- Does it fit? One of our two phones has only about 2.5 GB of free memory, so it is our tight case. The other has more room.
We used two phones on purpose. A single phone can pass a test by luck or by its own habits. Two phones that disagree show what one would hide.
How we checked it
The check had three layers, and each layer could fail on its own.
- A Q4_0 matrix multiplication, taken from a library for ARM processors, was compared byte for byte with llama.cpp's own matrix multiply, on both phones.
- The same kernel, ported by hand into Mojo, was compared byte for byte with that library's version.
- The full engine, built from the ported kernels, was compared with llama.cpp on the tokens it picks when it always takes the most likely next word. This is called greedy decoding. The model was Qwen2.5-0.5B, a small model, in Q4_0.
All three layers passed on both phones, with bit-exact tokens. That is the full extent of the claim. It does not say the engine is fast, that it works on other models, or that an app uses it.
What the first results showed
A one-bit kernel with a bigger bit count. A weight format called IQ1_S is described as using 1.56 bits per weight on average. We measured the real packed tensors of the model we used, and they cost 2.31 bits per weight. The kernel was correct, byte for byte, and 2.1 to 3.6 times faster per matrix multiply than the reference path on these phones. The bit count is a different matter. The format's number describes a typical distribution, and a real model is one sample from it.
One phone steady, one not. Before the runs we froze a rule: every one of 20 runs must stay above 0.7 of that run set's own median. The Xiaomi passed with no stalls. Its prefill speed was 1.142 times llama.cpp and its decode speed was 1.066 times. The OnePlus was faster: prefill 2.16 times and decode 1.58 times. But three of its 20 runs fell below the line, and the spread was as wide as 59 percent on one measurement and 32 percent on another. We do not yet know why. Our notes suspect that processor cores go to sleep between parallel regions, and another lane of work owns that question.
That is why a median alone is not a pass. A phone that is faster on average and unsteady has a speed result and an open bug. We report them together.
What one phone cannot tell you
The Xiaomi passing says nothing about the OnePlus. The same code and the same gate gave different results on the two. That is the whole reason for using two phones.
What we would tell a beginner
If you want to try your own code on a second device, borrow the habits that served us here.
- Pick a reference you trust, and compare your output with it on the new device, not only on the old one.
- Decide your pass rule before you run. Ours, "every run above 0.7 of the median", was frozen first, so we could not bend it afterward.
- Report a failed gate in the same article as the speed-up. A fast result with an open bug is still an open bug.
Words you may not know
- Bit-exact: identical in every stored one and zero.
- Greedy decoding: always picking the single most likely next word.
- Quantized (Q4_0): stored with fewer bits per number, to save memory.
- Prefill: reading the prompt before the model starts to answer.
- Decode: producing the answer, one token at a time.
- Median: the middle value of a list of results.
Try it
- Read the corewait project page, which covers profiling on phones.
- Think of a program you wrote on one machine. List two things on another machine that might break it.
- In the next article, we explain the two kinds of processor behind all of this.
Read next
- A phone GPU with no counters shows how we measured a phone when it hid its own instruments.

Comments
No comments yet.
Log in to comment.