mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-28 19:16:33 +00:00
When the server stepped down, the CPU took the work and the GPUs were left behind: `lite` put the text encoder on the CPU, `lite-disk` switched the auto-fit off, a backend failure jumped straight to `lite-cpu`, and an engine that could not start a backend quietly turned the whole model into a CPU run. - profile: `lite` no longer moves the text encoder to the CPU and sets `--multi-gpu on` (unless it was set to off); `lite-disk` keeps the auto-fit. The new level `lite-hybrid`, between `lite-disk` and `lite-cpu`, is where the text encoder goes to the CPU, and only on a machine that has an accelerator. Ladder: max > balanced > lite > lite-disk > lite-hybrid > lite-cpu. The names and options of `--profile` are unchanged, an explicit option still wins, `max` is identical and `include/` is untouched. - keeper: a backend failure no longer walks down the profiles. The same configuration is loaded once more (once per request), then each device the engine lists is tried on its own (graphics cards, the vendor's backend before Vulkan/OpenCL, most free memory first; accelerators; integrated GPUs last; never RPC), and the CPU comes last. Running out of memory on a device steps down the profile on that same device. While a GPU is left to try, the keeper sets disable_backend_fallback, so the engine does not fall back to the CPU by itself. The climb back tries the preferred device first, and from the CPU goes straight to the profile the server had when the device failed. A placement written in --backend is not rewritten. - visibility: /sdcpp/v1/health reports device, cpu_modules and fallback_devices, and the counters retries and device_switches; the status is degraded on another device too. The start-up log tells the order of the spare devices, the device in use and the modules the CPU computes. - the --profile help text no longer says that lite uses the CPU. Verification: profile_test 74 checks and server_recovery_test 234 checks (simulated library, device list and clock), the second also under ASan/UBSan/TSan; seven mutations of the device-failure code are all caught. On the CPU-only machine used here, sd-server with the synthetic model still steps down to lite-disk under a memory limit, and the cancel (35 checks) and model catalog (15 checks) runs pass. Nothing has run on a real GPU. Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC |
||
|---|---|---|
| .. | ||
| common.cpp | ||
| common.h | ||
| generation_metadata.cpp | ||
| generation_metadata.h | ||
| log.cpp | ||
| log.h | ||
| media_io.cpp | ||
| media_io.h | ||
| media_metadata.cpp | ||
| media_metadata.h | ||
| profile.cpp | ||
| profile.h | ||
| resource_owners.hpp | ||