Revert moe sum reduce for marlin moe (#13314)
This commit is contained in:
@@ -3,7 +3,6 @@ from typing import Optional
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from sgl_kernel.elementwise import silu_and_mul
|
from sgl_kernel.elementwise import silu_and_mul
|
||||||
from sgl_kernel.moe import moe_sum_reduce
|
|
||||||
|
|
||||||
|
|
||||||
def get_scalar_type(num_bits: int, has_zp: bool):
|
def get_scalar_type(num_bits: int, has_zp: bool):
|
||||||
@@ -206,15 +205,10 @@ def fused_marlin_moe(
|
|||||||
is_zp_float=False,
|
is_zp_float=False,
|
||||||
).view(-1, topk, K)
|
).view(-1, topk, K)
|
||||||
|
|
||||||
if routed_scaling_factor is None:
|
|
||||||
routed_scaling_factor = 1.0
|
|
||||||
|
|
||||||
output = hidden_states if inplace else torch.empty_like(hidden_states)
|
output = hidden_states if inplace else torch.empty_like(hidden_states)
|
||||||
moe_sum_reduce(
|
torch.sum(intermediate_cache3.view(*intermediate_cache3.shape), dim=1, out=output)
|
||||||
intermediate_cache3,
|
if routed_scaling_factor is not None:
|
||||||
output,
|
output *= routed_scaling_factor
|
||||||
routed_scaling_factor,
|
|
||||||
)
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user