[Models] Cohere MoE (#40817)
Signed-off-by: Terrencezzj <terrence@cohere.ai>
This commit is contained in:
@@ -263,6 +263,7 @@ class TrtLlmNvFp4ExpertsMonolithic(
|
||||
RoutingMethodType.SigmoidRenorm,
|
||||
RoutingMethodType.MiniMax2,
|
||||
RoutingMethodType.Simulated,
|
||||
RoutingMethodType.SigmoidRenorm,
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -34,11 +34,15 @@ class CustomRoutingRouter(BaseRouter):
|
||||
|
||||
@property
|
||||
def routing_method_type(self) -> RoutingMethodType:
|
||||
from vllm.model_executor.models.cohere_moe import token_choice_with_bias
|
||||
from vllm.model_executor.models.llama4 import Llama4MoE
|
||||
|
||||
# NOTE: FLASHINFER_TRTLLM support the Llama4 router.
|
||||
if self.custom_routing_function == Llama4MoE.custom_routing_function:
|
||||
return RoutingMethodType.Llama4
|
||||
# Cohere MoE uses a sigmoid -> top-k -> renormalize routing function.
|
||||
if self.custom_routing_function == token_choice_with_bias:
|
||||
return RoutingMethodType.SigmoidRenorm
|
||||
return RoutingMethodType.Custom
|
||||
|
||||
def _compute_routing(
|
||||
|
||||
Reference in New Issue
Block a user