Skip to content

Conversation

tlrmchlsmth
Copy link
Member

@tlrmchlsmth tlrmchlsmth commented Jun 3, 2025

Purpose

This PR fixes the check for is_internode in the A2A communicators.

The function in_the_same_node_as(cpu_group, source_rank=0) returns a list of bools but it was being used as if it returned a single bool. Since the list is is not empty, is_intranode would alway be true.

Also removes the hack from #19034

Test Plan + Result

Successfully ran DSv2 Coder Lite with DP8 on one 8xH200 node and DP16 across two

Signed-off-by: Tyler Michael Smith <tysmith@redhat.com>
Signed-off-by: Tyler Michael Smith <tysmith@redhat.com>
Copy link

github-actions bot commented Jun 3, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

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.

Hello @tlrmchlsmth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request addresses an issue in the A2A communicators where the is_internode check was not functioning correctly. The in_the_same_node_as function returns a list of booleans, but it was being treated as a single boolean value, causing is_intranode to always evaluate to true. I have corrected this by ensuring that is_internode is determined by checking if all ranks in the CPU group are on the same node. Additionally, I have removed a temporary workaround that was previously implemented.

Highlights

  • Bug Fix: Corrects the logic for determining is_internode in A2A communicators by ensuring that all ranks are checked to be on the same node.
  • Code Removal: Removes a temporary workaround related to disabling pplx-a2a intranode communication.
  • Assertion Removal: Removes unnecessary assertions related to self.intranode in _make_all2all_kwargs.

Changelog

  • vllm/distributed/device_communicators/all2all.py
    • Removes the temporary workaround that disabled pplx-a2a intranode communication (lines 87-89 before diff, line 87 after diff).
    • Removes assertions related to self.intranode in _make_all2all_kwargs (line 181 before diff, removed after diff).
    • Removes assertions related to self.intranode in _make_all2all_kwargs (line 246 before diff, removed after diff).
  • vllm/distributed/device_communicators/base_device_communicator.py
    • Corrects the logic for setting self.internode to properly check if all ranks are on the same node (lines 52-53 before diff, line 52 after diff).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A boolean's true or false,
A list of booleans? A farce!
Internode's plight,
Now shining bright,
Fixed logic sets a new course.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 PR provides a crucial bugfix for the is_internode check in A2A communicators. The identified issue with in_the_same_node_as returning a list and its previous incorrect usage as a single boolean is well-addressed. The fix self.internode = not all(in_the_same_node_as(...)) is correct and elegant.
The associated cleanups in all2all.py, such as removing the hardcoded self.internode = True hack and the now-redundant assertions, are also well-executed and improve code clarity.
Overall, the changes are of high quality and directly resolve the reported problem.

A minor note on the PR description: the link https://github.com/vllm-project/vllm/pull/19034 seems to be a placeholder or typo, as it doesn't point to an existing PR. It might be helpful to update this if it refers to a specific past PR that introduced the hack.

Summary of Findings

  • Clarity of internode calculation: In vllm/distributed/device_communicators/base_device_communicator.py, the calculation self.internode = not all(in_the_same_node_as(cpu_group, source_rank=0)) is correct. A brief comment explaining that in_the_same_node_as returns a list of booleans and why not all() is used could enhance readability for future maintainers. This was not added as a review comment due to severity settings (this is a 'low' severity suggestion).

Merge Readiness

The pull request effectively addresses a critical bug in determining inter-node vs. intra-node communication. The code changes are clear, correct, and include necessary cleanups. The core fix in base_device_communicator.py is sound.
From a code perspective, this PR appears ready for merging. However, given the critical nature of distributed communication, thorough testing across various multi-node and single-node multi-GPU configurations is essential to confirm the fix. The PR description currently lacks details on the test plan and results.
I am not authorized to approve pull requests, but based on the code review, if testing confirms the fix, it should be safe to merge.

@tlrmchlsmth tlrmchlsmth added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 4, 2025
@tlrmchlsmth tlrmchlsmth marked this pull request as ready for review June 4, 2025 13:10
@varun-sundar-rabindranath
Copy link
Contributor

varun-sundar-rabindranath commented Jun 4, 2025

DP=2 + TP=2 + EP

VLLM_ALL2ALL_BACKEND="pplx"   vllm serve deepseek-ai/DeepSeek-V2-Lite                 --trust-remote-code                 --tensor-parallel-size 2                 --data-parallel-size 2                  --enable-expert-parallel                 --no-enable-prefix-caching                 --gpu-memory-utilization 0.80                 --port 9010

is broken on main

This PR fixes it 🎉

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

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

thanks for the great investigation! sorry for the oversight.

@youkaichao youkaichao merged commit d459fae into main Jun 4, 2025
84 checks passed
@youkaichao youkaichao deleted the fix_intranode_check branch June 4, 2025 15:39
patrickvonplaten pushed a commit to patrickvonplaten/vllm that referenced this pull request Jun 5, 2025
Signed-off-by: Tyler Michael Smith <tysmith@redhat.com>
Signed-off-by: Patrick von Platen <patrick.v.platen@gmail.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants