【BugFix】fix ep buffer clear (#4450)

* fix

* fix
This commit is contained in:
gaoziyuan
2025-10-21 10:56:00 +08:00
committed by GitHub
parent 70a29ec49e
commit d85ef5352a

View File

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