Revert "[Bugfix][MoE] Tune FlashInfer experts to scheduler token limit" (#52989) (#53186)
Co-authored-by: vllm-ci-failure-analyzer <kevin@inferact.ai>
vllm-agent committed
Aug 21, 2026 at 11:39 UTC
ba53da60bb1aeec200d05101936a5474ee46c4eb
6 files changed
+1
-12
tests/kernels/moe/test_flashinfer_moe.py
-2
@@ -72,7 +72,6 @@ def test_flashinfer_swigluoai_params_are_forwarded(activation, monkeypatch):
72
moe_parallel_config=FusedMoEParallelConfig.make_no_parallel(),
73
in_dtype=torch.bfloat16,
74
routing_method=RoutingMethodType.TopK,
75
- max_num_tokens=16_384,
75
)
76
quant_config = FusedMoEQuantConfig.make(
77
gemm1_alpha=1.702,
@@ -111,7 +110,6 @@ def test_flashinfer_swigluoai_params_are_forwarded(activation, monkeypatch):
110
111
assert experts._supports_activation(activation)
112
assert call_args["activation_type"] == ActivationType.Swiglu
114
- assert call_args["tune_max_num_tokens"] == 16_384
113
for name, value in (
114
("swiglu_alpha", 1.702),
115
("swiglu_beta", 1.0),
vllm/model_executor/layers/fused_moe/experts/flashinfer_cutlass_moe.py
-2
@@ -13,7 +13,6 @@ from vllm.model_executor.layers.fused_moe.config import (
13
from vllm.model_executor.layers.fused_moe.topk_weight_and_reduce import (
14
TopKWeightAndReduceNoOP,
15
)
16
-from vllm.model_executor.layers.fused_moe.utils import fi_moe_largest_bucket
16
from vllm.model_executor.layers.quantization.utils.flashinfer_utils import (
17
activation_to_flashinfer_type,
18
)
@@ -389,7 +388,6 @@ class FlashInferExperts(mk.FusedMoEExpertsModular):
388
use_deepseek_fp8_block_scale=self.use_deepseek_fp8_block_scale,
389
use_mxfp8_act_scaling=use_mxfp8_act_scaling,
390
use_w4_group_scaling=use_w4_group_scaling,
392
- tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
391
)
392
393
def moe_sum(self, input: torch.Tensor, output: torch.Tensor) -> None:
vllm/model_executor/layers/fused_moe/experts/trtllm_bf16_moe.py
-1
@@ -220,7 +220,6 @@ class TrtLlmBf16ExpertsModular(TrtLlmBf16ExpertsBase, mk.FusedMoEExpertsModular)
220
weight_layout=WeightLayout.BlockMajorK,
221
do_finalize=True,
222
activation_type=activation_to_flashinfer_int(activation),
223
- tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
223
)
224
# FlashInfer's BF16 routed wrapper does not expose an output= argument.
225
output.copy_(result[0] if isinstance(result, list) else result)
vllm/model_executor/layers/fused_moe/experts/trtllm_lora_moe.py
-2
@@ -39,7 +39,6 @@ from vllm.model_executor.layers.fused_moe.topk_weight_and_reduce import (
39
TopKWeightAndReduceNoOP,
40
)
41
from vllm.model_executor.layers.fused_moe.utils import (
42
- fi_moe_largest_bucket,
42
trtllm_moe_pack_topk_ids_weights,
43
)
44
from vllm.platforms import current_platform
@@ -550,7 +549,6 @@ class TrtLlmBf16LoRAExperts(_TrtLlmLoRAExpertsBase):
549
routing_method_type=self.routing_method_type,
550
do_finalize=do_finalize,
551
output=output if do_finalize else None,
553
- tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
552
)
553
if not do_finalize:
554
# [gemm2_output, expert_weights, expanded_idx, gemm1_activation]
vllm/model_executor/layers/fused_moe/experts/trtllm_mxint4_moe.py
-2
@@ -11,7 +11,6 @@ from vllm.model_executor.layers.fused_moe.config import (
11
FusedMoEQuantConfig,
12
RoutingMethodType,
13
)
14
-from vllm.model_executor.layers.fused_moe.utils import fi_moe_largest_bucket
14
from vllm.model_executor.layers.quantization.utils.quant_utils import (
15
QuantKey,
16
kInt4Static32,
@@ -170,7 +169,6 @@ class TrtLlmMxint4ExpertsMonolithic(mk.FusedMoEExpertsMonolithic):
169
e_score_correction_bias=e_score_correction_bias,
170
routing_method_type=self.routing_method,
171
routing_replay_out=routing_replay_out,
173
- tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
172
)
173
self._maybe_dispatch_routing_replay(
174
routing_replay_out, num_tokens=hidden_states.shape[0]
vllm/model_executor/layers/quantization/utils/flashinfer_mxint4_moe.py
+1
-3
@@ -191,7 +191,6 @@ def flashinfer_trtllm_mxint4_moe(
191
e_score_correction_bias: torch.Tensor | None = None,
192
routing_method_type: int | None = None,
193
routing_replay_out: torch.Tensor | None = None,
194
- tune_max_num_tokens: int = 8192,
194
) -> torch.Tensor:
195
"""
196
Apply FlashInfer TensorRT-LLM MxInt4 MoE kernel.
@@ -212,7 +211,6 @@ def flashinfer_trtllm_mxint4_moe(
211
topk_group: Top-k within groups (default: None -> 0)
212
e_score_correction_bias: Optional routing bias. dtype: bfloat16
213
routing_method_type: FlashInfer RoutingMethodType enum value
215
- tune_max_num_tokens: Maximum token count covered by autotuning.
214
215
Returns:
216
Output tensor from MoE layer. dtype: same as x (bfloat16)
@@ -264,7 +262,7 @@ def flashinfer_trtllm_mxint4_moe(
262
enable_pdl=None,
263
do_finalize=True,
264
output=None,
267
- tune_max_num_tokens=tune_max_num_tokens,
265
+ tune_max_num_tokens=8192,
266
routing_replay_out=routing_replay_out,
267
)
268
if isinstance(out, (tuple, list)):