Port of: fix: bypass _forward_impl for dp_size==1 to fix DeepSeek R1 FP8 crash #1441#1459
Merged
mgawarkiewicz-intel merged 1 commit intoMay 25, 2026
Conversation
…FP8 crash vllm-project#1441 Signed-off-by: Iryna Boiko <iboiko@habana.ai>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports an upstream fix to the Gaudi fused MoE runner to avoid a DeepSeek R1 FP8 crash by changing the dp_size == 1 execution path to bypass _forward_impl and directly run quant/application + output combination steps.
Changes:
- Implement a
dp_size == 1fast path that calls_apply_quant_methodand_maybe_combinedirectly instead of_forward_impl. - Persist additional runner references (
_hpu_layer_ref,_hpu_gate_ref) duringFusedMoE.__init__to avoid relying on potentially detached gate modules at runtime. - Minor style/formatting adjustments to patch assignments.
Comment on lines
+306
to
+308
| if self.moe_config.pcp_size > 1: | ||
| raise RuntimeError("dp_size==1 fast path does not support pcp_size > 1") | ||
| layer = self._hpu_layer_ref |
Comment on lines
283
to
289
| Instead of calling forward_dispatch (which uses get_layer_from_name, | ||
| ensure_moe_quant_config_init, and _sequence_parallel_context — all of | ||
| which access ForwardContext and cause torch.compile graph breaks), we | ||
| use a layer reference stashed on the runner at FusedMoE.__init__ time | ||
| (self._hpu_layer_ref) and call _forward_impl directly. This also | ||
| (self._hpu_layer_ref) and bypass _forward_impl for dp_size==1, | ||
| calling _apply_quant_method + _maybe_combine directly. This also | ||
| bypasses self.layer_name (a per-layer string) so dynamo no longer |
✅ CI PassedAll checks passed successfully against the following vllm commit: |
de9f2fb
into
vllm-project:releases/v0.21.0
2 of 6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.