[Misc] correct static type check for GroupCoordinator (#21946)

Signed-off-by: Andy Xie <andy.xning@gmail.com>
This commit is contained in:
Ning Xie
2025-08-05 03:17:46 -07:00
committed by GitHub
parent 83156c7b89
commit 74333ae2f6
3 changed files with 29 additions and 4 deletions
+3
View File
@@ -251,6 +251,7 @@ class EplbState:
if global_expert_load is not None:
ep_group = get_ep_group().device_group
assert ep_group is not None
assert global_expert_load.shape == (model.num_moe_layers,
model.num_logical_experts)
assert global_expert_load.dtype == torch.int64
@@ -357,6 +358,7 @@ class EplbState:
# Collect load metrics from all ranks
ep_group = get_ep_group().device_group
assert ep_group is not None
num_tokens_list = [
torch.empty_like(num_tokens) for _ in range(ep_group.size())
]
@@ -412,6 +414,7 @@ class EplbState:
"""
ep_group = get_ep_group().device_group
assert ep_group is not None
ep_rank = ep_group.rank()
time_start = None