[MoE Refactor] Remove MoE legacy code (#51078)
Signed-off-by: Bill Nell <bnell@redhat.com>
This commit is contained in:
@@ -28,9 +28,6 @@ from vllm.model_executor.layers.fused_moe.config import (
|
||||
from vllm.model_executor.layers.fused_moe.fused_moe_method_base import (
|
||||
FusedMoEMethodBase,
|
||||
)
|
||||
from vllm.model_executor.layers.fused_moe.fused_moe_modular_method import (
|
||||
FusedMoEModularMethod,
|
||||
)
|
||||
from vllm.model_executor.layers.fused_moe.routed_experts import (
|
||||
RoutedExperts,
|
||||
)
|
||||
@@ -896,44 +893,6 @@ class MoERunner(MoERunnerInterface):
|
||||
#
|
||||
#########################################################
|
||||
|
||||
# Note: maybe_init_modular_kernel should only be called by
|
||||
# prepare_communication_buffer_for_model.
|
||||
# This is called after all weight loading and post-processing, so it
|
||||
# should be safe to swap out the quant_method.
|
||||
def maybe_init_modular_kernel(self) -> None:
|
||||
# NOTE(rob): WIP refactor. For quant methods that own the MK
|
||||
# we create the MK during process_weights_after_loading.
|
||||
if (
|
||||
self.routed_experts.quant_method.supports_internal_mk
|
||||
or self.routed_experts.quant_method.is_monolithic
|
||||
):
|
||||
return None
|
||||
|
||||
self.routed_experts._ensure_moe_quant_config_init()
|
||||
# routing_tables only needed for round-robin expert placement with
|
||||
# DeepEP all2all backend.
|
||||
routing_tables = self._expert_routing_tables()
|
||||
|
||||
if isinstance(self.routed_experts.quant_method, FusedMoEModularMethod):
|
||||
base_quant_method = self.routed_experts.quant_method.old_quant_method
|
||||
else:
|
||||
base_quant_method = self.routed_experts.quant_method
|
||||
|
||||
prepare_finalize = base_quant_method.maybe_make_prepare_finalize(
|
||||
routing_tables=routing_tables
|
||||
)
|
||||
if prepare_finalize is not None:
|
||||
logger.debug(
|
||||
"%s for %s(%s)", prepare_finalize.__class__.__name__, self, id(self)
|
||||
)
|
||||
self._replace_quant_method(
|
||||
FusedMoEModularMethod.make(
|
||||
self.routed_experts,
|
||||
base_quant_method,
|
||||
prepare_finalize,
|
||||
)
|
||||
)
|
||||
|
||||
#
|
||||
# Properties
|
||||
#
|
||||
|
||||
@@ -66,10 +66,6 @@ class MoERunnerInterface(PluggableLayer, ABC):
|
||||
#
|
||||
########################################################################
|
||||
|
||||
@abstractmethod
|
||||
def maybe_init_modular_kernel(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def layer_id(self):
|
||||
|
||||
Reference in New Issue
Block a user