Local model JIT load waits ~22 s for a concurrency probe that always ends unmeasured and is never cached

オープン
#896 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@oldwinter53 がすでに取り組んでいます。

2026年11月28日 から。

評価

この issue はまだ評価されていません。

説明

bug

On a 16 GB Apple Silicon Mac (llama.cpp Metal, -np 2, spark-x2.6-4b), a Run that JIT-loads its local model waits 39.4 s in EnsureLoaded. The engine load takes 16 s. The remaining ~22 s is the Daemon's post-load concurrency probe, which holds the row as loading (concurrency_probing: true) until it ends.

The probe always ends concurrency_probe_unmeasured on this hardware:

  • The probe prompt is ~2.7k–3.2k tokens, not the documented ~1000, so each call is dominated by prefill. Prefill is limited by compute, so two calls at once each take about 2× a single call.
  • Neither call finishes inside the 1.5× baseline deadline. The first result is then a deadline error, and probe() returns unmeasured (concurrency_probe.go lines 469-474). The same deadline on the second result is already treated as a definitive 1 (lines 481-484).
  • Unmeasured results are not persisted, and the in-memory memo is cleared when the model unloads. Every JIT load after the 15-minute idle unload repeats the full probe, and nothing comes of it: unmeasured gives the same {1,8} scheduling as no probe.

Related symptoms:

  • After Quit/Reopen, the first probe is cancelled 1–3 s in and restarted. A status read during the installer's restore changes the row's loaded state or fingerprint, so reconcileProbes cancels and restarts it. The cancel is logged as concurrency_probe_baseline_failed ... context canceled.
  • WillLoad treats the probe overlay as loading, so a Run that arrives during a probe shows queued/loading_local_model for a model that is already loaded.

Proposed fix:

  1. When both calls of the pair miss the deadline, record a measured 1 and cache it.
  2. Keep an unmeasured outcome for the same fingerprint across unload and reload, at least for the Daemon's lifetime, or persist it with a TTL.
  3. Do not log a deliberate cancel as a failed baseline, and bring the probe prompt to its documented size.
  4. Follow-up: report the model loaded as soon as the engine is ready, with concurrency omitted ({1,8}), and run the probe in the background only while the model is idle.

Expected saving: ~22 s per JIT load (39.4 s → ~17 s on the reported machine).

Out of scope: node-services adaptive limits (#623, #668) are unaffected and still relevant.

Evidence: internal 16 GB test Mac, Linger 0.1.12-rc.elastic.1, localmodels 0.1.0.dev60. In the Daemon log, ensure_load phase=succeeded ms=39410 at 03:11:51 follows concurrency_probe_unmeasured at 03:11:50. In llama-server's log, baseline task 166 has 2729 prompt tokens and takes 8.5 s, and pair tasks 202/203 are both cancelled at the 12.8 s deadline.

主要言語
TypeScript
スター
3.8k
フォーク
360
平均マージ
8時間 10分
マージ済み PR(30日)
540

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

simplexai-labs/linger のほかの issue

simplexai-labs/linger の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。