-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Perf] Use flashinfer_trtllm by default for speculative_moe_runner_backend
#16279
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
base: main
Are you sure you want to change the base?
[Perf] Use flashinfer_trtllm by default for speculative_moe_runner_backend
#16279
Conversation
Summary of ChangesHello @b8zhong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the default backend for the speculative Mixture-of-Experts (MoE) runner to Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request removes a temporary workaround that prevented flashinfer_trtllm from being used as the speculative MoE backend. This is a good cleanup. I've left one comment regarding the default behavior for certain model configurations that might need another look. Also, as you've noted, the performance regression with flashinfer_trtllm needs to be addressed before this can be merged.
I am having trouble creating individual review comments. Click here to see my feedback.
python/sglang/srt/server_args.py (2003-2016)
Removing this workaround is a good step towards enabling flashinfer_trtllm for speculative MoE.
However, it seems that for DeepSeek V3 models with modelopt_fp4 quantization, the default speculative_moe_runner_backend is still set to 'triton' within the _handle_model_specific_adjustments method (specifically around line 1191).
Given the PR's goal to use flashinfer_trtllm by default and the new support for RoutingMethodType=DeepseekV3 in Flashinfer, should this default also be updated to flashinfer_trtllm to fully align with the intention of this PR?
Motivation
Depends on Flashinfer 0.6.0
Currently, the MTP layer (BF16 x BF16) use Triton for the Fused MoE backend. The drafting stage is a small portion of E2E performance, but it can make a bigger difference at higher concurrency.
Modifications
Remove the change from
autototriton, as RoutingMethodType=DeepseekV3 is supported in flashinfer-ai/flashinfer#2234 commit of FlashinferAccuracy Tests
TODO: after the acceptance length issue is fixed.
Benchmarking and Profiling
Draft layer
Before:
After:
Anyway, the root problem is the acceptance length drop, likely because the routing method for MTP layer may not be correctly inferred. Investigating the issue. @samuellees
Checklist