Fix dpsk-r1-fp4 launching crash#12063
Conversation
Summary of ChangesHello @Qiaolin-Yu, 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 a critical launching crash identified in Highlights
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 fixes a crash in dpsk-r1-fp4 launching by partially reverting a previous change. The modification hardcodes the MoE runner backend selection in Mxfp4MoEMethod and UnquantizedFusedMoEMethod to either TRITON or TRITON_KERNELS. This prevents a NotImplementedError when an unsupported backend is configured.
While this is an effective quick fix as intended, I've suggested adding comments to the code to document this temporary solution and link to the relevant issue. This will help future developers understand the context and the need for a more robust refactoring.
| backend = ( | ||
| MoeRunnerBackend.TRITON_KERNELS | ||
| if self.use_triton_kernels | ||
| else MoeRunnerBackend.TRITON | ||
| ) |
There was a problem hiding this comment.
This hardcodes the backend selection to avoid a crash with unsupported backends. As noted in the PR description, this is a temporary fix. It would be beneficial to add a comment here to inform future developers about this, and that it should be refactored for more flexible backend selection.
| backend = ( | |
| MoeRunnerBackend.TRITON_KERNELS | |
| if self.use_triton_kernels | |
| else MoeRunnerBackend.TRITON | |
| ) | |
| # TODO(https://github.com/sgl-project/sglang/issues/12059): This is a temporary fix to avoid a crash with unsupported backends. | |
| # This should be refactored for more flexible backend selection in the future. | |
| backend = ( | |
| MoeRunnerBackend.TRITON_KERNELS | |
| if self.use_triton_kernels | |
| else MoeRunnerBackend.TRITON | |
| ) |
| backend = ( | ||
| MoeRunnerBackend.TRITON_KERNELS | ||
| if self.use_triton_kernels | ||
| else MoeRunnerBackend.TRITON | ||
| ) |
There was a problem hiding this comment.
This hardcodes the backend selection to avoid a crash with unsupported backends. As noted in the PR description, this is a temporary fix. It would be beneficial to add a comment here to inform future developers about this, and that it should be refactored for more flexible backend selection.
| backend = ( | |
| MoeRunnerBackend.TRITON_KERNELS | |
| if self.use_triton_kernels | |
| else MoeRunnerBackend.TRITON | |
| ) | |
| # TODO(https://github.com/sgl-project/sglang/issues/12059): This is a temporary fix to avoid a crash with unsupported backends. | |
| # This should be refactored for more flexible backend selection in the future. | |
| backend = ( | |
| MoeRunnerBackend.TRITON_KERNELS | |
| if self.use_triton_kernels | |
| else MoeRunnerBackend.TRITON | |
| ) |
|
Looks good! |
Motivation
Closes #12059, which is introduced by #11795
This pr partly reverted the changes by #11795 for a quick fix. Maybe refine this in the future.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist