Commit 903b453
committed
[TRTLLM-12669][perf] bypass rejection sampling when batch is all-greedy
For all-greedy batches, rejection sampling acceptance is equivalent to
argmax. Skip it (and the associated draft-prob computation) to save the
rejection kernel and a softmax pass. Affects:
- _can_use_rejection_sampling in interface.py and eagle3_dynamic_tree.py
- _compute_and_store_draft_probs call in eagle3.py
Also revert the use_rejection_sampling exception in the populate fast-path
since the rejection path is no longer reachable when all-greedy.
Signed-off-by: ZhaoyangWang <zhaoyangw@nvidia.com>1 parent 5a9f690 commit 903b453
3 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
762 | 765 | | |
763 | 766 | | |
764 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
953 | | - | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
954 | 960 | | |
955 | 961 | | |
956 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
657 | | - | |
658 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
| |||
1030 | 1031 | | |
1031 | 1032 | | |
1032 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
1033 | 1036 | | |
1034 | | - | |
| 1037 | + | |
| 1038 | + | |
1035 | 1039 | | |
1036 | 1040 | | |
1037 | 1041 | | |
| |||
0 commit comments