Skip to content

vllm.v1.worker.gpu.spec_decode.standalone_ar.config

Classes:

StandaloneARSpeculatorConfig

Bases: DraftModelSpeculatorConfig

A speculator that drafts autoregressively with its own draft model.

Source code in vllm/v1/worker/gpu/spec_decode/standalone_ar/config.py
class StandaloneARSpeculatorConfig(DraftModelSpeculatorConfig):
    """A speculator that drafts autoregressively with its own draft model."""

    base_method = "draft_model"
    speculator_class = (
        "vllm.v1.worker.gpu.spec_decode.standalone_ar.speculator.StandaloneARSpeculator"
    )
    draft_has_own_vocab = True
    # An independent model with its own positional limit.
    shares_target_positions = False

    @property
    def num_lookahead_tokens(self) -> int:
        return self.num_speculative_tokens

    @property
    def max_num_new_slots_for_drafting(self) -> int:
        if self.spec_config.parallel_drafting:
            # PARD does not shift the existing input, so all K query positions
            # require additional slots.
            return self.num_speculative_tokens
        # The autoregressive draft-model input retains one unsliced token.
        return 1