Commit da92170
authored
Fix synthetic parity CI failures from transformers 5.13 upgrade (#390)
Five `tests/synthetic_parity_test.py` cases (`olmo3`, `deepseek_v3`,
`deepseek_v2_2`, `longcat_flash`, `granitemoehybrid`) broke after the
transformers 5.13 upgrade, each from a distinct HF-side behavior change.
### MLA head-count mismatch — `deepseek_v2`, `deepseek_v3`,
`longcat_flash`
HF's SDPA path now applies `repeat_kv` whenever `num_key_value_groups >
1`. MLA reconstructs full-head K/V from a latent, so the tiny configs'
`num_key_value_heads=2` caused K/V to be duplicated (4→8 heads) against
the 4-head query: `RuntimeError: The size of tensor a (4) must match the
size of tensor b (8)`.
- Set `num_key_value_heads == num_attention_heads` for the MLA entries
in `tests/_test_configs.py` (no-op for the mobius MLA path, which
ignores `num_key_value_heads`).
### granitemoehybrid — `tests/synthetic_parity_test.py` +
`granitemoehybrid.py`
- Legacy `layer_types` values `mamba`/`attention` are rejected by HF's
validator; the test now emits `linear_attention`/`full_attention`, and
the redundant `_HF_EXTRA_CONFIG` override forcing legacy names is
removed.
- HF renamed the routed-expert tensors; `preprocess_weights` now remaps
them (identical layouts, names only), keeping legacy names for
back-compat:
```python
".block_sparse_moe.experts.gate_up_proj" -> ".block_sparse_moe.input_linear.weight"
".block_sparse_moe.experts.down_proj" -> ".block_sparse_moe.output_linear.weight"
".block_sparse_moe.router.weight" -> ".block_sparse_moe.gate.weight"
```
Without this remap the ONNX expert weights stayed random (cosine 0.996).
### olmo3
Near-tie argmax with `cosine=0.9999`, `max_abs_diff=0.0146` — a benign
QK-norm + sliding/full-attention FP-accumulation difference. Added an
`olmo3: 0.02` atol override, consistent with existing entries like
`gemma3_text`.
---------
Signed-off-by: copilot
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent 0253746 commit da92170
3 files changed
Lines changed: 49 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
| |||
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
455 | | - | |
456 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
457 | 461 | | |
458 | 462 | | |
459 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
460 | 477 | | |
461 | 478 | | |
462 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
550 | 557 | | |
551 | 558 | | |
552 | 559 | | |
| 560 | + | |
| 561 | + | |
553 | 562 | | |
554 | 563 | | |
555 | 564 | | |
| |||
581 | 590 | | |
582 | 591 | | |
583 | 592 | | |
| 593 | + | |
| 594 | + | |
584 | 595 | | |
585 | 596 | | |
586 | 597 | | |
| |||
604 | 615 | | |
605 | 616 | | |
606 | 617 | | |
| 618 | + | |
| 619 | + | |
607 | 620 | | |
608 | 621 | | |
609 | 622 | | |
| |||
774 | 787 | | |
775 | 788 | | |
776 | 789 | | |
| 790 | + | |
| 791 | + | |
777 | 792 | | |
778 | 793 | | |
779 | 794 | | |
| |||
1085 | 1100 | | |
1086 | 1101 | | |
1087 | 1102 | | |
| 1103 | + | |
| 1104 | + | |
1088 | 1105 | | |
1089 | 1106 | | |
1090 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
| |||
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
544 | | - | |
545 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
546 | 547 | | |
547 | 548 | | |
548 | 549 | | |
549 | | - | |
| 550 | + | |
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
| |||
0 commit comments