-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix dpsk-r1-fp4 launching crash #12063
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,12 +8,7 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| from sglang.srt.custom_op import CustomOp | ||||||||||||||||||||||||||
| from sglang.srt.layers.amx_utils import _amx_process_weight_after_loading | ||||||||||||||||||||||||||
| from sglang.srt.layers.moe import ( | ||||||||||||||||||||||||||
| MoeRunner, | ||||||||||||||||||||||||||
| MoeRunnerBackend, | ||||||||||||||||||||||||||
| MoeRunnerConfig, | ||||||||||||||||||||||||||
| get_moe_runner_backend, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| from sglang.srt.layers.moe import MoeRunner, MoeRunnerBackend, MoeRunnerConfig | ||||||||||||||||||||||||||
| from sglang.srt.layers.moe.moe_runner.triton import TritonMoeQuantInfo | ||||||||||||||||||||||||||
| from sglang.srt.layers.quantization.base_config import ( | ||||||||||||||||||||||||||
| FusedMoEMethodBase, | ||||||||||||||||||||||||||
|
|
@@ -225,13 +220,11 @@ def create_moe_runner( | |||||||||||||||||||||||||
| self, layer: torch.nn.Module, moe_runner_config: MoeRunnerConfig | ||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||
| self.moe_runner_config = moe_runner_config | ||||||||||||||||||||||||||
| backend = get_moe_runner_backend() | ||||||||||||||||||||||||||
| if backend.is_auto(): | ||||||||||||||||||||||||||
| backend = ( | ||||||||||||||||||||||||||
| MoeRunnerBackend.TRITON_KERNELS | ||||||||||||||||||||||||||
| if self.use_triton_kernels | ||||||||||||||||||||||||||
| else MoeRunnerBackend.TRITON | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| backend = ( | ||||||||||||||||||||||||||
| MoeRunnerBackend.TRITON_KERNELS | ||||||||||||||||||||||||||
| if self.use_triton_kernels | ||||||||||||||||||||||||||
| else MoeRunnerBackend.TRITON | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+223
to
+227
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Suggested change
|
||||||||||||||||||||||||||
| self.runner = MoeRunner(backend, moe_runner_config) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def apply( | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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.
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.