flashinfer.fused_moe.MoEConfig

class flashinfer.fused_moe.MoEConfig(routing: ~flashinfer.fused_moe.api.RoutingConfig, quant: ~flashinfer.fused_moe.api.QuantConfig, experts: ~flashinfer.fused_moe.api.ExpertConfig, activation: ~flashinfer.fused_moe.api.ActivationConfig = <factory>, backend: ~flashinfer.fused_moe.api.BackendOptions = <factory>, execution: ~flashinfer.fused_moe.api.ExecutionConfig = <factory>, finalize: ~flashinfer.fused_moe.api.MoEFinalizeConfig = <factory>)

Top-level MoE configuration.

Combines all sub-configs into a single hashable, serializable object. Supports **config unpacking via the dict protocol.

Example

>>> config = MoEConfig(
...     routing=RoutingConfig(num_experts=64, top_k=8,
...                           method=RoutingMethodType.DeepSeekV3),
...     quant=QuantConfig(weight=QuantFormat.DeepSeekFp8, activation=QuantFormat.DeepSeekFp8),
...     experts=ExpertConfig(intermediate_size=2048),
... )
>>> output = fused_moe(tensors, **config)
__init__(routing: ~flashinfer.fused_moe.api.RoutingConfig, quant: ~flashinfer.fused_moe.api.QuantConfig, experts: ~flashinfer.fused_moe.api.ExpertConfig, activation: ~flashinfer.fused_moe.api.ActivationConfig = <factory>, backend: ~flashinfer.fused_moe.api.BackendOptions = <factory>, execution: ~flashinfer.fused_moe.api.ExecutionConfig = <factory>, finalize: ~flashinfer.fused_moe.api.MoEFinalizeConfig = <factory>) None

Methods

__init__(routing, quant, experts[, ...])

keys()

Attributes

routing

quant

experts

activation

backend

execution

finalize