minor code sync (#12403)

This commit is contained in:
Lianmin Zheng
2025-10-30 12:49:31 -07:00
committed by GitHub
parent 4d2f17bd0b
commit 6a63a9852e
4 changed files with 32 additions and 27 deletions

View File

@@ -1473,6 +1473,16 @@ class WatchLoadUpdateReq(BaseReq):
loads: List[GetLoadReqOutput]
@dataclass
class SetInjectDumpMetadataReqInput(BaseReq):
dump_metadata: Dict[str, Any]
@dataclass
class SetInjectDumpMetadataReqOutput(BaseReq):
success: bool
@dataclass
class LazyDumpTensorsReqInput(BaseReq):
pass
@@ -1504,6 +1514,3 @@ def _check_all_req_types():
raise ValueError(
f"{name} is a subclass of BaseReq but not follow the naming convention."
)
_check_all_req_types()

View File

@@ -870,13 +870,13 @@ class TokenizerMetricsCollector:
def check_time_to_first_token_straggler(self, value: float) -> bool:
his = self.histogram_time_to_first_token.labels(**self.labels)
total_observations = sum(bucket._value for bucket in his._buckets)
if total_observations < 1000:
if total_observations < 100:
return False
p999_threshold = total_observations * 0.999
p99_threshold = total_observations * 0.99
cumulative_count = 0
for i, bucket in enumerate(his._buckets):
cumulative_count += bucket._value
if cumulative_count > p999_threshold:
if cumulative_count > p99_threshold:
return value >= his._upper_bounds[i]
return False

View File

@@ -135,6 +135,8 @@ GRAMMAR_BACKEND_CHOICES = ["xgrammar", "outlines", "llguidance", "none"]
DETERMINISTIC_ATTENTION_BACKEND_CHOICES = ["flashinfer", "fa3", "triton"]
RADIX_SUPPORTED_DETERMINISTIC_ATTENTION_BACKEND = ["fa3", "triton"]
DEFAULT_LORA_EVICTION_POLICY = "lru"
NSA_CHOICES = [
@@ -190,6 +192,10 @@ def add_deterministic_attention_backend_choices(choices):
DETERMINISTIC_ATTENTION_BACKEND_CHOICES.extend(choices)
def add_radix_supported_deterministic_attention_backend_choices(choices):
RADIX_SUPPORTED_DETERMINISTIC_ATTENTION_BACKEND.extend(choices)
def add_radix_eviction_policy_choices(choices):
RADIX_EVICTION_POLICY_CHOICES.extend(choices)
@@ -1753,13 +1759,17 @@ class ServerArgs:
f"but you explicitly specified '{self.attention_backend}'."
)
if self.attention_backend not in ["fa3", "triton"]:
if is_deepseek_model:
if is_deepseek_model:
if self.attention_backend not in ["fa3", "triton"]:
raise ValueError(
f"Currently only fa3 and triton attention backends are supported for deterministic inference with DeepSeek models. But you're using {self.attention_backend}."
f"Currently only {RADIX_SUPPORTED_DETERMINISTIC_ATTENTION_BACKEND} attention backends are supported for deterministic inference with DeepSeek models. But you're using {self.attention_backend}."
)
# Currently, only FA3 and Triton supports radix cache. Support for other backends is in progress
if (
self.attention_backend
not in RADIX_SUPPORTED_DETERMINISTIC_ATTENTION_BACKEND
):
# Currently, only certain backends support radix cache. Support for other backends is in progress
self.disable_radix_cache = True
logger.warning(
f"Currently radix cache is not compatible with {self.attention_backend} attention backend for deterministic inference. It will be supported in the future."