[Fix] deepseek_v4: Fix mHC prewarm when chunked prefill is disabled (#43448)

This commit is contained in:
maocheng23
2026-10-21 15:21:31 -07:00
committed by GitHub
parent 99cf403c9e
commit 4b9936b5e3
+5 -1
View File
@@ -858,7 +858,11 @@ def prewarm_mhc_pre(
from sglang.srt.runtime_context import get_schedule
hc_mult, hidden_size = residual.shape[-2], residual.shape[-1]
max_num_tokens = get_schedule().chunked_prefill_size
schedule = get_schedule()
max_num_tokens = schedule.chunked_prefill_size
if max_num_tokens is None or max_num_tokens <= 0:
# Chunked prefill disabled: bound by the prefill token budget.
max_num_tokens = schedule.max_prefill_tokens
buckets = get_mhc_pre_token_count_representatives(
max_num_tokens, hc_mult * hidden_size
)