With more than one discrete GPU of the same backend, auto-fit used only the
one with the most free memory. A model that did not fit there was streamed
from RAM or disk while the other GPUs stayed idle.
--multi-gpu auto (the default) moves a module that does not fit next to the
modules placed before it to another GPU: first the text encoder or the VAE,
and when the diffusion model or the text encoder fits on no single GPU, it is
split across the fewest GPUs that can hold it, as --backend
"diffusion=cuda0&cuda1" does. on also moves the text encoder and the VAE away
from the GPU of the diffusion model when everything would fit on one, and off
keeps the previous single-GPU behavior.
Modules named in --backend, or split by rows, are never moved or split, and
only discrete GPUs of one backend are combined. The planner requires the free
memory of the GPUs, less the compute reserve of each, to exceed the weights by
10% plus 256 MiB per boundary, because blocks cannot be cut exactly where the
memory ends. A split saves memory but does not make one image faster.
The new field multi_gpu is appended to sd_ctx_params_t and sd_ctx_params_init()
sets it to the default.
Not run on real GPUs; the planner is covered by a test with simulated devices
in the next commits.
Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC