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

make fused_moe_kernel's EM and num_valid_tokens arguments do_not_specialize #11057

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

Conversation

JiayiFeng
Copy link

@JiayiFeng JiayiFeng commented Dec 10, 2024

see #11056 for more details.

In the latest Triton release 3.1.0, do_not_specialize is used to indicate arguments that do not require kernel specialization. However, in the latest Triton main branch, a new do_not_specialize_on_alignment has been added to specify arguments that should not be specialized due to memory alignment reasons, which is more precisely what we need.
see: https://github.com/triton-lang/triton/blob/main/python/test/unit/runtime/test_cache.py#L56-L60

Therefore, I have added compatibility in my code: if the do_not_specialize_on_alignment is available, it will be used; if not, it will fall back to using do_not_specialize.

results:

# with A100
python ./benchmark_throughput.py --model=Qwen/Qwen2-57B-A14B-Instruct -tp 4 --dataset=./ShareGPT_V3_unfiltered_cleaned_split.json

w/o this fix:
Throughput: 10.60 requests/s, 4443.34 total tokens/s, 2139.29 output tokens/s

w/ this fix:
Throughput: 13.46 requests/s, 5640.88 total tokens/s, 2715.86 output tokens/s

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.

🚀

@JiayiFeng JiayiFeng changed the title make fused_moe_kernel's 'EM' and ‘num_valid_tokens‘ arguments do_not_specialize` make fused_moe_kernel's 'EM' and ‘num_valid_tokens‘ arguments do_not_specialize Dec 10, 2024
@JiayiFeng JiayiFeng changed the title make fused_moe_kernel's 'EM' and ‘num_valid_tokens‘ arguments do_not_specialize make fused_moe_kernel's EM and num_valid_tokens arguments do_not_specialize Dec 10, 2024
@JiayiFeng
Copy link
Author

JiayiFeng commented Dec 12, 2024

Could you please take a look at this PR? Any comments would be appreciated!
@WoosukKwon @esmeetu

jiayifeng added 4 commits December 12, 2024 20:52
Signed-off-by: jiayifeng <[email protected]>
Signed-off-by: jiayifeng <[email protected]>
Signed-off-by: jiayifeng <[email protected]>
@JiayiFeng
Copy link
Author

cc: @zwd003 @pcmoritz

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