-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Bugfix] fix use_atomic_add support of marlin kernel when using v1 engine #15946
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
[Bugfix] fix use_atomic_add support of marlin kernel when using v1 engine #15946
Conversation
Signed-off-by: Jinzhen Lin <[email protected]>
👋 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 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 🚀 |
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.
Interesting.. if we can do the logic in the c++ then why not move it all there? I'm sure we have the information on n and k at that level. cc @bnellnm @ProExpertProg that might know why this specific operation fails compilation
If I had to guess, looking at m in python is traced by Dynamo, and because m is dynamic and used in a max expression, the compilation gets specialized for m and then we potentially recompile when m is different. I'll look at the repro to make sure there aren't other footguns here. And we should add this case to compilation tests. |
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.
Okay feel free to add as a test case Luka, for now we can land
BTW @jinzhen-lin it would be great if you could join the developer slack to participate in discussions (https://slack.vllm.ai/). We've been refactoring fused moe recently. Unrelated to this PR, but could you consider adding support for channelwise scales for moe_wna16? There are several places that assume that |
I would develop the channelwise quantization if I have time. BTW, #14447 support channelwise quantization and have better performance than triton/cuda version. |
…gine (vllm-project#15946) Signed-off-by: Jinzhen Lin <[email protected]> Signed-off-by: Louis Ulmer <[email protected]>
…gine (vllm-project#15946) Signed-off-by: Jinzhen Lin <[email protected]>
Btw, I wasn't able to reproduce this (I made sure I used a commit before this one was merged), but ping me if similar issues occur |
…gine (vllm-project#15946) Signed-off-by: Jinzhen Lin <[email protected]> Signed-off-by: Yang Wang <[email protected]>
…gine (vllm-project#15946) Signed-off-by: Jinzhen Lin <[email protected]>
…gine (vllm-project#15946) Signed-off-by: Jinzhen Lin <[email protected]> Signed-off-by: Mu Huai <[email protected]>
#14138 optimized the marlin kernel and introbuted a new parameter
use_atomic_add
and new env varVLLM_MARLIN_USE_ATOMIC_ADD
. However, when using it with V1 engine, we would got an error likeTo reproduce
I don't sure the actual reason, but I found that if I don't use
m
(input_size) as a part of the condition indicated whether we use atomic add or not, the error is gone.This PR fix this problem by moving the condition of
m
to c++ code. This would also improve kernel performance of some special case, since marlin may launch several kernels with differentm
size in singlegptq_marlin_gemm
.