-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Kernel] Prototype integration of bytedance/flux kernels #5917
Conversation
Tested in 13B model, it is more than 40% slower than the main branch. Is there a better optimization solution? Thanks |
@Rainlin007 Could you share your test setup and numbers? There are a couple of things that can be done to improve this PR's performance:
After that, I think we'll see speedup on prefills and hopefully large batch size decodes. |
Which shape/model are you using? It’s possible that the default GEMM configuration performs poorly at this size. I can retune a GEMM configuration. Thank you. |
@zheng-ningxin, @Rainlin007's comment was also posted on an earlier version of this PR, so @Rainlin007 you might want to try again now that I'm seeing speedup on my end. |
Hey @tlrmchlsmth, is there any blocking issue to merge this PR (other than the format issue)? Please let us know if anything we could help to make this happen. :) cc @zheng-ningxin |
Hey @wenlei-bao, one blocking issue is that this PR requires Beyond that, I need to do some benchmarking and develop some heuristics to decide when this optimization makes sense. The other thing worth mentioning is that ultimately, we don't want to rely on changing the model definition for the integration of the Flux kernels, but I think that the torch.compile rewrites are going slowly enough that it shouldn't block this PR from landing. |
Unsubscribe
…On Wed, 14 Aug, 2024, 2:14 am Tyler Michael Smith, ***@***.***> wrote:
Hey @wenlei-bao <https://github.com/wenlei-bao>, one blocking issue is
that this PR requires enforce_eager be true. That is, the last time I
tried it, the Flux kernels don't support CUDA graphs. Do you know if this
is still the case?
Beyond that, I need to do some benchmarking and develop some heuristics to
decide when this optimization makes sense. The other thing worth mentioning
is that ultimately, we don't want to rely on changing the model definition
for the integration of the Flux kernels, but I think that the torch.compile
rewrites are going slowly enough that it shouldn't block this PR from
landing.
—
Reply to this email directly, view it on GitHub
<#5917 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCU643TZOORBWFLJ3QNZFSLZRJVZNAVCNFSM6AAAAABKAKFAIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBXGEYDINJXGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes, we don't support/need CUDA graph yet.
Regarding the heuristics, you might also want to explore the scripts that in Flux tools/ folder for tuning different workloads (if apply), and incorporate different tiling choices for example to your heuristics (if to skip) or (in Flux tuning_config/ config files
Sounds great! Looking forward to it. @tlrmchlsmth |
Abandoning this in favor of #9886! |
Summary
This is a rough prototype integration of the fused Gemm-ReduceScatter and AllGather-Gemm kernels from https://github.com/bytedance/flux.
The overall goal is to improve performance in the multi-GPU case by hiding the latency of collective communications by overlapping compute and data movement.
Instructions
To use this PR, first follow the instructions from the flux repo to build a wheel and then install it. You will also need to source the
flux_env.sh
file included in this PR. I had to manually setLD_LIBRARY_PATH
to contain my venv'slib
directory as well.Performance
I am running the following to measure the latency of a request dominated by a large prefill:
On 4 A100's:
This PR:
main:
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!