This pull request refactors the speculative decoding proposer interface
to align with upstream vLLM, removing the local `Proposer` interface and
renaming methods to `propose`.
This is the first step. In the future we should remove the class
register and just add few Ascend specified method once the arch in vLLM
is ready.
- vLLM version: v0.16.0
- vLLM main:
15d76f74e2
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
25 lines
717 B
Python
25 lines
717 B
Python
from vllm.v1.spec_decode.suffix_decoding import SuffixDecodingProposer
|
|
|
|
|
|
class AscendSuffixDecodingProposer(SuffixDecodingProposer):
|
|
def __init__(self, vllm_config, runner):
|
|
super().__init__(vllm_config)
|
|
self.runner = runner
|
|
|
|
def dummy_run(
|
|
self,
|
|
num_tokens,
|
|
with_prefill=None,
|
|
in_graph_capturing=None,
|
|
num_reqs=None,
|
|
num_tokens_across_dp=None,
|
|
aclgraph_runtime_mode=None,
|
|
batch_descriptor=None,
|
|
dummy_compute_logits=lambda hidden_states: None,
|
|
is_profile=False,
|
|
):
|
|
pass
|
|
|
|
def propose(self, valid_sampled_token_ids):
|
|
return super().propose(self.runner.input_batch, valid_sampled_token_ids)
|