Commit e37730d
Studio: retry as one sequence when llama.cpp refuses a unified KV cache (#10371)
* Studio: retry as one sequence when llama.cpp refuses a unified KV cache
Studio appends --kv-unified whenever it asks for more than one slot, so
llama.cpp does not split -c into per-slot windows. Some architectures need one
sequence per stream and refuse to build a context that way:
llama_init_from_model: failed to initialize the context: glm5next: the pooled
indexer needs one sequence per stream, so a unified KV cache is only supported
with a single sequence
The flag is Studio's, not the user's, so nothing they can change in the UI
reaches it. A Strix Halo report shows GLM-5.3-Flash tried four times over two
days after a 146 GB download and never once ran; the second attempt cut the
context 15x, which could not have helped because it was never the context.
Retry once with the geometry that would never have added the flag: one slot,
no unified cache, the requested context untouched. Matched on llama.cpp's own
wording rather than on an architecture name, so a second model with the same
constraint needs no list entry. The rung sits ahead of the flash-attention
retry, which only fires on a signal crash, and this is a clean refusal.
Every --parallel occurrence is rewritten, not just the emitted one: extras are
appended after Unsloth's flags and llama.cpp is last-wins. LLAMA_ARG_KV_UNIFIED
is dropped from the child environment for the same reason the flash-attn retry
drops LLAMA_ARG_FLASH_ATTN - llama.cpp applies the environment before argv, and
there is no negated flag to emit against it.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Studio: the single-sequence retry commits the one-slot geometry it launched
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Mark the single-sequence retry's slot clamp for PR #10371
* Keep the single-sequence retry ahead of the fit rungs and cover every slot alias
* Tighten the comments on the single-sequence retry
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent c2bb6e3 commit e37730d
4 files changed
Lines changed: 295 additions & 13 deletions
File tree
- studio/backend
- core/inference
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
17693 | 17694 | | |
17694 | 17695 | | |
17695 | 17696 | | |
| 17697 | + | |
| 17698 | + | |
| 17699 | + | |
| 17700 | + | |
| 17701 | + | |
| 17702 | + | |
| 17703 | + | |
| 17704 | + | |
| 17705 | + | |
| 17706 | + | |
| 17707 | + | |
| 17708 | + | |
| 17709 | + | |
| 17710 | + | |
| 17711 | + | |
| 17712 | + | |
| 17713 | + | |
| 17714 | + | |
| 17715 | + | |
| 17716 | + | |
| 17717 | + | |
| 17718 | + | |
| 17719 | + | |
| 17720 | + | |
| 17721 | + | |
| 17722 | + | |
| 17723 | + | |
| 17724 | + | |
| 17725 | + | |
| 17726 | + | |
| 17727 | + | |
| 17728 | + | |
| 17729 | + | |
| 17730 | + | |
| 17731 | + | |
| 17732 | + | |
| 17733 | + | |
| 17734 | + | |
| 17735 | + | |
| 17736 | + | |
| 17737 | + | |
| 17738 | + | |
| 17739 | + | |
| 17740 | + | |
| 17741 | + | |
| 17742 | + | |
| 17743 | + | |
| 17744 | + | |
| 17745 | + | |
| 17746 | + | |
| 17747 | + | |
| 17748 | + | |
| 17749 | + | |
| 17750 | + | |
| 17751 | + | |
| 17752 | + | |
| 17753 | + | |
| 17754 | + | |
| 17755 | + | |
| 17756 | + | |
| 17757 | + | |
| 17758 | + | |
| 17759 | + | |
| 17760 | + | |
| 17761 | + | |
| 17762 | + | |
| 17763 | + | |
| 17764 | + | |
| 17765 | + | |
| 17766 | + | |
| 17767 | + | |
| 17768 | + | |
| 17769 | + | |
17696 | 17770 | | |
17697 | 17771 | | |
17698 | 17772 | | |
| |||
23692 | 23766 | | |
23693 | 23767 | | |
23694 | 23768 | | |
| 23769 | + | |
| 23770 | + | |
| 23771 | + | |
| 23772 | + | |
| 23773 | + | |
23695 | 23774 | | |
23696 | 23775 | | |
23697 | 23776 | | |
| |||
23722 | 23801 | | |
23723 | 23802 | | |
23724 | 23803 | | |
23725 | | - | |
| 23804 | + | |
23726 | 23805 | | |
23727 | 23806 | | |
23728 | 23807 | | |
| |||
23754 | 23833 | | |
23755 | 23834 | | |
23756 | 23835 | | |
23757 | | - | |
| 23836 | + | |
23758 | 23837 | | |
23759 | 23838 | | |
23760 | 23839 | | |
| |||
23822 | 23901 | | |
23823 | 23902 | | |
23824 | 23903 | | |
23825 | | - | |
| 23904 | + | |
23826 | 23905 | | |
23827 | 23906 | | |
23828 | 23907 | | |
| |||
24517 | 24596 | | |
24518 | 24597 | | |
24519 | 24598 | | |
| 24599 | + | |
| 24600 | + | |
| 24601 | + | |
| 24602 | + | |
| 24603 | + | |
| 24604 | + | |
| 24605 | + | |
| 24606 | + | |
| 24607 | + | |
| 24608 | + | |
| 24609 | + | |
| 24610 | + | |
| 24611 | + | |
| 24612 | + | |
| 24613 | + | |
| 24614 | + | |
| 24615 | + | |
| 24616 | + | |
| 24617 | + | |
| 24618 | + | |
| 24619 | + | |
| 24620 | + | |
| 24621 | + | |
| 24622 | + | |
| 24623 | + | |
| 24624 | + | |
| 24625 | + | |
| 24626 | + | |
24520 | 24627 | | |
24521 | 24628 | | |
24522 | 24629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | | - | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
278 | | - | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
Lines changed: 171 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
625 | 624 | | |
626 | 625 | | |
627 | 626 | | |
628 | 627 | | |
629 | 628 | | |
630 | 629 | | |
631 | 630 | | |
632 | | - | |
633 | | - | |
634 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
635 | 634 | | |
636 | 635 | | |
| 636 | + | |
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| |||
0 commit comments