[Fix] Keep the MiniCPM-SALA config reads visible to the resolution ratchets (#36178)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Alex Nails <alex.nails@radixark.ai>
This commit is contained in:
Shuwen Wang
2026-08-24 16:05:09 -07:00
committed by GitHub
co-authored by Claude Opus 5 Alex Nails
parent 3c481b9421
commit effe0d14d2
3 changed files with 24 additions and 12 deletions
+11 -8
View File
@@ -1235,14 +1235,17 @@ def _minicpm_sala_overrides(server_args: Any, hf_config: Any) -> dict:
"minicpm_flashattn": ("fa4" if is_blackwell_supported() else "fa3"),
"minicpm_flashinfer": "flashinfer",
}
for backend_field in (
"attention_backend",
"prefill_attention_backend",
"decode_attention_backend",
):
dense_backend = dense_backends.get(getattr(server_args, backend_field))
if dense_backend is not None:
overrides[backend_field] = dense_backend
# Literal keys keep the written-field set statically derivable; a loop
# variable hides it from the census in test_chain_read_ratchet.py.
dense_attention = dense_backends.get(server_args.attention_backend)
if dense_attention is not None:
overrides["attention_backend"] = dense_attention
dense_prefill = dense_backends.get(server_args.prefill_attention_backend)
if dense_prefill is not None:
overrides["prefill_attention_backend"] = dense_prefill
dense_decode = dense_backends.get(server_args.decode_attention_backend)
if dense_decode is not None:
overrides["decode_attention_backend"] = dense_decode
elif has_sparse_attention:
uses_sparse_backend = server_args.is_attention_backend_not_set() or any(
backend in ("minicpm_flashattn", "minicpm_flashinfer")
@@ -17,7 +17,7 @@ from sglang.srt.layers.attention.minicpm.attention_adapter import (
)
from sglang.srt.layers.attention.minicpm.cache import attach_compressed_cache
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
from sglang.srt.runtime_context import get_parallel
from sglang.srt.runtime_context import get_parallel, get_schedule
from sglang.srt.utils import is_blackwell_supported, next_power_of_2
if TYPE_CHECKING:
@@ -273,7 +273,7 @@ class MiniCPMSparseBackend(AttentionBackend):
"local_blocks": self.local_blocks,
"dtype_str": dtype_str,
}
chunked_prefill_size = model_runner.server_args.chunked_prefill_size
chunked_prefill_size = get_schedule().chunked_prefill_size
if self.minicpm_fuse_topk and chunked_prefill_size <= 0:
raise ValueError(
"MiniCPM fused top-k requires a positive --chunked-prefill-size."