[MoE] Remove inplace fused experts mechanism (#43727)

Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
This commit is contained in:
Yongye Zhu
2026-05-27 20:00:19 -07:00
committed by GitHub
parent 05eec7120e
commit 2d2c660104
44 changed files with 11 additions and 237 deletions
@@ -647,7 +647,6 @@ def make_modular_kernel(
modular_kernel = mk.FusedMoEKernel(
prepare_finalize=prepare_finalize,
fused_experts=fused_experts,
inplace=False,
)
return modular_kernel
@@ -80,7 +80,6 @@ def test_batched_deepgemm_vs_triton(
mk_triton = FusedMoEKernel(
prep_finalize,
triton_experts,
inplace=False,
)
out_triton = mk_triton.apply(
@@ -105,7 +104,6 @@ def test_batched_deepgemm_vs_triton(
mk_deepgemm = FusedMoEKernel(
prep_finalize,
deepgemm_experts,
inplace=False,
)
out_deepgemm = mk_deepgemm.apply(
-1
View File
@@ -269,7 +269,6 @@ def test_w8a8_block_fp8_deep_gemm_fused_moe(M, N, K, E, topk, seed, monkeypatch)
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
def deep_gemm_moe_fp8(a, w1, w2, w1_s, w2_s, topk_weights, topk_ids):
-2
View File
@@ -214,7 +214,6 @@ def run_with_expert_maps(
moe_config=moe_config,
quant_config=new_quant_config,
),
inplace=False,
)
out_tensor = out_tensor + kernel.apply(**kwargs)
@@ -284,7 +283,6 @@ def run_8_bit(
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
return kernel.apply(**kwargs)
@@ -193,7 +193,6 @@ def make_ll_modular_kernel(
return FusedMoEKernel(
prepare_finalize=a2a,
fused_experts=fused_experts,
inplace=False,
)
@@ -226,7 +225,6 @@ def make_ht_modular_kernel(
return FusedMoEKernel(
prepare_finalize=a2a,
fused_experts=fused_experts,
inplace=False,
)
@@ -353,7 +351,6 @@ def triton_impl(
w2=w2,
topk_weights=topk_weights,
topk_ids=topk_ids,
inplace=False,
quant_config=quant_config,
)
-1
View File
@@ -185,7 +185,6 @@ def make_modular_kernel(
mk = FusedMoEKernel(
prepare_finalize=a2a,
fused_experts=fused_experts,
inplace=False,
)
return mk
-3
View File
@@ -126,7 +126,6 @@ def run_single_case(m, n, k, topk, num_experts, block_size):
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
# triton reference
@@ -136,7 +135,6 @@ def run_single_case(m, n, k, topk, num_experts, block_size):
w2=w2,
topk_weights=topk_weights,
topk_ids=topk_ids,
inplace=False,
quant_config=quant_config,
)
@@ -323,7 +321,6 @@ def run_single_fp4_case(m, n, k, topk, num_experts):
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
# DeepGEMM FP4 path
-3
View File
@@ -233,7 +233,6 @@ def test_flashinfer_per_tensor_moe_fp8_no_graph(
td.w2_quantized,
topk_weights=topk_weights,
topk_ids=topk_ids,
inplace=False,
activation=activation,
global_num_experts=e,
expert_map=None,
@@ -321,7 +320,6 @@ def test_flashinfer_cutlass_moe_fp8_no_graph(
td.w2_quantized,
topk_weights=topk_weights,
topk_ids=topk_ids,
inplace=False,
activation=activation,
global_num_experts=e,
expert_map=None,
@@ -364,7 +362,6 @@ def test_flashinfer_cutlass_moe_fp8_no_graph(
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
flashinfer_cutlass_output = kernel.apply(
@@ -200,7 +200,6 @@ def test_flashinfer_b12x_moe(
use_monolithic=False,
),
experts,
inplace=False,
)
score = torch.randn((m, e), device="cuda", dtype=dtype)
-1
View File
@@ -117,7 +117,6 @@ def test_flashinfer_fp4_moe_no_graph(
use_monolithic=False,
),
FlashInferExperts(moe_config=moe_config, quant_config=quant_config),
inplace=False,
)
flashinfer_output = flashinfer_experts.apply(
@@ -190,7 +190,6 @@ def oai_triton_moe_impl(
use_monolithic=False,
),
fused_experts,
inplace=False,
)
return mk.apply(
-1
View File
@@ -1159,7 +1159,6 @@ def make_fake_moe_layer(
quant_config=quant_config,
topk_weights=topk_weights,
topk_ids=topk_ids,
inplace=False,
activation=activation,
apply_router_weight_on_input=apply_router_weight_on_input,
global_num_experts=global_num_experts,
-2
View File
@@ -105,7 +105,6 @@ def test_cutlass_fp4_moe_no_graph(
moe_config=moe_config,
quant_config=quant_config,
),
inplace=False,
)
cutlass_output = kernel.apply(
@@ -226,7 +225,6 @@ def test_cutlass_fp4_moe_swiglustep(
moe_config=make_dummy_moe_config(),
quant_config=quant_config,
),
inplace=False,
)
cutlass_output = kernel.apply(
@@ -201,7 +201,6 @@ def test_trtllm_fp4_moe_no_graph(
use_monolithic=False,
),
trtllm_inner,
inplace=False,
)
trtllm_output = trtllm_experts.apply(
-3
View File
@@ -142,7 +142,6 @@ def batched_moe(
quant_config=quant_config,
moe_config=moe_config,
),
inplace=False,
)
return fused_experts.apply(
@@ -195,7 +194,6 @@ def naive_batched_moe(
quant_config=quant_config,
moe_config=moe_config,
),
inplace=False,
)
return fused_experts.apply(
@@ -631,7 +629,6 @@ def modular_triton_fused_moe(
use_monolithic=False,
),
TritonExperts(moe_config, quant_config),
inplace=False,
)