From a54f0d1049c3acf18047f21e157d6452b7305957 Mon Sep 17 00:00:00 2001 From: Jonathan Mamou Date: Sun, 10 May 2026 15:07:15 +0300 Subject: [PATCH] [CPU] Fix spec decode kernel signatures for synthetic mode compatibility (#41932) Signed-off-by: jmamou Signed-off-by: Jonathan Mamou Co-authored-by: Benjamin Chislett --- vllm/utils/cpu_triton_utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vllm/utils/cpu_triton_utils.py b/vllm/utils/cpu_triton_utils.py index d823e8b14a..ea0383a9d4 100644 --- a/vllm/utils/cpu_triton_utils.py +++ b/vllm/utils/cpu_triton_utils.py @@ -204,8 +204,16 @@ def _rejection_greedy_sample_kernel_impl( bonus_token_ids, is_greedy, max_spec_len, + uniform_probs=None, + synthetic_conditional_rates=None, + SYNTHETIC_MODE=False, ): # C++ kernel expects int64 for all integer tensors. + # Note: uniform_probs, synthetic_conditional_rates, and SYNTHETIC_MODE are + # passed by the rejection sampler for synthetic mode support, but are not + # yet implemented in the C++ CPU kernel. We accept them here to maintain + # compatibility with the kernel calling convention. + assert not SYNTHETIC_MODE, "Synthetic acceptance not supported with CPU sampling" orig_dtype = output_token_ids.dtype output_token_ids_i64 = _ensure_int64(output_token_ids) torch.ops._C.rejection_greedy_sample_kernel_impl( @@ -233,11 +241,18 @@ def _rejection_random_sample_kernel_impl( is_greedy, max_spec_len, vocab_size, + synthetic_conditional_rates=None, NO_DRAFT_PROBS=False, + SYNTHETIC_MODE=False, ): # C++ kernel expects int64 for all integer tensors and float32 for probs. # uniform_probs is intentionally float64 in Python to avoid exact-zero # samples; cast to float32 here for C++ compatibility. + # Note: synthetic_conditional_rates and SYNTHETIC_MODE are passed by the + # rejection sampler for synthetic mode support, but are not yet implemented + # in the C++ CPU kernel. We accept them here to maintain compatibility with + # the kernel calling convention. + assert not SYNTHETIC_MODE, "Synthetic acceptance not supported with CPU sampling" orig_dtype = output_token_ids.dtype output_token_ids_i64 = _ensure_int64(output_token_ids) torch.ops._C.rejection_random_sample_kernel_impl(