From aaa3092f5137870d7a30e17bdbcd3f8268fa4c29 Mon Sep 17 00:00:00 2001 From: Jaewon <52840625+jaewonlee-fb@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:30:44 -0700 Subject: [PATCH] [MoE] Add routing simulation override for MXFP4 quantized MoE (#33595) Signed-off-by: Jaewon Lee --- vllm/model_executor/layers/quantization/mxfp4.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vllm/model_executor/layers/quantization/mxfp4.py b/vllm/model_executor/layers/quantization/mxfp4.py index 1cff6816218..01df2b0003e 100644 --- a/vllm/model_executor/layers/quantization/mxfp4.py +++ b/vllm/model_executor/layers/quantization/mxfp4.py @@ -1109,6 +1109,12 @@ class Mxfp4MoEMethod(FusedMoEMethodBase): layer.eplb_state.logical_replica_count, ), "MXFP4 are not supported with this configuration." + # Apply routing simulation strategy if specified. + # This applies to all monolithic backends (SM100_FI and TRITON). + routing_strategy = envs.VLLM_MOE_ROUTING_SIMULATION_STRATEGY + if routing_strategy == "uniform_random": + router_logits = torch.rand_like(router_logits) + if ( self.mxfp4_backend == Mxfp4Backend.SM100_FI_MXFP4_MXFP8_TRTLLM or self.mxfp4_backend == Mxfp4Backend.SM100_FI_MXFP4_BF16