[Model Runner V2] Enable forcing a specific acceptance rate during rejection sampling (#38045)
Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
This commit is contained in:
@@ -58,7 +58,7 @@ SpeculativeMethod = Literal[
|
||||
EagleModelTypes,
|
||||
NgramGPUTypes,
|
||||
]
|
||||
RejectionSampleMethod = Literal["strict", "probabilistic"]
|
||||
RejectionSampleMethod = Literal["strict", "probabilistic", "synthetic"]
|
||||
|
||||
|
||||
@config
|
||||
@@ -184,6 +184,13 @@ class SpeculativeConfig:
|
||||
distribution, but the latter yields a higher acceptance rate at the cost
|
||||
of more memory to cache draft logits."""
|
||||
|
||||
synthetic_acceptance_rate: float | None = None
|
||||
"""Average acceptance rate for synthetic rejection sampling. Draft
|
||||
tokens are accepted with a position-dependent probability that decays
|
||||
geometrically, calibrated so that the mean rate across all speculative
|
||||
positions equals this value. Only used when rejection_sample_method
|
||||
is 'synthetic'. Must be in [0, 1]."""
|
||||
|
||||
def compute_hash(self) -> str:
|
||||
"""
|
||||
WARNING: Whenever a new field is added to this config,
|
||||
|
||||
Reference in New Issue
Block a user