[MoE Refactor] EPLB refactoring for FusedMoE (#41055)
Signed-off-by: Bill Nell <bnell@redhat.com> Co-authored-by: Robert Shaw <114415538+robertgshaw2-redhat@users.noreply.github.com>
This commit is contained in:
@@ -36,9 +36,11 @@ TOP_KS = [2, 4, 6]
|
||||
NUM_EXPERTS = [8, 16, 64]
|
||||
|
||||
|
||||
def setup_eplb_state(enable_eplb: bool, global_num_experts: int) -> EplbLayerState:
|
||||
def setup_eplb_state(
|
||||
enable_eplb: bool, global_num_experts: int
|
||||
) -> EplbLayerState | None:
|
||||
if not enable_eplb:
|
||||
return EplbLayerState()
|
||||
return None
|
||||
|
||||
# Initialize EPLB state with proper tensors for testing
|
||||
# For testing purposes, we use a simple 1:1 mapping (no redundant experts)
|
||||
@@ -349,7 +351,6 @@ def test_fused_topk(
|
||||
top_k=top_k,
|
||||
global_num_experts=global_num_experts,
|
||||
renormalize=renormalize,
|
||||
enable_eplb=enable_eplb,
|
||||
eplb_state=eplb_state,
|
||||
)
|
||||
|
||||
@@ -400,7 +401,6 @@ def test_fused_topk_bias(
|
||||
top_k=top_k,
|
||||
global_num_experts=global_num_experts,
|
||||
renormalize=renormalize,
|
||||
enable_eplb=enable_eplb,
|
||||
eplb_state=eplb_state,
|
||||
)
|
||||
|
||||
@@ -469,7 +469,6 @@ def test_grouped_topk(
|
||||
top_k=top_k,
|
||||
global_num_experts=global_num_experts,
|
||||
renormalize=renormalize,
|
||||
enable_eplb=enable_eplb,
|
||||
eplb_state=eplb_state,
|
||||
)
|
||||
|
||||
@@ -540,7 +539,6 @@ def test_custom(
|
||||
global_num_experts=global_num_experts,
|
||||
custom_routing_function=custom_routing_function,
|
||||
renormalize=renormalize,
|
||||
enable_eplb=enable_eplb,
|
||||
eplb_state=eplb_state,
|
||||
)
|
||||
|
||||
@@ -580,7 +578,6 @@ def test_custom(
|
||||
# router = create_fused_moe_router(
|
||||
# top_k=top_k,
|
||||
# global_num_experts=global_num_experts,
|
||||
# enable_eplb=enable_eplb,
|
||||
# eplb_state=eplb_state,
|
||||
# )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user