Commit 1f496a1
committed
Fix draft logprobs zeros bug and add acceptance sanity checks
Bug #1: EAGLE tree proposal returned zeros for draft_logprobs
- Root cause: When using topk for tree branching, code set draft_logp_list=None,
then created zeros tensor as fallback (lines 850-851)
- Fix: Compute actual log-probs from logits using log_softmax + gather
- Applied at 2 locations: root level (lines 698-704) and tree levels (lines 839-846)
Bug #2: Added diagnostic logging in rejection sampler
- Log draft_p (nonzero) min/med/max to detect zeros
- Log p_target min/med/max to detect degenerate softmax
- Helps identify if target logits are masked/filtered before sampling
Expected results after fix:
- draft_logp: -3.2/-1.6/-0.0 (real log-probs, all ≤ 0) instead of 0/0/0
- p_target: 1e-6/1e-3/0.7 (realistic distribution) instead of 1/1/1
- Acceptance rate: 30-70% instead of 0%
Files changed:
- vllm/v1/spec_decode/eagle.py: Fix draft_logp computation
- vllm/v1/sample/rejection_sampler.py: Add sanity logging1 parent 16cdf4f commit 1f496a1
2 files changed
+29
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
127 | 147 | | |
128 | 148 | | |
129 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
698 | 699 | | |
699 | 700 | | |
| 701 | + | |
| 702 | + | |
700 | 703 | | |
701 | | - | |
| 704 | + | |
702 | 705 | | |
703 | 706 | | |
704 | 707 | | |
| |||
833 | 836 | | |
834 | 837 | | |
835 | 838 | | |
| 839 | + | |
836 | 840 | | |
837 | 841 | | |
838 | 842 | | |
| 843 | + | |
| 844 | + | |
839 | 845 | | |
840 | | - | |
841 | | - | |
| 846 | + | |
842 | 847 | | |
843 | 848 | | |
844 | 849 | | |
845 | 850 | | |
846 | 851 | | |
847 | 852 | | |
848 | 853 | | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
| 854 | + | |
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
| |||
0 commit comments