Skip to content

Qwen3.5 MTP: extract selected tokens earlier#1892

Open
ikawrakow wants to merge 1 commit into
mainfrom
ik/qwen_mtp_inp_out_ids
Open

Qwen3.5 MTP: extract selected tokens earlier#1892
ikawrakow wants to merge 1 commit into
mainfrom
ik/qwen_mtp_inp_out_ids

Conversation

@ikawrakow

Copy link
Copy Markdown
Owner

When accepting tokens with the draft model, instead of 1st computing the entire attention and then extracting the requested token(s) (which is basically always just the last token), pass the requested output ids to the build_std_attention function, which has the functionality built in. This reduces the cost of the multiplication with the attention output tensor.

It is a very minor optimization, so the main motivation was to make the MTP graph more standard.

I do see 1-2% TG performance improvement for Qwen3.5-9B. For the larger models it is within the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant