Skip to content

Conversation

@lgeiger
Copy link
Contributor

@lgeiger lgeiger commented Nov 11, 2025

This slightly reduces the overhead of fast_pos_embed_interpolate by using an in-place multiplication. Followup to #26647

In a simple benchmark this speedups the function by ~20% for bfloat16 and ~30% for float32. Nothing major, but it's still a nice win.

Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
@lgeiger lgeiger requested a review from sighingnow as a code owner November 11, 2025 01:33
@mergify mergify bot added the qwen Related to Qwen models label Nov 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a minor but effective optimization in the fast_pos_embed_interpolate function by replacing a standard multiplication with an in-place multiplication. This change correctly reduces memory overhead by avoiding the creation of an intermediate tensor, which, as noted in the description, provides a nice performance improvement. The change is safe as the modified tensor is not used elsewhere. This is a good, clean optimization.

@ywang96 ywang96 added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 11, 2025
@ywang96 ywang96 enabled auto-merge (squash) November 11, 2025 08:08
@ywang96 ywang96 merged commit 9973e6e into vllm-project:main Nov 11, 2025
54 checks passed
@lgeiger lgeiger deleted the qwen3-faster-pos-interp branch November 11, 2025 10:53
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Nov 13, 2025
…roject#28434)

Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants