vllm.model_executor.layers.fused_moe.prepare_finalize
¶
Modules:
-
alltoall_batched– -
batched– -
deepep_ht– -
deepep_ll– -
deepep_v2– -
flashinfer_nvlink_one_sided– -
flashinfer_nvlink_two_sided– -
mooncake_ep– -
moonep–MoonEP (https://github.com/MoonshotAI/MoonEP) prepare/finalize.
-
mori– -
mori_epv2– -
naive_dp_ep– -
nixl_ep– -
passthrough–Prepare/finalize stages that do no expert-parallel communication.
Classes:
-
AllToAllBatchedPrepareAndFinalize–Routed all-to-all EP dispatch/combine in the batched activation format,
-
BatchedPrepareAndFinalize–A reference prepare/finalize class that reorganizes the tokens into
-
MoEPrepareAndFinalizeNaiveDPEPModular–Naive Prepare/Finalize for Dp/Ep case for Modular Kernels.
-
MoEPrepareAndFinalizeNaiveDPEPMonolithic–Naive Prepare/Finalize for Dp/Ep case for Modular Kernels.
AllToAllBatchedPrepareAndFinalize
¶
Bases: FusedMoEPrepareAndFinalizeModular
Routed all-to-all EP dispatch/combine in the batched activation format, over fixed-capacity all_to_all_single collectives. A token is sent to a destination rank once, however many of its experts live there, carrying its local expert ids and router weights as metadata.
Methods:
-
capacities–Returns token slots per rank, expert slots per token, rows per expert.
capacities(topk)
¶
Returns token slots per rank, expert slots per token, rows per expert.
BatchedPrepareAndFinalize
¶
Bases: FusedMoEPrepareAndFinalizeModular
A reference prepare/finalize class that reorganizes the tokens into expert batched format, i.e. E x max_num_tokens x K. This is the format that the batched dispatch/combine kernels use.
MoEPrepareAndFinalizeNaiveDPEPModular
¶
Bases: FusedMoEPrepareAndFinalizeModular
Naive Prepare/Finalize for Dp/Ep case for Modular Kernels.
Uses Torch AR/RS or AR for dispatch/combine operations, applied to the topk weights and ids.
Methods:
-
prepare–Quantize and Dispatch Topk Weights and Topk Ids.
_comm_region()
¶
Scope the dispatch/combine collective runs in.
Without DBO the collective runs on the calling stream. Under DBO it runs on the comm stream so the peer ubatch can compute while it is in flight, using the same compute/comm handoff as DeepEP-HT. Graph capture keeps every collective on the capture stream, so overlap is limited to eager steps (prefill).
prepare(a1, topk_weights, topk_ids, num_experts, expert_map, apply_router_weight_on_input, quant_config, defer_input_quant=False)
¶
Quantize and Dispatch Topk Weights and Topk Ids.
MoEPrepareAndFinalizeNaiveDPEPMonolithic
¶
Bases: FusedMoEPrepareAndFinalizeMonolithic
Naive Prepare/Finalize for Dp/Ep case for Modular Kernels.
Uses Torch AR/RS or AR for dispatch/combine operations, applied to the router logits (the MoE kernel runs the router internally).
Methods:
-
prepare–Quantize and Dispatch Router Logits.
-
prepare_routed–Quantize and dispatch topk weights and ids instead of logits.