Commit d13cf71
feat: auto-fit component placement and per-component backend devices
Add an auto-fit planner that picks DiT / VAE / Conditioner device
placements from free GPU memory, treating each component as atomic
(no intra-tensor row split — equivalent to llama.cpp's
LLAMA_SPLIT_MODE_LAYER at component granularity, so views never land
on a split buffer and no ggml patch is needed).
Also adopt the PR #1184 CLI conventions:
- new: --main-backend-device, --diffusion-backend-device,
--clip-backend-device, --vae-backend-device,
--control-net-backend-device, --tae-backend-device,
--upscaler-backend-device, --photomaker-backend-device,
--vision-backend-device, --list-devices
- removed: --clip-on-cpu, --vae-on-cpu, --control-net-cpu
(and the matching keep_*_on_cpu fields on sd_ctx_params_t)
Auto-fit knobs: --auto-fit / --no-auto-fit, --no-multi-gpu,
--fit-target, --fit-compute-reserve-{dit,vae,cond}, --fit-dry-run.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f3fd359 commit d13cf71
7 files changed
Lines changed: 694 additions & 60 deletions
File tree
- examples/common
- include
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
438 | 455 | | |
439 | 456 | | |
440 | 457 | | |
| |||
461 | 478 | | |
462 | 479 | | |
463 | 480 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | 481 | | |
477 | 482 | | |
478 | 483 | | |
| |||
513 | 518 | | |
514 | 519 | | |
515 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
516 | 539 | | |
517 | 540 | | |
518 | 541 | | |
| |||
611 | 634 | | |
612 | 635 | | |
613 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
614 | 646 | | |
615 | 647 | | |
616 | 648 | | |
| |||
736 | 768 | | |
737 | 769 | | |
738 | 770 | | |
739 | | - | |
740 | | - | |
741 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
742 | 775 | | |
743 | 776 | | |
744 | 777 | | |
| |||
797 | 830 | | |
798 | 831 | | |
799 | 832 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | 833 | | |
804 | 834 | | |
805 | 835 | | |
| |||
817 | 847 | | |
818 | 848 | | |
819 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
820 | 857 | | |
821 | 858 | | |
822 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
159 | 156 | | |
160 | 157 | | |
161 | 158 | | |
| |||
167 | 164 | | |
168 | 165 | | |
169 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
170 | 177 | | |
171 | 178 | | |
172 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 209 | | |
213 | 210 | | |
214 | 211 | | |
| |||
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
229 | 248 | | |
230 | 249 | | |
231 | 250 | | |
| |||
491 | 510 | | |
492 | 511 | | |
493 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
494 | 518 | | |
495 | 519 | | |
496 | 520 | | |
| |||
0 commit comments