[refactor] remove unused op_mlp (#26673)

This commit is contained in:
akhoroshev
2026-05-29 02:38:56 -07:00
committed by GitHub
parent 8652001b6a
commit 4585f8eb95
6 changed files with 0 additions and 53 deletions
-13
View File
@@ -2114,19 +2114,6 @@ class DeepseekV2DecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
if not (
enable_moe_dense_fully_dp()
and (not self.is_layer_sparse)
and hidden_states.shape[0] == 0
):
state.hidden_states_mlp_output = self.mlp(
hidden_states, state.forward_batch
)
else:
state.hidden_states_mlp_output = hidden_states
def op_comm_postprocess_layer(self, state):
hidden_states, residual = self.layer_communicator.postprocess_layer(
state.pop("hidden_states_mlp_output"),
-13
View File
@@ -1017,19 +1017,6 @@ class Glm4MoeDecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
if not (
enable_moe_dense_fully_dp()
and (not self.is_layer_sparse)
and hidden_states.shape[0] == 0
):
state.hidden_states_mlp_output = self.mlp(
hidden_states, state.forward_batch
)
else:
state.hidden_states_mlp_output = hidden_states
def op_comm_postprocess_layer(self, state):
hidden_states, residual = self.layer_communicator.postprocess_layer(
state.pop("hidden_states_mlp_output"),
-13
View File
@@ -737,19 +737,6 @@ class Glm4MoeLiteDecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
if not (
enable_moe_dense_fully_dp()
and (not self.is_layer_sparse)
and hidden_states.shape[0] == 0
):
state.hidden_states_mlp_output = self.mlp(
hidden_states, state.forward_batch
)
else:
state.hidden_states_mlp_output = hidden_states
def op_comm_postprocess_layer(self, state):
hidden_states, residual = self.layer_communicator.postprocess_layer(
state.pop("hidden_states_mlp_output"),
-4
View File
@@ -808,10 +808,6 @@ class MiMoV2DecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
state.hidden_states_mlp_output = self.mlp(hidden_states, state.forward_batch)
def op_comm_postprocess_layer(self, state):
hidden_states, residual = self.layer_communicator.postprocess_layer(
state.pop("hidden_states_mlp_output"),
-6
View File
@@ -1069,12 +1069,6 @@ class MiniMaxM2DecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
state.hidden_states_mlp_output = self.block_sparse_moe(
hidden_states, state.forward_batch
)
def op_comm_postprocess_layer(self, state):
"""Communication postprocess for layer - TBO operation"""
hidden_states, residual = self.layer_communicator.postprocess_layer(
-4
View File
@@ -891,10 +891,6 @@ class Qwen3MoeDecoderLayer(nn.Module):
)
)
def op_mlp(self, state):
hidden_states = state.pop("hidden_states_mlp_input")
state.hidden_states_mlp_output = self.mlp(hidden_states, state.forward_batch)
def op_comm_postprocess_layer(self, state):
hidden_states, residual = self.layer_communicator.postprocess_layer(
state.pop("hidden_states_mlp_output"),