An expert-parallel load balancer does not react to every step. It accumulates expert loads over a statistics window, recomputes the assignment every period steps, and every expert that changes rank has its weights shuffled across the interconnect. Simulate that loop without replicas and account for its cost.
eplb_simulate(step_loads, n_ranks, window, period, expert_bytes)
step_loads is a (T, E) array of token counts per step and expert; E is divisible by n_ranks and every rank holds exactly E // n_ranks experts.i lives on rank i // (E // n_ranks).t > 0 with t % period == 0, before that step's loads are counted, recompute the assignment from the summed loads of the last window steps (steps max(0, t - window) to t - 1): process experts in decreasing windowed load (ties by lower index) and place each on the rank with the lowest accumulated windowed load that still has a free slot (ties by lower rank index).moe_lb is the slowest rank's load that step divided by the mean rank load (rounded to 4 decimals; 1.0 if the mean is zero), under the assignment in force during that step."moe_lb" (list over steps), "mean_moe_lb" (rounded to 4 decimals), "reassignments" (how many times the assignment was recomputed), "experts_moved" (total experts whose rank changed) and "bytes_moved" (experts_moved * expert_bytes).