Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Rank-to-device mapping env var #11662

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

BKitor
Copy link
Contributor

@BKitor BKitor commented Dec 31, 2024

Introduce VLLM_LOCAL_RANK_DEV_MAP to provide a way to assign devices to ranks.
Currently, each device is assigned based on the worker's local_rank. This is fine for systems were all device-to-device routs are identical, but this isn't the true for all systems.

To provide flexibility, the device-to-rank mapping is specified as a JSON object.
This PR implements the following format for mapping TP/PP jobs.

'{ "tp-0" : "[d_tp0-0, d_tp0-1, ..., d_tp0-(npp-1)]",
   "tp-1" : "[d_tp1-0, d_tp1-1, ..., d_tp1-(npp-1)]",
      ...
   "tp-(ntp-1)" : "[d_tpn-0, d_tpn-1, ..., d_tpn-(npp-1)]" }'
Where npp == pipeline-parallel world size
      ntp == tensor-parallel world size
      d_tpx-y is the device ordinal to map to tp-rank x / pp-rank y

Ideally, this format should be extendable to other multi-GPU workloads like data-parallelism (#9206), speculative decoding or disaggregated prefill.

PR also adds benchmark_communication.py which benchmarks communication calls used by parallel_state.py's GroupCoordinator.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

BKitor added 6 commits January 1, 2025 14:18
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
Signed-off-by: Benjamin Kitor <bkitor@gigaio.com>
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