fix: blockscale moe routine supports non-DS routing#2476
fix: blockscale moe routine supports non-DS routing#2476bkryu merged 2 commits intoflashinfer-ai:mainfrom
Conversation
Summary of ChangesHello @hypdeb, 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 addresses an inaccuracy in the data type handling for Mixture-of-Experts (MoE) routing logits within the 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
|
📝 WalkthroughWalkthroughAdjusts MOE benchmark test-data generation to choose routing_logits dtype based on routing_method_type: for fp8 block-scale DeepSeekV3 (type 2) uses float32 and others use bfloat16; for fp8 per-tensor the dtype logic is inverted for DeepSeek type (uses bfloat16 for type 3 else float32). Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request correctly updates the data type for routing logits in the fp8_block_scale MoE routine to support non-DeepSeek routing methods with bfloat16. I've suggested a minor refactoring to improve code clarity and reduce duplication within the modified block. Additionally, this change makes the logic for fp8_block_scale identical to the existing logic for fp4_block_scale. You might consider refactoring these two blocks together in a follow-up to further improve maintainability.
…nfer-ai#2476) <!-- .github/pull_request_template.md --> ## 📌 Description The comment at this location previously stated that only `float32` routing logits would be possible for blockscale MoE. However, it seems the launcher now supports bfloat16 for non-DS routing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Bug Fixes * Per-method routing precision handling updated: the model now selects routing tensor precision based on the chosen routing method (e.g., DeepSeekV3 uses higher-precision), replacing fixed per-path precision. This improves routing stability and consistency across routing configurations without changing public APIs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
📌 Description
The comment at this location previously stated that only
float32routing logits would be possible for blockscale MoE. However, it seems the launcher now supports bfloat16 for non-DS routing.Summary by CodeRabbit
Bug Fixes