Support loading sample_from_anchor flag from speculators config (#48639)
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
This commit is contained in:
co-authored by
Michael Goin
parent
5feb3950e5
commit
642076d26c
@@ -57,6 +57,15 @@ class DFlashSpeculator(DraftModelSpeculator):
|
||||
# Whether the anchor query position is itself a prediction. DFlash default uses
|
||||
# the anchor as the bonus token (only mask tokens predict); DSpark samples from
|
||||
# the anchor and the N-1 mask token positions. See _prepare_dflash_inputs_kernel
|
||||
dflash_config = (
|
||||
getattr(self.draft_model_config.hf_config, "dflash_config", None) or {}
|
||||
)
|
||||
if dflash_config.get("sample_from_anchor", False):
|
||||
raise ValueError(
|
||||
"sample_from_anchor=True is not supported for DFlash. "
|
||||
"DFlash uses a fixed 1+N query layout where the anchor "
|
||||
"is the bonus token."
|
||||
)
|
||||
self.sample_from_anchor = False
|
||||
|
||||
# Context positions for the K/V precompute. Populated by
|
||||
|
||||
Reference in New Issue
Block a user