Skip to content

[Bug]: when user MTP method will cause UnboundLocalError #23342

@xyxinyang

Description

@xyxinyang

Your current environment

The output of python collect_env.py
vLLM Version                 : 0.10.1.2.dev0+g1da94e673.d20250821 (git sha: 1da94e673, date: 20250821)
GPU : NVIDIA H800
CUDA used to build PyTorch   : 12.6

🐛 Describe the bug

When use the following command starts MTP service,error occurred:

VLLM_USE_V1=1 \
python -m vllm.entrypoints.openai.api_server \
    --port 8500 \
    --dtype bfloat16 \
    --trust-remote-code \
    --model baidu/ERNIE-4.5-21B-A3B-PT \
    --served-model-name ERNIE-4.5-21B \
    --speculative-config '{"method": "ernie_mtp","model": "/root/paddlejob/zhouchong/ERNIE-4.5-21B-A3B-PT" ,"num_speculative_tokens": 1}'
Image

it because when use mtp method, "hidden_states" is not defined

Image

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions