-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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][ROCm][AMD] Add optional torchrun multi GPU executor #3691
Conversation
@zhuohan123 Could you please take a look at this? This PR is pretty interesting. |
@gshtras correct me if I'm wrong but I think this will only work for launching self-contained offline batch jobs? For interactive cases including deploying as an API server, additional coordination would be needed to distribute new requests and cancellations in a fully synchronized manner. So some kind of separate front-end and RPC setup would be needed, and may defeat the purpose of what you're trying to achieve here.
Are these issues somehow unique to the combination of ROCm and ray? I'm a bit confused about how this would be a ROCm-specific thing. I do have an idea of what the problem is and actually am working on another change that should hopefully help. But it's more about how the TP coordination is done in general and not specific to ROCm. Perhaps you could try out #3466 in the meantime? (we're keen to get that merged soon!). I don't expect it will address the TP latency issues you're seeing by itself, but may be interesting to check just in case. |
Just to elaborate on this a bit. AFAIK the entrypoint for torchrun is the same for every process. So there would need to be a check to only start the api server if rank==0, the other procs should just enter a loop similar to this. But then there's nothing to signal them to restart the loop when new requests arrive (they would have to just wait on the nccl broadcast which will freeze the process and fatally timeout), or to handle other tasks like adding/removing lora adapters. One possibility that would take #3763 further is to have the workers in fact wait on the broadcast operation but for the driver worker to wake them up every few seconds when idle to avoid NCCL timeout. This could avoid the need for any additional RPC mechanism... |
That is a good point, this mode wasn't taken into consideration. Since as you mention there doesn't seem to be an obvious easy way of syncing things, I think it's best to restrict the new executor from being used in the interactive mode.
Will take a look, thanks |
a384ade
to
f3746f7
Compare
Lately mp executor shows even better number. So this one is no longer required |
Adding a new multi GPU executor based on torchrun parallel execution for ROCm runs.
This can be overridden by explicitly passing the existing worker_use_ray flag.
The goal is to address the latency issues on TP>1 when using ray on ROCm
The new executor is based on the existing GPUExecutor, except in the torchrun model since the entire main module is run multiple times in parallel, we'll have multiple instances of it.
The concept of having a driver worker and a pool of supplementary workers is preserved, as well as how the model is sliced between them.
The rank, the device ordeal and whether the current executor holds the driver worker is defined by environment variables set by torchrun.
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Model]
for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]
For changes on the vLLM frontend (e.g., OpenAI API server,LLM
class, etc.)[Kernel]
for changes affecting CUDA kernels or other compute kernels.[Core]
for changes in the core vLLM logic (e.g.,LLMEngine
,AsyncLLMEngine
,Scheduler
, etc.)[Hardware][Vendor]
for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]
).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.sh
to format your code.docs/source/
if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-required
and might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-required
label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!