[BugFix][CPU][Spec Decode] Fix Eagle implementation on CPU backend (#42468)

Signed-off-by: Ofir Zafrir <ofir.zafrir@intel.com>
This commit is contained in:
Ofir Zafrir
2026-05-19 03:16:07 +00:00
committed by GitHub
parent afd7b1dce9
commit 8f16c4a5c0
3 changed files with 28 additions and 21 deletions
+4
View File
@@ -313,6 +313,10 @@ def apply_top_k_top_p(
if p is None and k is None:
return logits
# Keep CPU logits on the PyTorch path to avoid invoking Triton kernels.
if current_platform.is_cpu():
return apply_top_k_top_p_pytorch(logits, k, p, allow_cpu_sync=True)
if HAS_TRITON and logits.shape[0] >= 8:
return apply_top_k_top_p_triton(logits, k, p)