Second of four steps towards upstream 3b12781: ggml 1.0.0 (#2354), the
runner and weight-residency refactor (#2321, #2314, #2322), configurable
job queue limits (#2316), interleaved image prompts (#2341), MiniMax-H3
image and the HIP/CUDA kernel work.
Conflicts resolved:
- src/core/ggml_runner.cpp, src/core/execution_engine.cpp: upstream moved
graph execution into the new execution engine; the out-of-memory and
backend error codes, and segmenting on the CPU when weights stream from
disk, now live there.
- src/model_manager.cpp: ensure_compute_backend_capacity delegates to
ExecutionEngine::ensure_capacity. The memory guard reaches it through
three DeviceResidencyManager hooks (memory_guard_ok, _observe and
_unreachable): blocks are freed until the request fits and the usage is
under the guard threshold, and a request that fits still runs when the
threshold cannot be reached. test/memory_guard_engine_test.cpp covers
it and fails when the hooks are removed.
- examples/server: each ContextKeeper attempt installs upstream's
PromptImageCallbackGuard on its own context; --degradation-cooldown
sits next to --max-pending-jobs and --completed-ttl-seconds.
- README.md, examples/server/README.md: keep the fork's releases link and
the "When the memory runs short" section in the new layout.
Verified with a CPU build (ggml eeda9ec4): the library, sd-cli and
sd-server build; backend_fit_plan_test, model_loader_latency_test,
pe_imports_test, file_handle_pool_test, profile_test,
server_recovery_test, api_robustness and memory_guard_engine_test pass;
sd-server starts without a model and answers /sdcpp/v1/health and
/sdcpp/v1/resources.
Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC