[Bugfix]fix ep clear buffer perf (#4389)
Some checks failed
CE Compile Job / ce_job_pre_check (push) Has been cancelled
CE Compile Job / print_ce_job_pre_check_outputs (push) Has been cancelled
CE Compile Job / FD-Clone-Linux (push) Has been cancelled
CE Compile Job / Show Code Archive Output (push) Has been cancelled
CE Compile Job / BUILD_SM8090 (push) Has been cancelled
CE Compile Job / BUILD_SM8689 (push) Has been cancelled
CE Compile Job / CE_UPLOAD (push) Has been cancelled
Deploy GitHub Pages / deploy (push) Has been cancelled

* fix

* Update fused_moe_backend_base.py
This commit is contained in:
gaoziyuan
2025-10-16 13:05:39 +08:00
committed by GitHub
parent 670aaa3f83
commit fd5dd1a0f1

View File

@@ -168,12 +168,12 @@ class MoEMethodBase(QuantMethodBase):
Paddle Cutlass compute Fused MoE.
"""
if layer.ep_size > 1:
if layer.fd_config.model_config.moe_phase.phase == "prefill":
if layer.fd_config.model_config.moe_phase.phase == "prefill" and layer.layer_idx == 0:
if layer.fd_config.scheduler_config.splitwise_role == "mixed":
self.ep_prefill_runner.clean_low_latency_buffer()
return self.apply_ep_prefill(layer, x, gate)
else:
if layer.fd_config.scheduler_config.splitwise_role == "mixed":
if layer.fd_config.scheduler_config.splitwise_role == "mixed" and layer.layer_idx == 0:
self.ep_decoder_runner.clean_low_latency_buffer()
return self.apply_ep_decode(layer, x, gate)
else: