[EPLB][Cleanup] Remove is_async_enabled from EplbModelState (#32050)

Signed-off-by: Sage Moore <sage@neuralmagic.com>
This commit is contained in:
Sage Moore
2026-01-13 18:19:03 +00:00
committed by GitHub
parent ab74b2a27a
commit 6beef12b9b
2 changed files with 8 additions and 20 deletions
+4 -4
View File
@@ -30,6 +30,7 @@ def start_async_worker(
ep_group = get_ep_group().device_group
rank = ep_group.rank()
device_index = state.cuda_device_index
assert state.is_async
def thread_target() -> None:
assert device_index is not None
@@ -42,9 +43,9 @@ def start_async_worker(
transfer_run_periodically(
state=state,
ep_group=ep_group,
cuda_stream=cuda_stream,
is_profile=is_profile,
rank_mapping=rank_mapping,
cuda_stream=cuda_stream,
)
)
except Exception as exc: # pragma: no cover - diagnostic path
@@ -60,17 +61,16 @@ def start_async_worker(
async def transfer_run_periodically(
state: "EplbState",
ep_group: ProcessGroup,
cuda_stream: torch.cuda.Stream,
is_profile: bool = False,
rank_mapping: dict[int, int] | None = None,
cuda_stream: torch.cuda.Stream = None,
) -> None:
while True:
await asyncio.to_thread(state.rearrange_event.wait)
logger.info("async worker woke up for EPLB transfer")
assert state.is_async
for model_state in state.model_states.values():
if not model_state.is_async_enabled:
continue
current_num_layers = model_state.model.num_moe_layers
while (
model_state.rebalanced