[Perf] Update TRTLLM supported MoE routing methods (#39141)
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com> Signed-off-by: Wei Zhao <51183510+wzhao18@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: root <root@bia0030.bia.clusters.nvidia.com> Co-authored-by: root <root@bia0036.bia.clusters.nvidia.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
root
root
parent
6232fb4b66
commit
c8bbe05189
@@ -113,14 +113,17 @@ class RoutingMethodType(IntEnum):
|
||||
RenormalizeNaive = (4,)
|
||||
# TopK: TopK (no softmax)
|
||||
TopK = (5,)
|
||||
# Custom
|
||||
Custom = (6,)
|
||||
# Simulated
|
||||
Simulated = (7,)
|
||||
# Deepseek V4 -> sqrtsoftplus + Bias + Normalize
|
||||
DeepseekV4 = (8,)
|
||||
# SigmoidRenorm: Sigmoid -> TopK -> Renormalize (divide by sum of top-K)
|
||||
SigmoidRenorm = (6,)
|
||||
# MiniMax2: Sigmoid + Bias -> TopK -> ScaledSumNormalize
|
||||
MiniMax2 = (7,)
|
||||
# Unspecified
|
||||
Unspecified = 9.0
|
||||
Unspecified = (8,)
|
||||
# other routing types (not passed to FlashInfer kernels)
|
||||
# Deepseek V4 -> sqrtsoftplus + Bias + Normalize
|
||||
DeepseekV4 = (100,)
|
||||
Custom = (101,)
|
||||
Simulated = (102,)
|
||||
|
||||
|
||||
def get_routing_method_type(
|
||||
@@ -141,12 +144,16 @@ def get_routing_method_type(
|
||||
if has_e_score_bias:
|
||||
if (num_expert_group or 0) > 0 and scoring_func == "sigmoid":
|
||||
return RoutingMethodType.DeepSeekV3
|
||||
elif scoring_func == "sigmoid":
|
||||
return RoutingMethodType.MiniMax2
|
||||
else:
|
||||
return RoutingMethodType.Unspecified
|
||||
|
||||
if scoring_func == "sigmoid":
|
||||
if top_k == 1:
|
||||
return RoutingMethodType.Llama4
|
||||
elif renormalize:
|
||||
return RoutingMethodType.SigmoidRenorm
|
||||
else:
|
||||
return RoutingMethodType.Unspecified
|
||||
|
||||
|
||||
Reference in New Issue
Block a user