Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vllm_ascend/attention/dsa_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def build_req_metadata(
self.block_table[: self.num_decodes],
self.speculative_config.num_speculative_tokens,
self.model_config.hf_config.sliding_window,
self.block_size,
self.storage_block_size,
query_start_loc[: self.num_decodes + 1],
self.seq_lens[: self.num_decodes],
self.num_decode_tokens,
Expand Down
5 changes: 4 additions & 1 deletion vllm_ascend/models/deepseek_v4/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,14 +814,17 @@ def make_empty_intermediate_tensors(
# when speculative decoding is enabled; allocating it unconditionally
# would permanently cost max_num_batched_tokens * hc_dim per rank.
spec_config = vllm_config.speculative_config
needs_mtp_hidden_states = spec_config is not None and (
spec_config.use_eagle() or spec_config.uses_draft_model()
)
Comment on lines +817 to +819

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

In vLLM, uses_draft_model is a property on SpeculativeConfig, not a method. Calling spec_config.uses_draft_model() will raise a TypeError: 'bool' object is not callable. Please access it as a property without parentheses: spec_config.uses_draft_model.

Additionally, verify if use_eagle is also a property or a method on your SpeculativeConfig class to avoid similar errors.

Suggested change
needs_mtp_hidden_states = spec_config is not None and (
spec_config.use_eagle() or spec_config.uses_draft_model()
)
needs_mtp_hidden_states = spec_config is not None and (
spec_config.use_eagle() or spec_config.uses_draft_model
)

self._mtp_hidden_buffer = (
torch.empty(
vllm_config.scheduler_config.max_num_batched_tokens,
hc_dim,
dtype=vllm_config.model_config.dtype,
device=self.device,
)
if spec_config is not None and spec_config.method == "mtp"
if get_pp_group().is_last_rank and needs_mtp_hidden_states
else None
)

Expand Down
Loading