vllm.models.muse_spark.common.moe
¶
Platform-neutral MuseSpark1x MoE pieces: routing, config, expert loading.
Classes:
-
MuseSpark1xRouter–MuseSpark1x top-k router.
-
MuseSparkConsolidatedRoutedExperts–RoutedExperts that load the consolidated (all-experts-stacked) tensors.
-
MuseSparkMoEConfig–MoE config whose top-k finalize is always deferred (except empty batches).
Functions:
-
needs_pre_norm_all_reduce–Whether the GEMM2 rows must be all-reduced before the norm.
MuseSpark1xRouter
¶
Bases: BaseRouter
MuseSpark1x top-k router.
Optional metap output multiplier -> sigmoid/softmax -> add expert bias for SELECTION only -> top-k -> gather UNBIASED scores -> divide by (sum + division_eps) -> scale by route_scale.
Attributes:
-
routing_method_type(RoutingMethodType) –Classify this router in vLLM's routing vocabulary.
Source code in vllm/models/muse_spark/common/moe.py
routing_method_type
property
¶
Classify this router in vLLM's routing vocabulary.
_compute_routing_native(router_logits, indices_type)
¶
The recipe in torch: the kernel's reference, and the CPU path.
Source code in vllm/models/muse_spark/common/moe.py
MuseSparkConsolidatedRoutedExperts
¶
Bases: RoutedExperts
RoutedExperts that load the consolidated (all-experts-stacked) tensors.
Vendor subclasses supply _get_quant_method.
Source code in vllm/models/muse_spark/common/moe.py
MuseSparkMoEConfig
dataclass
¶
Bases: FusedMoEConfig
MoE config whose top-k finalize is always deferred (except empty batches).
MuseSpark1x normalizes every expert's output before the weighted top-k reduction, so the kernel must always stop after GEMM2.
Source code in vllm/models/muse_spark/common/moe.py
needs_pre_norm_all_reduce(moe_config)
¶
Whether the GEMM2 rows must be all-reduced before the norm.
Under TP the GEMM2 rows are partial sums and RMS is not linear in them.