`pinned: true` model is freed after every request — idle-unload exclusion (#9305) ineffective on v4.7.1
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Bắt đầu tại pkg/model/process.go, ở luồng xóa và Free() được hiển thị trong log, sau đó theo dõi cách các thiết lập pinned và max_active_backends đi đến bước dọn dẹp backend. Tái hiện với các thiết lập runtime v4.7.1 được liệt kê và hai request; được xem là hoàn tất khi tiến trình backend của một model pinned vẫn thường trú giữa các request mà không có idle timeout.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #9305 / #9309 (exclude models from idle unloading via pinned: true). On v4.7.1 a pinned: true model is not kept resident — its backend process is torn down after every request, so each call pays a full cold reload.
Environment
- LocalAI
v4.7.1, imagelocalai/localai:v4.7.1-gpu-nvidia-cuda-13, single NVIDIA 16 GB GPU,llama-cpp(cuda13) backend. - Model YAML:
backend: llama-cpp,pinned: true,context_size: 24576. - Runtime settings:
watchdog_enabled: false,single_backend: false,max_active_backends: 0(docs: "0 = unlimited"),memory_reclaimer_enabled: false,size_aware_eviction: false,force_eviction_when_busy: false.
Expected
Per the docs ("a pinned model is never evicted") and #9305: with no watchdog, no LRU limit, and pinned: true, the model should stay loaded across requests.
Actual
The backend is freed immediately after each response completes (not after any idle timeout):
INFO ... Predict request completed successfully
DEBUG Deleting process model="qwen3.5-9b" (pkg/model/process.go:49)
DEBUG Calling Free() to release GPU resources model="qwen3.5-9b"
INFO Backend process stopped id="qwen3.5-9b" exitCode="0"
This repeats for every single request across the log; the next request cold-loads (~10 s). Confirmed via nvidia-smi: the backend process disappears seconds after each response and reloads on the next call.
Repro
- Load a
pinned: truellama-cpp model on v4.7.1 with the runtime settings above. - Send two chat completions about a minute apart.
- Observe (via
nvidia-smi) the backend process disappear after the first completes and reload for the second.
Question
Is pinned: true expected to keep a model resident, or only to exempt it from eviction while some other path still frees it? If max_active_backends: 0 (documented as "unlimited") is implicated, the "0 = unlimited" behaviour and the #9305 exclusion don't appear to hold. Net effect: pinned currently provides no persistence benefit — every request pays a full cold model load.
- Ngôn ngữ chính
- Go
- Star
- 49.2k
- Fork
- 4.5k
- Merge trung bình
- 19 giờ 42 phút
- Pull request đã merge (30 ngày)
- 299
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mudler/LocalAI
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mudler/LocalAI#12264 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mudler/LocalAI#11995 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mudler/LocalAI#11991 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mudler/LocalAI#11973 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của mudler/LocalAI
Issue tương tự
-
area/proxy kind/bug priority/backlog triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Agent-Field/CodeAF#1592 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 7 ngày
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2 reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
afreidah/s3-orchestrator#1564 ·
Maintainer thường phản hồi trong vòng 1 ngày