Commit e9d492a
perf(firered): link OpenMP + vectorizable dot — ~4x faster AED decoder
The firered-asr target never linked OpenMP, so cpu_matmul_bt's
`#pragma omp parallel for` were no-ops and the AED beam decoder ran
single-threaded (~1443 ms/token at beam 5 on an RTX A1000's CPU). Two fixes:
1. Link firered-asr with OpenMP::OpenMP_CXX so the matmuls actually
parallelize (the pragmas were already there).
2. Replace the double-accumulate dot in cpu_matmul_bt with cpu_dot() — four
independent float accumulator chains the compiler can vectorize under
strict FP. Float accumulation over K~1280 is within ASR-logit tolerance.
Decoder: 1443 -> 365 ms/token (3.95x). issue19-5s 0.2x -> 0.6x RT; issue19-35s
223 s -> 111 s (2x wall). Transcripts byte-identical. Decoder is now partially
bandwidth-bound (reads ~1.5 GB F32 weights per beam) — batching the beams is
the next lever.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b146243 commit e9d492a
2 files changed
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1363 | 1370 | | |
1364 | 1371 | | |
1365 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
695 | 715 | | |
696 | 716 | | |
697 | 717 | | |
698 | 718 | | |
699 | 719 | | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
| 720 | + | |
| 721 | + | |
707 | 722 | | |
708 | 723 | | |
709 | 724 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
716 | 728 | | |
717 | 729 | | |
718 | 730 | | |
| |||
0 commit comments