Repository navigation
Commit 305ce3c
committed
feat: add setFlashAttn(FlashAttn), deprecate the valueless enableFlashAttn
llama.cpp turned --flash-attn from a bare flag into a value-taking option in
b10273: on|off|auto is mandatory. enableFlashAttn() emits the key with no
value, so the parser consumes whatever argv token follows and the load dies
naming a flag the caller never set -- error: unknown value for --flash-attn:
'--reasoning-format' is a real observed message.
Until now the option was simply not expressible through this binding.
putScalar is protected, so a downstream caller could not work around it
either; srcmorph ships a plan-time refusal for exactly this reason.
args.FlashAttn follows the CacheType / TensorReadLazyMode pattern, and
setFlashAttn routes through putEnum, so the value lands as its own argv token
after the key.
enableFlashAttn() is deprecated rather than fixed in place. Rewriting it to
emit "on" would turn Flash Attention on for every caller whose argv happened
to survive -- a behaviour change wearing a bugfix's clothes. Error Prone's
@InlineMe suggestion is declined for the same reason and the suppression says
so: inlining would copy the broken emission into callers, which is the
opposite of the migration, and the replacement is not equivalent because it
takes a value the old method cannot supply.
One existing test had encoded the defect as the contract:
testToArrayComplexCombination asserted a 9-token argv built with
enableFlashAttn(). It now uses the new setter and asserts 10, and the
deprecated method's valueless emission gets its own test that says in its name
and javadoc that it is pinning a defect. Two further tests cover every enum
value and assert the value is the token immediately after the key -- the
property whose absence caused all of this.
llama module: 1478 tests, 0 failures.1 parent 6e1c66f commit 305ce3c
4 files changed
Lines changed: 137 additions & 5 deletions
File tree
- llama/src
- main/java/net/ladenthin/llama
- args
- parameters
- test/java/net/ladenthin/llama/parameters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 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 | + | |
12 | 36 | | |
13 | 37 | | |
14 | 38 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
254 | 265 | | |
255 | 266 | | |
| 267 | + | |
256 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
257 | 275 | | |
258 | 276 | | |
259 | 277 | | |
260 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
261 | 293 | | |
262 | 294 | | |
263 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
637 | 647 | | |
638 | | - | |
| 648 | + | |
639 | 649 | | |
640 | 650 | | |
641 | 651 | | |
642 | 652 | | |
643 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
644 | 682 | | |
645 | 683 | | |
646 | 684 | | |
| |||
1092 | 1130 | | |
1093 | 1131 | | |
1094 | 1132 | | |
1095 | | - | |
| 1133 | + | |
1096 | 1134 | | |
1097 | | - | |
1098 | | - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1099 | 1140 | | |
1100 | 1141 | | |
1101 | 1142 | | |
| |||
0 commit comments