[AllReduce] FlashInfer: add mnnvl backend selection and standalone TP path#19586
[AllReduce] FlashInfer: add mnnvl backend selection and standalone TP path#19586mmangkad wants to merge 4 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 distributed communication capabilities by integrating advanced FlashInfer allreduce features. It provides users with greater control over the allreduce backend, including a new 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 support for the mnnvl backend for FlashInfer all-reduce operations and adds a standalone path for non-fused tensor parallelism all-reduce. The changes are well-structured, adding new arguments, documentation, and the necessary logic in the communication and parallel state management modules. My review focuses on improving error handling, ensuring the correctness of a fallback implementation, and enhancing user-facing documentation for the new options. Overall, this is a solid contribution to extend the all-reduce capabilities.
python/sglang/srt/distributed/device_communicators/flashinfer_all_reduce.py
Outdated
Show resolved
Hide resolved
python/sglang/srt/distributed/device_communicators/flashinfer_all_reduce.py
Outdated
Show resolved
Hide resolved
|
/tag-and-rerun-ci |
|
MNNVL only supports SM100, which is a hard limitation for a general solution. |
|
Maybe FlashInfer has upgrade recently, in Nov last year, it didn't support hopper. |

Motivation
This PR adds support for backend selection (
auto/mnnvl/trtllm) for FlashInfer allreduce and introduces standalone FlashInfer allreduce for non-fused TP allreduce.mnnvlis optimized for multi-node NVLink setups and can be more beneficial in that setting.Modifications
kAllReducepath).--enable-flashinfer-allreduce(default:False) to enable standalone FlashInfer allreduce.--flashinfer-allreduce-backend {auto,trtllm,mnnvl}(default:auto; with current FlashInfer,autoresolves tomnnvl) for both fused and standalone FlashInfer allreduce.Case Matrix (H100, tp=2)
mnnvl_fusion_custom_arsglang serve --model-path Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 --tensor-parallel-size 2 --enable-flashinfer-allreduce-fusion --flashinfer-allreduce-backend mnnvltrtllm_fusion_custom_arsglang serve --model-path Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 --tensor-parallel-size 2 --enable-flashinfer-allreduce-fusion --flashinfer-allreduce-backend trtllmmnnvl_fusion_fi_ar_onlysglang serve --model-path Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 --tensor-parallel-size 2 --enable-flashinfer-allreduce-fusion --enable-flashinfer-allreduce --disable-custom-all-reduce --flashinfer-allreduce-backend mnnvltrtllm_fusion_fi_ar_onlysglang serve --model-path Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 --tensor-parallel-size 2 --enable-flashinfer-allreduce-fusion --enable-flashinfer-allreduce --disable-custom-all-reduce --flashinfer-allreduce-backend trtllmAccuracy Tests (Full GSM8K, 8-shot)
No accuracy regression observed.
Benchmarking
No TPOT regression observed.
mnnvlis on par withtrtllmand can be better.