Commit 2b511ae
committed
Fix GenAI regression: disable past_present_share_buffer for dual head_dim
Models with different head_dim across layers (e.g., Gemma4 with
head_dim=256 for sliding and global_head_dim=512 for full-attention)
cannot use shared KV buffers. Dynamically detect dual head_dim from
config and set past_present_share_buffer=false.
Implementation:
- GenaiConfigGenerator: add _search_overrides dict applied in generate()
- auto_export: check config.global_head_dim != config.head_dim
134 tests pass (15 gemma4 + 119 ort_genai).
Signed-off-by: Justin Chu <justinchu@microsoft.com>1 parent f027a8e commit 2b511ae
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
658 | 666 | | |
659 | 667 | | |
660 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
410 | 416 | | |
411 | 417 | | |
412 | | - | |
| 418 | + | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| |||
0 commit comments