Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions vllm/model_executor/layers/fused_moe/runner/moe_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
SharedExperts,
SharedExpertsOrder,
)
from vllm.model_executor.layers.utils import dispatch_unquantized_gemm
from vllm.platforms import current_platform
from vllm.utils.torch_utils import (
_USE_LAYERNAME,
Expand Down Expand Up @@ -273,7 +274,7 @@ def __init__(

# When both gates are present and FSE is enabled, fuse their
# weight matrices into [num_experts + num_shared, hidden] so one
# F.linear produces combined logits. The topk kernel can then
# GEMM produces combined logits. The topk kernel can then
# apply routing softmax and shared expert activation (sigmoid)
# in a single launch.
self._fse_fuse_gate = gate is not None and shared_expert_gate is not None
Expand Down Expand Up @@ -898,7 +899,9 @@ def _forward_impl(
if self.gate is not None:
if self._fse_fuse_gate:
self._maybe_fuse_gate_weights()
router_logits = F.linear(hidden_states, self._combined_gate_weight)
router_logits = dispatch_unquantized_gemm()(
self, hidden_states, self._combined_gate_weight, None
)
else:
router_logits, _ = self.gate(hidden_states)

Expand Down
Loading