Skip to content

Conversation

WoosukKwon
Copy link
Collaborator

@WoosukKwon WoosukKwon commented Sep 13, 2025

Currently, broadcast_pp_output complicates the logic in the common non-PP path.
This PR simplifies the logic a bit.

Signed-off-by: Woosuk Kwon <woosuk@thinkingmachines.ai>
@mergify mergify bot added the v1 label Sep 13, 2025
@WoosukKwon WoosukKwon added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 13, 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 provides a nice simplification to the execute_model method in GPUModelRunner. By moving the broadcast_pp_output flag to the __init__ method and restructuring the logic to handle the common (non-broadcast) and rare (broadcast) paths separately, the code becomes much clearer and easier to follow. This refactoring also correctly handles kv_connector_output for pooling models and appears to fix a latent bug where logits were not updated on non-last pipeline parallel ranks after being broadcast. The changes are well-contained and improve both readability and correctness. I have no further suggestions.

model_output_broadcast_data = {
"logits": logits.contiguous(),
} if logits is not None else {}
else:
Copy link
Member

@njhill njhill Sep 13, 2025

Choose a reason for hiding this comment

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

just a thought, could we put the else logic in a different function to be even less intrusive to the common path?

@WoosukKwon WoosukKwon merged commit 3e903b6 into main Sep 14, 2025
58 checks passed
@WoosukKwon WoosukKwon deleted the woosuk/minor-simpl-pool branch September 14, 2025 00:41
dsxsteven pushed a commit to dsxsteven/vllm_splitPR that referenced this pull request Sep 15, 2025
Signed-off-by: Woosuk Kwon <woosuk@thinkingmachines.ai>
bbartels pushed a commit to bbartels/vllm that referenced this pull request Sep 15, 2025
Signed-off-by: Woosuk Kwon <woosuk@thinkingmachines.ai>
Signed-off-by: bbartels <benjamin@bartels.dev>
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
Signed-off-by: Woosuk Kwon <woosuk@thinkingmachines.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants