Skip to content

Commit 029204e

Browse files
committed
rename by comment
Signed-off-by: xxi <[email protected]>
1 parent 7879f87 commit 029204e

File tree

6 files changed

+823
-802
lines changed

6 files changed

+823
-802
lines changed

tensorrt_llm/_torch/modules/fused_moe/fused_moe_wide_ep.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from ...utils import AuxStreamType, EventType, Fp4QuantizedTensor
1717
from .deep_ep_utils import buffer_pool, deep_ep_installed
1818
from .interface import MoE
19-
from .moe_backend import MoEBackend, MoEBackendSelection
2019
from .moe_load_balancer import get_moe_load_balancer
20+
from .ops import MoEOp, MoEOpSelector
2121
from .quantization import (DeepSeekFP8BlockScalesFusedMoEMethod,
2222
DeepSeekFP8BlockScalesFusedMoEMethodDeepGemm,
2323
FP8QDQFusedMoEMethod, MoEWeightLoadingMode,
@@ -233,8 +233,8 @@ def __init__(
233233
self.enable_dummy_allreduce = os.environ.get(
234234
"TRTLLM_ENABLE_DUMMY_ALLREDUCE", "0") == "1"
235235

236-
# MoE backend will be lazily initialized when first accessed (see moe_backend property)
237-
self._moe_backend_impl = None
236+
# MoE op will be lazily initialized when first accessed (see moe_op_impl property)
237+
self._moe_op_impl = None
238238

239239
def _check_configs(self):
240240
assert self._weights_created
@@ -352,17 +352,17 @@ def create_weights(self):
352352
self._check_configs()
353353

354354
@property
355-
def moe_backend_impl(self) -> MoEBackend:
355+
def moe_op_impl(self) -> MoEOp:
356356
"""
357-
Lazily initialize and return the MoE backend.
357+
Lazily initialize and return the MoE op.
358358
359-
The backend is selected based on hardware capabilities and quantization
359+
The op is selected based on hardware capabilities and quantization
360360
configuration, which are only available after weights are created.
361361
"""
362-
if self._moe_backend_impl is None:
363-
assert self._weights_created, "Weights must be created before accessing moe_backend"
364-
self._moe_backend_impl = MoEBackendSelection.select_backend(self)
365-
return self._moe_backend_impl
362+
if self._moe_op_impl is None:
363+
assert self._weights_created, "Weights must be created before accessing moe_op"
364+
self._moe_op_impl = MoEOpSelector.select_op(self)
365+
return self._moe_op_impl
366366

367367
def dummy_allreduce(self):
368368
"""
@@ -658,7 +658,7 @@ def forward_chunk(
658658
f"Not available alltoall method type: {self.alltoall_method_type!r}"
659659
)
660660

661-
final_hidden_states = self.moe_backend_impl.run_moe(
661+
final_hidden_states = self.moe_op_impl.run_moe(
662662
self,
663663
x,
664664
token_selected_slots,

0 commit comments

Comments
 (0)