Use FlashInfer tinygemm for GPT-OSS MoE router on SM90+#20755
Use FlashInfer tinygemm for GPT-OSS MoE router on SM90+#20755Qiaolin-Yu merged 10 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello, 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 significantly enhances the performance of the GPT-OSS Mixture-of-Experts (MoE) router by leveraging the tinygemm_bf16 kernel from the FlashInfer library. This targeted optimization, active on SM90+ NVIDIA GPUs, aims to reduce latency and increase throughput for small GEMM operations within the router, as evidenced by the provided benchmarks, while maintaining model accuracy. 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. Changelog
Activity
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.
Code Review
This pull request introduces a performance optimization for the GPT-OSS MoE router on SM90+ GPUs by using the tinygemm_bf16 kernel from FlashInfer. A new GptOssRouterLinear class is implemented with a fast path for bfloat16 data types on supported hardware, including necessary checks and a safe fallback to the original implementation. The changes are well-contained and appear correct. The provided benchmarks show a performance improvement.
|
/rerun-failed-ci |
|
@Qiaolin-Yu comments addressed, and here are the decoding results for bs 64 and 128 bs = 64
bs = 128
|
Qiaolin-Yu
left a comment
There was a problem hiding this comment.
lgtm. let's wait for CIs.
|
@Qiaolin-Yu any blockers to merge this? |
|
@elvischenv what's your github email? will add you as a coauthor when merging. |
@Qiaolin-Yu Thank you, please use this one: 219235043+elvischenv@users.noreply.github.com |
…20755) Co-authored-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
…20755) Co-authored-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
…20755) Co-authored-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
…20755) Co-authored-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
…20755) Co-authored-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Summary
FlashInfer 0.6.6 (actually 0.6.5) added
tinygemm_bf16, a faster kernel for small GEMMs. This applies it to the GPT-OSS MoE router on SM90+.Accuracy Test (GPQA)
Before:
After:
Benchmarking and Profiling
Before:
After: