Skip to content

1bit OS: an idle Lemonade model holds the NPU indefinitely - Lemonade's idle eviction is off (auto_evict=false), so evict_idle_timeout=300 never fires #3437

Done

Description

@bong-water-water-bong

Reported by the orchestrator on 23 Nov: a Lemonade-loaded Qwen3-0.6B-NPU-1bit (FLM) held the NPU outside box-hold for about 2 h and blocked a lane.

Measured (strixhalo, installed v2026.48, /var/log/lemond-onebit.log):

  • Load: 21:50:04Z, POST /api/v1/load from the web UI (a browser at 127.0.0.1); one chat at 21:50:07Z; then nothing.
  • Effective settings: … auto_evict=(none), evict_idle_timeout=300 ….
  • Held until an unload all at 23:44:31Z, about 1 h 54 min idle on the NPU.
  • Side finding: the router's load line says device: gpu for this NPU model (onebit_backend=npu), so any device-aware accounting sees the wrong device.

Cause: in our Lemonade fork (pinned aa6c7520; same in v2026.48's 4bd453a0), server/eviction_engine.cpp skips any model unless auto_evict is true for it:

  • A per-model recipe_options value wins; otherwise the global auto_evict applies, and resources/defaults.json ships it false.
  • evict_idle_timeout (default 300 s) is only consulted after that check.
  • The appliance's /data/lemonade/config/config.json doesn't set auto_evict, and recipe_options.json has no entry for any NPU model.

So on 1bit OS an idle model is never evicted. The NPU (one model at a time for FLM, a few contexts for ours) is the device where that hurts most.

Proposed fixes, both:

  1. The image (this repo): 10lemonade writes per-model recipe options {"auto_evict": true, "evict_idle_timeout": 600} for every NPU catalogue entry (the -NPU-1bit ids), so an idle NPU model frees the device after 10 min. GPU models are left as they are, because a 17 GB Inkling reload isn't free; whether to set the global auto_evict for them too is the owner's call. A release-check row would then read recipe_options.json and fail when an NPU entry lacks it.
  2. box-hold (the box's ticket tool, outside this repo): before a ticket takes the NPU lock, take a Lemonade hold. That's POST /api/v1/hold from lemonade#58, which rc1 carries and which unloads the models and blocks new loads until /api/v1/hold/release. Fall back to POST /api/v1/unload on a Lemonade without it, like v2026.48. A ticket then never waits on a model someone forgot in the web UI.

cl-release takes (1) as a PR. (2) is the orchestrator's tool.

🤖 Generated with Claude Code

Activity

  1. bong-water-water-bong commented on Nov 24, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Fixed, and now enforced by a release-check row.

    Why it happened: Lemonade's idle eviction is off by default. third_party/lemonade/src/cpp/server/eviction_engine.cpp:84-91 skips a model unless that model's recipe_options carries a boolean auto_evict: true (:87), and src/cpp/resources/defaults.json:11 ships false — so evict_idle_timeout (300 s, :93) was never consulted for an NPU model, and the NPU stayed held for ~1 h 54 min after the last request.

    The fix landed as #3438 (77ab44b4): os/v3/puppy/embed/.../10lemonade writes auto_evict: true / evict_idle_timeout: 600 for the NPU models into Lemonade's recipe_options.json. Nothing read that file back — which is what merged here as #3467: a new release-check row npu-idle-evict (os/mini/release-check.sh, verdict :1244, row :2305) that fails an appliance image where any shipped NPU model would not be evicted when idle (no entry, false, a non-boolean, a non-object entry, an unreadable config), and skips os/mini naming the gap. --self-test gains 15 arms + 4 named assertions and drives the real shipped helper.

    Control on the real pre-fix image: the box's v2026.49-rc1 10lemonade (23 Nov cut) has no npu-idle-evict reference, and the row's own block run against its live /data/lemonade/config/recipe_options.json prints

    FAIL  npu-idle-evict : 2 of 2 NPU model(s) would not be evicted when idle
          builtin.Qwen3-0.6B-NPU-1bit (no entry); builtin.Qwen3-4B-NPU-1bit (no entry)
    

    and after the shipped helper runs on a copy of that config: PASS 2 NPU model(s) evict when idle … (600 s) with the user entry untouched. Self-test 266 ok / 0 FAIL under bash, dash and busybox sh; ctest release_check_selftest, release_check_row, npu_idle_evict pass.

    Not observed here: the hardware eviction itself on a v2026.49+ boot (the row has never printed PASS end-to-end on a fixed image) — that is a release acceptance, and the row is what makes the next image prove it.

    Closing. Reopen if a fixed image still holds the NPU idle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions