Skip to content
/ airelien.dev
Go back
Aurélien AMSELLEM

Lucebox on Olares One — Episode 8: seven days of waiting, one lib swapped by hand, 88.5 t/s

Seven days after my PR #188 to HAMi-core, still no review. The saga had its cliffhanger — I was waiting on someone else. Then a stupid idea: compile my patched lib and swap it myself. Three new bugs, one night, and at the end Lucebox hits 88.5 t/s. First llama.cpp-based path to pass vLLM Turbo on this hardware.

Hi there.

It’s been seven days since I filed issue #187 and PR #188 with Project-HAMi/HAMi-core, a clean fix for the 6 cuCtxGetDevice hooks that crash silently (full diagnosis in episode 7). The PR is still open, with no review and no comment from the maintainers. Meanwhile my Olares One and its RTX 5090M still run the original HAMi lib, which crashes with Illegal device id: -644371744 the moment a GPU pod boots.

In theory, the saga stopped there: I was waiting. Then this morning, over coffee, a very simple idea came to me. Why wait for an upstream merge when I can compile my own patched lib and swap it in directly on the Olares node? The PR will help the whole HAMi community the day it’s merged, but in the meantime I can unblock my own Olares.

It worked. At the end of the chain, Lucebox hits 88.5 t/s on Qwen3.6-27B, 0.5 t/s ahead of my vLLM Turbo (88). It’s the first time a llama.cpp-based setup beats vLLM Turbo on this hardware. Here’s how I got there.

Quick recap for newcomers

Lucebox (episode 1) is a llama.cpp fork tuned by sandropuppo. It does DFlash speculative decoding with custom CUDA kernels: a small “drafter” model guesses a block of tokens ahead, and the big model checks them all in one pass and keeps the ones it agrees with. HAMi (Heterogeneous AI computing Virtualization Middleware) is the layer that shares and isolates the GPU under the Kubernetes pods on Olares, by intercepting their CUDA calls through a library, libvgpu.so. And the bug I reported in episode 7 is six hooks in HAMi-core that read an uninitialized dev variable. The result: a random crash at boot for any pod that goes through the CUDA Driver API (Lucebox, recent llama.cpp, vLLM in async mode).

The morning

I rebuild HAMi-core from my fix/cumemcreate-uninit-dev branch (the PR #188 commits). Out comes a 676 KB libvgpu.so, an amd64 ELF binary. The Olares version is 863 KB (different build, more options), but that doesn’t matter: the ABI, the binary interface programs see, is compatible.

On the Olares node, the reference copy of libvgpu lives at /usr/local/vgpu/libvgpu.so. That’s the one HAMi injects into every GPU pod. I back it up, then swap it:

ssh olares@olares-one "sudo cp /usr/local/vgpu/libvgpu.so /usr/local/vgpu/libvgpu.so.backup-original
                       sudo cp /tmp/libvgpu.so.patched /usr/local/vgpu/libvgpu.so"

sha256 check: 85b2ebe47bfe.... That’s my patched lib.

This is what’s called a hot swap: you replace a library on disk without stopping anything. A library injected with LD_PRELOAD is read when the process starts. So every GPU pod that starts after the swap loads my version, and pods already running keep the old one in memory. No impact on running workloads. Just keep in mind that the swap applies to the whole node, and that whenever the HAMi DaemonSet (the Kubernetes component that runs HAMi on every node) restarts, the file may get overwritten with the original. Moderate risk, and reversible since the backup is in place.

Lucebox boots… and three new bugs

I redeploy lucedflashqwen36one v1.3.0 (the standard chart from the repo). The Illegal device id bug from episode 5 is gone: HAMi is unblocked.

Except the pod still crashes and goes into CrashLoop, with a new error message.

Layer 1: gguf_init_from_file_ptr: invalid magic characters: 'p???', expected 'GGUF'

My chart used the spiritbuun/Qwen3.6-27B-DFlash-GGUF drafter, a leftover from my parallel buun-llama-cpp experiments. But Lucebox has its own loader for z-lab’s BF16 safetensors and doesn’t read spiritbuun’s GGUF. The formats don’t match.

Fix: go back to the z-lab BF16 drafter (huggingface-cli download z-lab/Qwen3.6-27B-DFlash --local-dir models/draft/).

Layer 2: Total VRAM: 0 MiB

The pod boots, loads the target model onto the GPU… and immediately runs out of memory (OOM). HAMi logs:

[HAMI-core Warn]: invalid device memory limit CUDA_DEVICE_MEMORY_LIMIT_0=0m
ggml_cuda_init: found 1 CUDA devices (Total VRAM: 0 MiB):

By default Olares sets CUDA_DEVICE_MEMORY_LIMIT_0=0m, meaning “no limit”. But HAMi-core reads “0m” as an invalid limit, and available memory drops to 0 bytes. That’s another HAMi bug, separate from the one in my PR #188.

Fix in the entrypoint, before launching server.py:

export CUDA_DEVICE_MEMORY_LIMIT_0=24000m

Layer 3: prefix_cache.startup_sync() 10s timeout

This time the pod boots correctly, the target loads (851 tensors, 14.99 GiB on the GPU), and so does the drafter (3.5 GiB). Then:

File ".../scripts/prefix_cache.py", line 670, in startup_sync
    reply = await self._await_reply("[snap] slots=")
asyncio.exceptions.TimeoutError

server.py starts the test_dflash daemon, then waits for it to print [snap] slots= on stdout, with a timeout hardcoded at 10 seconds. On first boot, the daemon has to compile its CUDA kernels just in time (JIT) for sm_120 (compute capability 12.0, the consumer Blackwell in the Olares One). That takes 30-60 seconds, so the timeout fires before the daemon is ready.

Workaround: disable both the prefix cache and the prefill cache, which both call startup_sync. Those caches let the server reuse the KV cache (the memory of what the model has already read) when two requests start with the same text.

python3 scripts/server.py --prefix-cache-slots 0 --prefill-cache-slots 0 ...

The cost: no KV cache reuse from one request to the next. Fine for solo benching. For agent use in production, the timeout will need fixing in the source (a PR to file later).

The afternoon: OOM, round two

Boot OK! server.py logs:

Luce DFlash OpenAI server on http://0.0.0.0:8000
  target    = /models/Qwen3.6-27B-Q4_K_M.gguf
  draft     = /models/draft/model.safetensors
  budget    = 22
  [daemon] [target] target loaded: 851 tensors on GPU 14.99 GiB
  [daemon] [draft]  loaded
  [daemon] [daemon] ready

First curl on /v1/chat/completions:

500 Internal Server Error
{"detail":"dflash daemon has exited unexpectedly"}

Ouch. The daemon died on the first inference. Logs:

[HAMI-core ERROR allocator.c:56]: Device 0 OOM 24232551680 / 24117248000

24,232 MB requested against 24,117 MB allowed: apparently my 23000m, I’d miscounted. I bump it to 24,000m (= 25,165,824,000 bytes, i.e. 24.03 GiB ~150 MB under the hardware 24,463 MiB). Tight margin, but it should do.

I patch the deployment live with kubectl patch deployment (instead of shipping a new chart version):

kubectl patch deployment lucedflashqwen36one ... '/spec/.../args/0' with sed 23000m → 24000m

The pod gets recreated. 4 min 24 s later: 2/2 Running, 0 restarts.

The first bench

I run my usual bench, Space Invaders (I ask the model to write a Space Invaders game in HTML), three times, with max_tokens=800 and temp=0.6. I run it with python3 urllib.request from inside the container, because the Lucebox image doesn’t ship curl but does have Python:

Run 1: 800 tok in 9.19 s = 87.05 t/s
Run 2: 800 tok in 8.93 s = 89.54 t/s
Run 3: 800 tok in 9.00 s = 88.88 t/s

Average: 88.5 t/s [87-89.5].

I read the numbers twice. It’s the first time Lucebox has produced anything on consumer mobile Blackwell since the saga started seven days ago. And it sits slightly ahead of my vLLM Turbo (Genesis 28 patches + TurboQuant K8V4 + MTP n=3), which runs at 88 t/s.

Final ranking on Olares One (May 4, 2026)

The table compares average generation speed (right-hand column, in tokens per second) on Qwen3.6-27B, with the same bench for every stack. The Stack column lists each engine’s settings: TQ3_0 KV is a KV cache compressed to about 3.5 bits per value, and MTP n=3 is speculative decoding that uses the model’s built-in prediction head to guess 3 tokens per step.

BackendStackt/s avg
llama.cpp standardUD-Q4_K_XL, no spec33-36
buun-llama-cpp DFlashHEAD + Q8_0 GGUF drafter80
vLLM TurboGenesis + TurboQuant K8V4 + MTP n=388.0
Lucebox DFlash HTTPscripts/server.py + test_dflash + TQ3_0 KV88.5

Lucebox is the new champion on Olares One. Not by much: 0.5 t/s is within noise. But it’s the first time a llama.cpp-based setup on consumer mobile Blackwell beats the custom vLLM setup. And that’s with a mismatched drafter: it was trained for Qwen3.5, not Qwen3.6, so its acceptance rate (the share of guessed tokens the big model keeps) is middling. Lucebox PR #94 from May 4 reports 106 t/s on an RTX 4090 (Ada, sm_89) with a drafter trained for Qwen3.6 and SWA support (sliding window attention: some layers only look at the most recent tokens instead of the whole text). If that carries over linearly to Blackwell sm_120, we should hit 100+ t/s (estimated) as soon as we rebuild against PR #94 once it’s merged.

(A note from episode 9: it doesn’t carry over linearly. But that’s another story.)

Lesson from this episode

The saga had a ready-made cliffhanger at episode 7: “PR filed, let’s wait”. By being a bit more aggressive, compiling my own libvgpu.so instead of waiting on upstream, I turned “let’s wait” into “it works”. None of the three workarounds is particularly clean:

  1. The hot swap applies to the whole node, and the HAMi DaemonSet may rewrite my file at the next Olares update.
  2. Forcing CUDA_DEVICE_MEMORY_LIMIT_0=24000m works around a HAMi bug that deserves its own PR.
  3. Disabling the prefix cache loses KV cache reuse. It needs a fix in server.py (a longer timeout).

But 88.5 t/s on a 24 GB consumer mobile GPU, through Lucebox’s HTTP server, is the first public demo of it. That’s enough to show the approach works. Polish can come later.

Next steps

Episode 9: the 106 t/s attempt that crashed at 88.7 t/s, and why. See you next time!


Disclosure — All the benchmarks in this post run on my own Olares One. If the content was useful and you’re considering one, ordering through this referral link gets you $300 off ($4,699 instead of $4,999), stackable with the $300 Black Friday discount starting November 17: $600 off in total ($4,399). I’m mentioning this out of transparency — and yes, incidentally, it helps keep the blog alive (hosting, domain, and the time I spend writing here).

Share this post on:

Comments