flashinfer.fused_moe.RoutingConfig

class flashinfer.fused_moe.RoutingConfig(num_experts: int, top_k: int, method: RoutingMethodType = RoutingMethodType.Default, n_group: int | None = None, topk_group: int | None = None, routed_scaling_factor: float | None = None)

Expert routing parameters.

Parameters:
  • num_experts (int) – Total number of experts (global, before EP sharding).

  • top_k (int) – Number of experts selected per token.

  • method (RoutingMethodType) – Routing strategy.

  • n_group (int or None) – Expert group count for DeepSeekV3 routing.

  • topk_group (int or None) – Number of groups selected in DeepSeekV3.

  • routed_scaling_factor (float or None) – Fixed routing weight scaling (DeepSeekV3).

__init__(num_experts: int, top_k: int, method: RoutingMethodType = RoutingMethodType.Default, n_group: int | None = None, topk_group: int | None = None, routed_scaling_factor: float | None = None) None

Methods

__init__(num_experts, top_k[, method, ...])

Attributes

method

n_group

routed_scaling_factor

topk_group

num_experts

top_k