-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[ROCm][Bugfix] Fixed several bugs related to rccl path and attention selector logic #3699
Conversation
Thanks for the contribution! Some comments: Because we For the Furthermore, pytorch uses https://pypi.org/project/nvidia-nccl/ as a pip package to maintain |
I agree your method of finding |
In summary, the following information would be greatly helpful:
I can provide the above information for nvidia case, for your reference:
|
@@ -41,7 +48,7 @@ | |||
if torch.version.cuda is not None: | |||
so_file = "libnccl.so.2" | |||
elif torch.version.hip is not None: | |||
so_file = "librccl.so.2" | |||
so_file = "librccl.so.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at https://rocm.docs.amd.com/projects/rccl/en/latest/api.html , and it says the current version is 2.18.3
. Quite strange that the library name is librccl.so.1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is why I am not assuming what the suffix is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you talk to rccl
team why this is the case? If they keep librccl.so.1
that would also be fine, but just please don't be too random.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial test with the current head is that, it does not work for ROCm. There are a bunch of other issues in addition to the ones described in this pull request.
We have tested using cupy and verified that it worked for the hipgraph path with our in-development newer ROCm.
However, this does not work for us.
Another thing, is that, will it be possible we can still opt in using cupy for all-reduce? Can it be abstracted so that people can choose use cupy, nccl, or, whatever?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as how rccl so file name and its version definition: I found information ROCm/rccl repo. Links below:
https://github.com/ROCm/rccl/blob/2f6d59e2e651914d9d6e51b2b702b9a9ac0ea99d/makefiles/version.mk#L2
and
https://github.com/ROCm/rccl/blob/2f6d59e2e651914d9d6e51b2b702b9a9ac0ea99d/CMakeLists.txt#L669C1-L669C19
Hope this answers your question. Let's take a step back, we want to solve the problem of cudagraph mode.
My understanding is that below are possible ways :
- cupy
- user-defined nccl/rccl
- custom all reduce
- pytorch native all-reduce
How we can easily choose one over the other and what is our long-term plan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cupy
is deprecated and removed now, because we got many bug report with regard to cupy
.
pytorch native all-reduce is not available in cudagraph mode, because it usually contains some additional check that will fail graph capture.
Going forward, we will focus on the pynccl
wrapper as the first choice, and custom all reduce as a backup plan (it is disabled by default because of instability).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youkaichao Our users need the fixes for the other part like the one related to naive attention, since now it becomes the default for those users and it was quite slow.
I need to simplify this PR so that it will be merged quickly
The short answer for how pytorch finds rccl during its build, is in its cmake mechanism. By default, it finds rccl related version information in /opt/rocm/lib/cmake/rccl directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with the modification in pynccl.py
. Please ping others for approval on the other parts.
cc @simon-mo @WoosukKwon Please take a look at this one since right now users complained that naive attention is used which is 10x slower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the fix and apologies for the late review.
FILL IN THE PR DESCRIPTION HERE
FIX #xxxx (link existing issues this PR will resolve)
This pull request fixes several bugs introduced in previous commits, for example: #3661, #3625 , and previous refactoring in attention backend.
(1) Fixed the librccl.so file name, it should be something like:
/opt/rocm/lib/librccl.so.1
(2) a bug related to check whether to use ref-attention resulted from previous refactoring:
Before: even flash-attn is available, it uses naive attention, which is quite slow for our users and is not intended.
Now:
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!