A dirt farm road splitting in two directions between fields under a soft morning sky

The Fastest Local Kimi K3.1 Pro? M5U 512GB x 4 Part 4

Same weights, same four 512 GB M5 Ultras, same tests: faster on long prompts and eight users, close on short prompts, behind on file edits.

I ran my Kimi K3.1 Pro server head to head against a commercial Mac inference engine this week: the same original weights, the same four 512 GB M5 Ultra Mac Studios from Part 3, the same client tests. Mine read prompts of 93K tokens and up in 9 to 14% less time, moved about 11% more tokens with eight people at once, and stayed close on short prompts, without 8-bit activations. As far as I know, that makes it the fastest local Kimi K3.1 Pro setup out there on consumer hardware for long prompts and concurrent users to date. The other engine clearly wins at rewriting files, and that is what I am working on next.

The setup

Head to head

Both servers ran on the same machines, one at a time, within a few hours of each other. The test client sends identical prompts with a random tag at the front, so neither server can reuse a cached prefix, and it times everything from the client side.

Bar chart of seconds to first token for 74K and 147K token filler prompts and 93K and 119K token code prompts, for my server, the other engine in its default mode with 8-bit activations, and the other engine with them turned off
Cold reads, one request at a time.

The other engine reads prompts with 8-bit activations by default: it rounds the numbers passed between layers to 8 bits while reading. That is a reasonable speed trick, but it changes the output slightly, and I did not test its quality. Mine skips that, and a test prompt gives the same tokens from run to run. With its 8-bit prompt reading turned off, the other engine took about 1.6 to 1.7 times as long as mine to read a long prompt. In its default mode it ties mine at 74K and falls behind from there.

Seconds to first token, coldMineOther, defaultOther, 8-bit off
74K filler6869107
147K filler139153233
93K code87101146
119K code115129192
Horizontal bar chart of tokens per second for short prompts with one user, eight users in total, and editing a file with thinking off and on, for my server and the other engine
Writing speed, same prompts.

Writing speed on short prompts is within a few percent on average, with mine a little behind on the sysadmin and prose prompts. The other engine does start answering a short prompt sooner, in about half a second against my one second or so.

Tokens per secondMineOther, default
Short prompts, one user (average)35.737.0
Eight users, total7669
File edit, thinking off90191
File edit, thinking on72125

File edits are the clear loss. When most of the answer is a copy of the input with a few changes, the other engine wrote 1.7 to 2.1 times as fast. For that kind of answer my server uses prompt lookup: where the recent output matches the prompt, it proposes the next stretch of the prompt as a guess, and Kimi checks the whole guess in one step. Mine was limited by how many copied tokens it checks per step, 15. Letting it check up to 64 at a time raised edits with thinking off from 90 to 112 to 129 tok/s, and faster expert kernels for those wider checks took it to 146 to 169. Neither is in the server yet, because wider checks also change which token wins when two are nearly tied on other prompts, so they need the same quality check as everything else here. With thinking on, about half the time goes into thinking text that cannot be copied, so that case stays near 85 to 90 tok/s for now.

How it got here

Most of this round went into reading long prompts and serving several people at once, and most of the gains came in one long day of work just before the head to head. A cold 119K-token prompt of real code now starts answering in 115 seconds, down from 159 that morning, and eight people sending short prompts together wait under two seconds for a first token instead of more than four.

Bar chart of seconds to first token for cold 93K and 119K token prompts of open-source C++ code, earlier in the day, in the late afternoon and at the end of the day
Cold read of real code, one request.

Long prompts

Part 3 called cold prefill slow, and it was: a cold 128K read took about four and a half minutes. My long test prompts back then were also filler, one sentence repeated tens of thousands of times. That is fine for timing a read but too easy for anything else, so the long tests now use C++ source from llama.cpp, cut to 93K and 119K tokens. The 93K prompt went from about two minutes to 87 seconds over the day. After a read like that, Kimi writes at about 28 to 32 tok/s with thinking on.

A combine harvester seen from above, cutting a wheat field in long neat swaths
Long stretches, read in neat passes.

The filler prompts are still useful as a ruler, because I have them at more sizes:

Bar chart of seconds to first token for 13K, 74K and 147K token filler prompts at midday, after the first round of changes and at the end of the day
Cold read of synthetic filler prompts, one request.

The 74K filler prompt took 133 seconds on Part 3's setup and takes about 68 now. What did it, in plain words:

Wooden crates of apples on a trailer in a misty orchard
Sorted first, then handled crate by crate.

Changing the middle of a prompt also got cheaper. Part 3's snapshot handled a follow-up turn, where new text is added at the end. The server now also keeps checkpoints every 8,192 tokens while it reads, so a change in the middle of a prompt restarts from the nearest checkpoint before it. With a change about 70% of the way into the 119K code prompt, the resend started in 52 seconds against 160 for the cold read at the time, and the output matched a cold run token for token.

Writing speed

Bar chart of writing speed in tokens per second on five fixed prompts, code, sysadmin, prose, editing a file and multi-turn, in the morning and at the end of the day
Five fixed reference prompts, one stream.

My server writes with a small draft model, DSpark, that guesses several tokens ahead; Kimi then checks the whole block in one pass and keeps the tokens it agrees with. The largest single step here came from a small observation. When Kimi checks a block of draft tokens, neighboring tokens often choose the same experts: in blocks of 4 tokens about 69% of the expert reads are distinct, and in blocks of 8 about 58%. The check now reads each expert once per block, which was worth 5 to 9%. Trimming per-step overhead added 4 to 6%, and giving the drafter a wider candidate list added close to 4% on thinking text.

Part 3 said prompt lookup did not help. A stricter version of the prompt lookup described above, which copies only when a long run of tokens already matches, does help on rewrite-this-file tasks. That is why the file edit bars in the chart above are so much taller than the rest, morning and evening.

A sixth reference prompt, a short arithmetic question, is left out: its first measurement came right after a server start, which pays a one-time compile warm-up, and its last on a warm second pass, so the two are not comparable.

Through the live server with thinking on, code and sysadmin prompts now run at about 32 to 36 tok/s, prose at 28, and the arithmetic prompt at about 51. These are different prompts from Part 3's harness, so read them as close to its 30 to 34, not as a direct comparison.

Several people at once

Two bar charts for eight concurrent short prompts: median seconds to first token and total tokens per second, in the morning and at the end of the day
Eight short prompts sent together, thinking on.

Short prompts (up to about 1,000 tokens) that arrive within 20 milliseconds of each other are now read in one forward pass instead of one after another. Total throughput at eight streams rose from about 65 to about 73 tok/s, and measured 76 in the later head to head run. Long prompts that arrive together still wait in line, which I can live with on a server with a handful of users.

Exact results as the method

A brass balance scale with weights on one pan, on a dark slate bench
Weighed the same way each time.

Early in this round I found that the same prompt could give different tokens from one run to the next: 4 of my 6 fixed prompts diverged within the first 150 tokens. The cause was in the cluster's all-reduce, which summed large messages from the other machines in the order they arrived. The sums differed in the last bit of rounding, and that was enough.

A small patch to the MLX build makes it reduce in a fixed order, at the same speed. On an idle server, identical requests now give identical tokens. Requests batched together can still differ from a solo run, because the matrix shapes differ.

That became the method. Most kernel changes had to reproduce saved outputs token for token, on six short prompts and two synthetic prompts of about 74K tokens, and were then timed in alternating runs against the old build. The exact top-k, the sparse attention kernel, the grouped expert kernel and the fused KDA path all passed that check, which gave "did I break it" a yes or no answer.

Three changes were adopted on other grounds. A fused scoring kernel for the attention index and a wider attention step when Kimi checks drafts are not bit-exact, so they went through a quality check on the real code prompts: all four planted facts (two at each of 93K and 119K) were found in every version tested, and the code reviews were equally specific. The wider drafter candidate list is lossless for greedy decoding but changes how many tokens it drafts at each step, so I re-saved the reference outputs afterwards.

What did not work

Fine-tuning the DSpark drafter on Kimi's own thinking text, the plan at the end of Part 3, gave no gain. After training on 1.5M tokens, the share of its guesses Kimi would accept on text it had not trained on moved by half a percent, and it became less sure of itself, which would have made the server about 5% slower. I kept the original.

Several other kernel ideas bought too little to keep or were not worth building: a compiled expert graph, an 8-bit attention index, a chunked KDA recurrence, a fused GPU and CPU handshake for the cluster's collectives, extra draft slots for multiple users, and a lazier rollback, which was slower.

Running the experts on 8-bit activations takes another 6 to 7% off long-prompt time. It is not exact, so it waits for a proper quality check.

Thinking text is still the drafter's weak spot. Its first guess is wrong on about a third of steps, mostly at the start of a word, in places where Kimi itself is unsure: its own top choice there gets about 57% probability on average.

Verdict

Kimi on its original weights is now comfortable for my daily agent work at long context, and on the same machines and weights it reads long prompts and serves several people faster than the other engine I tested, without 8-bit activations. Writing with thinking on is still around 28 to 36 tok/s on code, sysadmin and prose, short of the 40 I wanted but acceptable for real use for individuals or small teams.

I did not expect the most useful change of the round to be one that did not speed anything up. Making the cluster repeatable is what let the rest go quickly.

What should I try next?

This is the last part of this series on the four-machine setup; whatever comes next gets its own post. Closing the file edit gap comes first. After that I have more ideas than evenings, so I would like your input. The candidates:

Which of these would you want to read about? Leave a comment and tell me why.

Sources

Fringe Tech Local LLMs

Comments

// Comments are reviewed before appearing. No spam. No noise.