Support dispatching logical to physical experts (#6385)

This commit is contained in:
fzyzcjy
2025-05-20 13:13:55 +08:00
committed by GitHub
parent 69af3ec35f
commit e98afbe042
9 changed files with 184 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ from torch.nn import Module
from sglang.srt.layers.quantization.deep_gemm import _ENABLE_JIT_DEEPGEMM
from sglang.srt.managers.expert_location import get_global_expert_location_metadata
from sglang.srt.managers.expert_location_dispatch import ExpertLocationDispatchInfo
from sglang.srt.managers.schedule_batch import global_server_args_dict
try:
@@ -237,6 +238,9 @@ class EPMoE(torch.nn.Module):
correction_bias=self.correction_bias,
custom_routing_function=self.custom_routing_function,
routed_scaling_factor=self.routed_scaling_factor,
expert_location_dispatch_info=ExpertLocationDispatchInfo.init_new(
layer_id=self.layer_id,
),
)
reorder_topk_ids, src2dst, seg_indptr = run_moe_ep_preproess(