[Core][V1] Support trace_decode_token_ids for deterministic decode replay (#46701)
Signed-off-by: ianzxliu <ianzxliu@tencent.com> Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: Zhixia Liu <liuzhixia.nju@gmail.com> Co-authored-by: ianzxliu <ianzxliu@tencent.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
co-authored by
ianzxliu
Claude
aoshen02
Codex
Nick Hill
parent
754e1c3de4
commit
a1c5b1fd9f
@@ -262,6 +262,12 @@ class ModelConfig:
|
||||
equivalent exponential-race sampling. FP64 preserves lower-tail sampling
|
||||
events that fp32 uniform/exponential draws can truncate, at the cost of
|
||||
significantly lower throughput on most GPUs."""
|
||||
enable_trace_replay: bool = False
|
||||
"""Whether to allow requests to set
|
||||
`SamplingParams.trace_decode_token_ids`, which forces decoding to follow a
|
||||
predetermined token sequence while still computing real logprobs. Reserved
|
||||
for debugging and RL workflows: enabling it reserves a per-request trace
|
||||
buffer, so it is off by default."""
|
||||
disable_sliding_window: bool = False
|
||||
"""Whether to disable sliding window. If True, we will disable the sliding
|
||||
window functionality of the model, capping to sliding window size. If the
|
||||
@@ -424,6 +430,7 @@ class ModelConfig:
|
||||
"return_sampling_mask",
|
||||
"logprobs_mode",
|
||||
"use_fp64_gumbel",
|
||||
"enable_trace_replay",
|
||||
"disable_cascade_attn",
|
||||
"skip_tokenizer_init",
|
||||
"served_model_name",
|
||||
|
||||
@@ -1091,6 +1091,13 @@ class VllmConfig:
|
||||
"are normalized over the same nucleus as the sampling mask"
|
||||
)
|
||||
|
||||
def _verify_trace_replay_config(self) -> None:
|
||||
model_config = self.model_config
|
||||
if model_config is None or not model_config.enable_trace_replay:
|
||||
return
|
||||
if not self.use_v2_model_runner:
|
||||
raise ValueError("trace replay requires Model Runner V2")
|
||||
|
||||
def __post_init__(self):
|
||||
"""Verify configs are valid & consistent with each other."""
|
||||
|
||||
@@ -1141,6 +1148,7 @@ class VllmConfig:
|
||||
)
|
||||
|
||||
self._verify_sampling_replay_config()
|
||||
self._verify_trace_replay_config()
|
||||
|
||||
if self.lora_config is not None:
|
||||
self.lora_config.verify_with_model_config(self.model_config)
|
||||
|
||||
Reference in New Issue
Block a user