Manuscript Offprint
arXiv:2608.12146RoutePack: Expert Placement and Attention-Aware Data Packing for MoE Reinforcement Learning
RoutePack: Replay-Guided Expert Placement and Rollout Trajectory Scheduling for MoE Reinforcement Learning
© none
Figure 1. The general workflow of RoutePack: replay-guided expert placement and EDP-aware fixed-row trajectory rescheduling.\sysname{} replays each trajectory's token length and layer-wise expert demand. A hierarchical planner couples per-layer expert placement with fixed-row trajectory schedules scored over the runtime's EDP shards. The resulting training rows reduce separate KDA, MLA, and per-layer expert-parallel peak costs.
Abstract.
Mixture-of-Experts (MoE) reinforcement learning (RL) must balance two coupled loads. The rollout trajectories in each data-parallel (DP) microbatch set its dense-side work (attention and dense FFN), while token routing sets the expert work of each expert-parallel (EP) rank. Balancing either load alone can worsen the other: length-aware trajectory scheduling may concentrate expert demand, while expert-aware scheduling may create dense-side stragglers. MoE RL makes joint balancing possible: routing replay reveals each trajectory’s token length and layer-wise expert demand before training starts.
We present RoutePack, a replay-guided planner that coordinates expert placement with rollout-trajectory scheduling. Its key insight is that the two controls act at different scales. Placement sets a window-level EP-rank load bound that no trajectory schedule can cross; scheduling then removes the hotspots that remain inside individual micro-steps under that placement. RoutePack first swaps experts across EP ranks incrementally to lower this bound, keeping unmoved experts resident. With placement fixed, it reschedules complete trajectories into token-capped microbatches, jointly balancing dense-side and expert work at a fixed, capacity-feasible number of micro-steps within the deployed synchronization groups. Placement stays fixed through forward and backward execution, preserving logical routing and training-state consistency without microbatch-level expert replication.
We evaluate mixed-task RL post-training of two hybrid-attention MoE models (7.9B and 124B) in six NVIDIA H20-3e configurations spanning 8K–32K contexts, with cross-GPU checks of the 7.9B model on H200 and H20. In trace replay, incremental placement meets the load-balance target while preserving expert residency, and rescheduling further reduces modeled per-micro-step deficits. Measured over the Megatron training region, with planning and state loading reported separately, expert placement alone raises tokens per second (TPS) by 2.67–6.24% over an in-house DP-local first-fit-decreasing (FFD) packing baseline, and full RoutePack raises it by 4.44–11.85%. Full RoutePack also leads on both additional GPUs.
Existing systems address one side at a time. Expert-side systems optimize transport, placement, replication, or post-route assignment (Zhao et al., 2025a; Jin et al., 2026b; Zhou et al., 2026; Wei et al., 2026; Chen et al., 2026; Zhao et al., 2025b). RL frameworks pack complete responses for capacity (verl Team, 2026; OpenRLHF Team, 2026; NVIDIA, 2026b), while schedulers reorder them by length (Wang et al., 2026; Meng and others, 2026). Neither jointly selects physical expert placement and the capacity-constrained trajectory schedule, and optimizing one side alone can worsen the other: on Tiny, expert placement alone raises the modeled row-local EP excess from 9.40% to 23.17% of uniform EP work (Section 4.2).
MoE RL provides an unusual opportunity to coordinate the two decisions. The rollout and training phases consume the same generated rollout trajectories. Routing replay can therefore expose each trajectory’s token length and layer-wise expert demand before a sealed optimizer window—the complete rollout batch consumed by one optimizer update—is admitted to training (Ma et al., 2025; Jin et al., 2026b). This turns data layout into a load-balancing control: Figure 1 coordinates layer-wise expert placement with an expert-data-parallel (EDP)-aware trajectory layout for the same window.
We present RoutePack, a replay-guided hierarchical planner that coordinates layer-wise expert placement with rollout-trajectory rescheduling. The two controls operate at different scales. RoutePack first uses aggregate window demand to lower the EP-rank straggler bound that trajectory reordering cannot cross, swapping experts incrementally so that unmoved experts stay resident. With that placement fixed, it assigns the complete trajectory set to execution rows: synchronized micro-steps in which every DP rank processes one token-capped microbatch. It fixes the smallest capacity-feasible row count it can certify, or the best-known one, before balancing load. It then scores each row by the slowest DP microbatch of each dense-side stage plus the busiest EP rank of each MoE layer, and minimizes the total row cost of the slowest EDP shard. Sections 3 and 4 give the objective and its capacity-feasible population-annealing solver, respectively.
We integrate RoutePack into an in-house post-training framework. After rollout seals a window, replay profiles drive CPU-side placement repair and trajectory rescheduling while post-rollout processing and state preparation proceed in parallel. Before training admission, the framework commits the expert layout and execution rows. Expert parameters and their expert-indexed training state move into pre-existing physical slots, so tensor shapes, gradient buffers, communicators, and the training unit remain unchanged.
This paper makes three contributions:
- We show that expert placement and trajectory scheduling control different scales of MoE imbalance: placement sets a window-level EP-rank bound that scheduling cannot cross, while scheduling sets row-local peaks under that placement. Replay-guided hierarchical planning coordinates both for whole trajectories in MoE RL.
- We formulate an EDP-aware objective that first fixes a capacity-efficient row count, then jointly minimizes dense-side work and physical EP-rank tails.
- We implement state-consistent incremental placement and parallel population annealing, overlapping planning with state loading (97.4–99.4% median overlap). Across six configurations, full RoutePack records 4.44–11.85% higher post-admission TPS in the Megatron training region than the in-house DP-local FFD packing baseline. In a single-window Tiny 16K device trace, it lowers DeepEP dispatch and combine waits by 66.0% while total compute changes by only 0.12%.
2. Background and Motivation
RoutePack couples trajectories and DP-slot schedule cells, logical experts and physical EP ranks, and the EDP shards that define synchronization domains. Table 1 groups the notation by scope; for any positive integer , we write .
Table 1. Core notation and index scopes.
| Symbol | Scope and meaning |
|---|---|
| Indices and sets | |
| Trajectory index in a sealed optimizer window, . | |
| Execution-row index, ; is the row count. | |
| Controller DP-slot index, ; each row has cells. | |
| EDP-shard index, ; unrelated shards do not synchronize. | |
| MoE-layer index, ; dense layers are excluded. | |
| Logical expert index, , in MoE layer . | |
| Physical EP-rank index, , in the relevant communicator. | |
| Dense-side stage type (attention or dense FFN), . | |
| Replay input and topology | |
| Trajectory and its token length. | |
| Schedule cell at ; its assigned trajectories form a microbatch. | |
| Trajectory routing matrix and layer–expert token-load entry. | |
| DP slots projected onto EDP shard . | |
| Layer-wise placement plan; is expert ’s physical slot and its EP rank. | |
| Layout, load, objective, and runtime | |
| Token capacity of one cell and its resident microbatch. | |
| Trajectory demand on rank at layer after placement. | |
| Window-total demand of expert at layer . | |
| Window-total demand on rank at layer . | |
| Token-linear weight and token-pair weight of dense-side stage . | |
| Row , shard , layer load on EP rank . | |
| Capacity-feasible layouts containing exactly rows. | |
| Minimum feasible and planner-returned row counts. | |
| Complete layout; is the assignment of trajectory to cell , and is the returned layout. |
Four data-parallel lanes run attention and routing, then dispatch tokens through all-to-all communication to four expert-parallel ranks. Each rank contains two local experts and grouped compute. The busiest expert rank is highlighted, followed by all-to-all combine and residual additions.
Figure 2. MoE layer and expert parallelism. The straggler is defined by the highlighted DP and EP ranks.Four data-parallel lanes run attention and routing, then dispatch tokens through all-to-all communication to four expert-parallel ranks. Each rank contains two local experts and grouped compute. The busiest expert rank is highlighted, followed by all-to-all combine and residual additions.
2.1. MoE RL Training with Routing Replay
In decoupled RL systems, rollout forms a sealed optimizer window that one optimizer update later consumes. Before training, systems pack variable-length trajectories into token-capped microbatches on data-parallel (DP) workers (verl Team, 2026; OpenRLHF Team, 2026; NVIDIA, 2026b). We use cell for the schedule position ; the trajectories assigned to that cell form its resident microbatch. RoutePack organizes such cells into aligned execution rows, with one cell per DP slot in each row. An execution row is a physical scheduling unit; it is distinct from an algorithmic minibatch, which defines the learning update rather than the synchronized device layout.
With rollout routing replay (R3), rollout records token-level logical top- expert IDs and training replays the same IDs (Ma et al., 2025; Jin et al., 2026b). We aggregate these IDs into before planning; placement changes only their physical owners, not the logical token-to-expert assignments. RoutePack therefore receives
for every such window. Appendix A describes how the replayed IDs are aggregated and gives the operator-level interpretation of the dense-side model used below.
Figure 2 locates the two parallel scopes. Dense-side operators and routing run locally in each DP cell ; routed assignments are then aggregated across the cells in an EDP shard , and each EP owner groups its dispatched tokens.
2.2. Coupled Dense-Side and Expert Stragglers
RL responses vary substantially in length, so equal trajectory counts need not produce equal dense-side work. Dense-side Transformer operators fall into two relevant complexity classes. Dense FFNs, token-wise projections, recurrent or linear attention such as Kimi Delta Attention (KDA) (Kimi Team, 2025), and fixed-width sliding-window attention scale with the total tokens in a microbatch, . Full attention instead forms pairwise interactions within each trajectory and scales with ; Multi-Query Attention (MQA), Grouped-Query Attention (GQA), and Multi-Head Latent Attention (MLA) reduce projection or KV-state constants but retain this token-pair term (Vaswani et al., 2017; Ainslie et al., 2023; DeepSeek-AI, 2024a). Hybrid architectures interleave these two classes (Kimi Team, 2025; Qwen Team, 2025). We therefore approximate the cost of dense-side stage on cell by
The linear term captures dense FFNs, projections, and recurrent work, while the quadratic term captures pairwise attention. In our evaluated models, KDA and dense FFNs use and MLA uses ; operator- and hardware-specific effects are absorbed into stage-calibrated coefficients. This compact proxy is sufficient for the joint planning formulation; its kernel-specific limits are evaluated separately.
Expert-side work depends on both the trajectory and layer. After applying , an EDP shard aggregates the routed tokens assigned to each physical EP rank, and dispatch plus grouped expert computation is paced by the busiest rank at that layer. An EP rank may own several experts, but grouped-GEMM backends execute their local MLPs as one grouped operation. We therefore first sum demand over the experts owned by a rank and then take the maximum across synchronizing EP ranks, matching the abstraction used by exact-load systems such as UltraEP (Wei et al., 2026).
The two load tails require complementary controls. Under fixed placement , rescheduling leaves each physical rank’s window-total demand unchanged:
Consequently, every feasible schedule obeys
Trajectory rescheduling alone cannot cross this placement-defined lower bound. Conversely, equal window-total demands do not imply balanced rows: correlated routing vectors can expose the same physical rank together. Moving a whole trajectory also changes its linear and quadratic dense-side terms together with one routing vector per MoE layer. Length-only scheduling can therefore create an expert-side hotspot, while expert-only layout optimization can create a dense-side outlier; conventional first-fit decreasing (FFD) cannot distinguish equal-length trajectories with different routing signatures.
Figure 3 illustrates the resulting hierarchical order.
Under identity expert placement, two trajectory schedules retain a twelve-versus-four window-total rank load and a row peak of six. A layer-local expert permutation balances the window load at eight versus eight. Routing-aware rescheduling then lowers both row peaks from eight to four without adding rows.
Figure 3. Placement lowers aggregate skew; rescheduling reduces row-local peaks at fixed row count.Under identity expert placement, two trajectory schedules retain a twelve-versus-four window-total rank load and a row peak of six. A layer-local expert permutation balances the window load at eight versus eight. Routing-aware rescheduling then lowers both row peaks from eight to four without adding rows.
2.3. Pilot Studies and Replay Benchmark
A grouped-GEMM microbenchmark tests whether rank-total routed tokens predict grouped-expert time; a 20-window routing corpus is the common benchmark for the later offline placement, rescheduling, solver, and communication studies.
2.3.1. Validating the EP-Compute Proxy
RoutePack approximates a row’s expert-compute time by its largest post-dispatch rank-total token count. We test this proxy independently of the mixed-task corpus with two Flash grouped-GEMM controls. A rank-total sweep measures 7,680 naturally occurring shapes from 480 layer–EP-group observations (16 ranks per group and 32 local experts per rank) after five warmup and 20 timed bf16 forward–backward iterations. A fixed-total shape control redistributes 81,830 tokens from one measured rank shape nearly uniformly across its local experts. The former tests whether rank-total demand predicts latency; the latter isolates residual intra-rank shape effects. For a positive-mean vector , we report the population coefficient of variation:
Expert Max/Avg and CV here range over local experts; Section 3.2 applies the same statistics to physical EP-rank loads.
Table 2. Fixed-token rank-local control at 81,830 tokens.
| Shape | Expert Max/Avg | Expert CV | P50 latency (ms) |
|---|---|---|---|
| Real | 8.151 | 1.848 | 6.8772 |
| Uniform | 1.000 | 0.000 | 6.6157 |
Scatter plot of grouped-GEMM forward-and-backward median latency against total tokens on one expert-parallel rank.
Figure 4. Grouped-GEMM forward–backward P50 latency versus rank token count (7,680 shapes).
Above the launch-latency floor, grouped-GEMM P50 latency grows approximately with rank total tokens (Figure 4); token max/mean has P50/P90 values of 3.5244/5.0788, versus 2.8099/3.9500 for latency max/mean. At fixed rank total, uniformizing the local-expert shape changes P50 latency by only 3.8% (Table 2). Aggregate rank demand is therefore the dominant expert-compute proxy in this regime. The sweep measures grouped-GEMM compute; Appendix C gives the complete protocol.
2.3.2. Shared Offline Replay Corpus
We collect 20 consecutive sealed optimizer windows from each of Ling-3.0-Tiny (Tiny) and Ling-3.0-Flash (Flash) (InclusionAI, 2026b; Ant Ling, 2026; InclusionAI, 2026a). Tiny has 7.9B total and 1.3B activated parameters per token, 23 MoE layers, and 128 experts per layer; Flash has 124B total and 5.1B activated parameters per token, 40 MoE layers, and 512 experts per layer. Both hybrid-attention models combine KDA and MLA attention layers.
Both runs use an in-house dataset comprising math, code, STEM, and logic tasks. Each window contains 64 prompt groups with eight GRPO rollouts per prompt (Shao et al., 2024), hence 512 complete rollout trajectories, each capped at 8,192 tokens. We preserve the task labels and the realized sampling mixture.
Table 3 summarizes the retained workload (10,240 trajectories per model). The different length distributions are useful rather than normalized away: Tiny stresses nearly capacity-sized cells, while Flash contains a broader mix of short and long trajectories. The task-mix column reports math/code/STEM/logic percentages in that order.
Table 3. Shared offline replay corpus (20 consecutive windows per model).
| Model | Count tensor/window | Length P50/P95 | Task mix (%) |
|---|---|---|---|
| Tiny | 7,298/7,890 | 58.7/15.2/22.1/4.1 | |
| Flash | 3,178/7,323 | 56.4/15.5/23.6/4.5 |
We characterize expert-, rank-, and window-category imbalance under identity EP=8, before either RoutePack control (Figure 5). Panels (a) and (b) pool all 20 windows. Panel (c) normalizes each window–category rank profile before computing distances; off-diagonal cells average cross-category window pairs, while diagonal cells compare windows of the same category. Windows are bootstrap blocks.
Table 4. Signals and controls used by related load balancers.
Method Planning signal Scope Expert control Data control Target RL Frameworks (Fu et al., 2025; Zhu et al., 2026; verl Team, 2026) Length RL pre-step – Token-capped bins Capacity/length Libra (Wang et al., 2026) Length + attention cost LLM training – Trajectory/tile scheduling Attention balance Semantic Parallelism (Li et al., 2025) Co-activation MoE serving Expert placement Request/token reshuffling EP locality Gimbal (Sun et al., 2026) Source pressure MoE serving Expert placement Request admission Load/comm./migration ReLibra (Jin et al., 2026b) Routing replay MoE RL Reordering + replicas Source assignment + token split Compute/communication DeepEP (Zhao et al., 2025a) Routed traffic Train/infer Transport only Post-route transport Dispatch/combine UltraEP (Wei et al., 2026) Live routing RSN layer/step Dynamic replicas Replica-aware token split Load/communication MoonEP (Chen et al., 2026) Live routing NVLink layer/step Replicas + prefetch Replica-aware token split Balance/locality FineMoE (Zhao et al., 2025b) Routed load MoE training Replica placement LP token scheduling EP compute balance ForeMoE (Zhou et al., 2026) Routing foresight MoE RL micro-step Relocate + replicate Post-route assignment Compute/transfer RoutePack Length + route replay Sealed optimizer window Accumulative relocation Trajectory scheduling Dense-side + EP tails
(a)
(b)

(c) Pilot routing statistics for Tiny and Flash: pooled layer-expert shares, physical-rank max-to-mean loads by layer, and category-pair Jensen-Shannon distances.
Figure 5. Routing skew under identity EP=8: (a) pooled within-layer expert shares (dashed: ); (b) rank max/mean per layer; (c) category-pair square-root Jensen–Shannon divergence ().
Figure 5 shows that RL post-training is imbalanced at two nested granularities. The hottest layer–expert cell receives and the uniform share for Tiny and Flash, respectively (a). Equal ownership still leaves worst-layer EP-rank max/mean ratios of and (b). Flash’s 64 experts per rank smooth its heavier expert tail more than Tiny’s 16, showing that expert- and rank-level imbalance are related but not interchangeable. Routing profiles are also task-conditioned: within-category cross-window distances are only –, whereas cross-category distances reach – (c) (Endres and Schindelin, 2003). Thus, task families induce distinct and repeatable physical-rank demand patterns.
Together, these observations motivate two complementary controls. Placement reduces aggregate rank skew over the optimizer window. Given that placement, a mixed window still contains trajectories with heterogeneous, potentially complementary signatures; rescheduling them across synchronized rows can reduce local rank peaks without changing the window’s sample multiset or aggregate routing demand.
2.4. Related Work
Dynamic expert placement predates MoE RL: FasterMoE shadows popular experts (He et al., 2022), SmartMoE combines offline strategy search with online selection (Zhai et al., 2023), FlexMoE remaps experts to devices from real-time traffic (Nie et al., 2023), and Lina prioritizes and balances all-to-all traffic (Li et al., 2023); all adapt to live or recently observed load. Replay-guided expert systems are closest to ours in signal, but differ in control granularity. ReLibra combines batch-level expert reordering and source-GPU assignment with intra-node replication and token splitting at microbatch granularity (Jin et al., 2026b). ForeMoE uses rollout foresight to relocate or replicate experts and reassign routed tokens at each micro-step (Zhou et al., 2026). LAER-MoE couples expert re-layout with token-routing decisions; Pro-Prophet plans balancing strategies and operator schedules (Liu et al., 2026; Wang et al., 2024). UltraEP, MoonEP, and FineMoE balance live routed work using redundancy or replica-aware token scheduling, while DeepEP optimizes dispatch and combine (Wei et al., 2026; Chen et al., 2026; Zhao et al., 2025b; Zhao et al., 2025a). In contrast, RoutePack commits a state-consistent expert map for the training interval and reschedules only complete trajectories.
Model–data co-scheduling also appears in MoE serving. Semantic Parallelism collocates likely co-activated experts and requests, while Gimbal coordinates expert placement and request admission (Li et al., 2025; Sun et al., 2026). Their target is inference locality rather than optimizer-window training.
Trajectory-side controls start from a different unit. RL frameworks construct token-capped microbatches for capacity utilization and length balance (Fu et al., 2025; Zhu et al., 2026; verl Team, 2026; OpenRLHF Team, 2026; NVIDIA, 2026b). Libra balances attention work; RollPacker groups long-tail rollouts into selected generation rounds; HARTS co-plans prefix-compressed microbatches, DP assignments, and slots for hybrid-attention RL (Wang et al., 2026; Gao and others, 2026; Meng and others, 2026). These systems do not couple each trajectory’s layer-wise routing demand to expert placement in fixed, capacity-feasible training rows. Table 4 summarizes the distinct signals and controls.
3. Hierarchical Planning and Expert Placement
3.1. Fixed-Row Feasibility
Under fixed placement , trajectory contributes the following demand to physical EP rank at layer :
Binary variables assign each trajectory exactly once, with every cell nonempty and within its token cap:
These constraints define for the execution rows introduced in Section 2.1. At fixed topology and capacity, a smaller feasible raises the average token payload per cell, exposing larger dense and grouped-expert kernels while amortizing launch, dispatch, and synchronization overhead over more useful work. It also creates fewer row boundaries at which participating ranks must synchronize, reducing execution fragmentation. We therefore choose the row count before comparing load-balanced layouts, and hold it fixed during that comparison. To maintain 1F1B pipeline occupancy, deployed search imposes at least rows. When fixed-bin feasibility is certified, the selected count is
Under a planning limit, is instead the best-known feasible count respecting the same pipeline floor. Every subsequent search remains inside . Section 4.2 reports row counts and workload gaps; Appendix K separates compaction from refinement at fixed .
With the peak objective below, fixed-row assignment is a 0–1 ILP after standard epigraph linearization. Its variables scale with trajectory–cell pairs and row–shard–layer–rank tuples, motivating the bounded specialized search in Section 4; Section 4.3 assesses generic-solver scaling.
3.2. Layer-Wise Expert Placement
By Equation 3, RoutePack first forms independently at each MoE layer. Let be the placement carried from the preceding window; the cold start uses identity placement. For a candidate placement,
Starting from , the planner repeatedly applies the cross-rank expert swap with the largest strict reduction in . It stops when the rank-load CV reaches or no improving swap remains. This greedy swap repair, in the spirit of LPT balancing (Graham, 1969), preserves the fixed number of experts per rank and stops moving experts once the layer reaches the CV target. Experts that stay on a rank keep their physical slots, while incoming experts fill slots vacated by outgoing experts. Thus, an accepted swap changes only its selected experts; all other rank–slot assignments remain resident. The resulting placement remains fixed throughout data-layout search and the associated forward–backward interval.
Figure 6 summarizes the state-consistent realization of . At a training-step boundary, RoutePack materializes the placement as part of state loading: expert parameters and their supported expert-indexed training state are copied into pre-existing physical slots, without replacing parameter objects or changing tensor shapes, gbuf ranges, or communicator membership. Logical top- routing remains unchanged: without changing the router bias, the dispatcher maps a selected expert to slot . Across all cells in the -row schedule, the expert mapping stays fixed during the whole forward–backward interval, allowing backward execution and activation recomputation to reuse the same physical layout without rewriting the logical computation graph or its dependencies. Consequently, 1F1B schedules, gradient accumulation, and the existing parallel groups retain their original semantics. Appendix D gives the detailed state-transfer protocol, incremental placement pseudocode, and compatibility scope.
Expert parameters and associated training state are materialized under a layer-local permutation. Independent dispatcher maps preserve logical routing through forward and backward, while canonical save restores logical order.
Figure 6. State-consistent expert placement and canonical export.Expert parameters and associated training state are materialized under a layer-local permutation. Independent dispatcher maps preserve logical routing through forward and backward, while canonical save restores logical order.
3.3. Controlled Placement Replay
We compare the incremental repair above with DeepSeek EPLB∗ adaptation (DeepSeek-AI, 2025) driven by the same aggregated demand. The starred R0 row fixes capacity and disables replicas; R2–R8 add slots and use an idealized even split of each replicated expert’s demand. On the shared replay corpus in Section 2.3.2, each planner carries its own mapping forward; Table 5 summarizes 19 transitions after the cold start. All variants are evaluated as offline placement replays under the same CV target. Timing spans ready loads to an executable mapping, excluding trace I/O and aggregation.
Table 5. Continuous placement replay. Hit: layer-steps meeting the CV target; Move: mean logical experts (incremental/R0) or replicated physical slots rewritten per transition.
| Planner | Hit (%) | Move | Churn (%) | P50 (ms) |
|---|---|---|---|---|
| Tiny () | ||||
| RoutePack incremental | 100.00 | 389 | 13.23 | 55.6 |
| EPLB∗ R0 | 45.08 | 2,504 | 85.07 | 14.8 |
| EPLB R2 (+12.5%) | 53.55 | 2,803 | 84.62 | 18.0 |
| EPLB R4 (+25.0%) | 51.95 | 3,028 | 82.27 | 20.4 |
| EPLB R8 (+50.0%) | 52.63 | 3,420 | 77.45 | 25.0 |
| Flash () | ||||
| RoutePack incremental | 100.00 | 736 | 3.59 | 237.0 |
| EPLB∗ R0 | 100.00 | 17,877 | 87.29 | 88.5 |
| EPLB R2 (+3.1%) | 100.00 | 18,342 | 86.85 | 104.0 |
| EPLB R4 (+6.3%) | 100.00 | 18,730 | 86.08 | 109.0 |
| EPLB R8 (+12.5%) | 100.00 | 19,509 | 84.67 | 119.0 |
On Tiny, incremental repair meets the target throughout, versus 45–53% for full-rebuild EPLB; it moves fewer experts than R0 and retains 86.77% of the placement. On Flash, all variants meet the target, but incremental repair moves fewer experts than R0 and retains 96.41%. Replicas do not improve the hit rate on Flash and add only about eight percentage points on Tiny while rewriting more slots.
EPLB optimizes worst-rank load through full rebuild rather than our CV gate, so its lower Tiny hit rate reflects an objective mismatch. Under the common CV target, EPLB∗ R0 plans – faster, but both are sub-second, and online placement exposes at most 61 ms median wait (Section 5.3). RoutePack stops at the CV target and preserves resident expert parameters and optimizer state; fewer changed experts can reduce state-materialization traffic at admission (Zhang and Wu, 2025).
Figure 7. Fixed-row rescheduling: diverse seeding, parallel annealing, and protected-parent resampling with a best-so-far archive.\sysname{} fixes the minimum-certified or best-known row count, constructs a diverse feasible population, and executes parallel simulated- annealing chains. Protected top-m slots and systematic residual slots form the next population, while per-chain best states update a separate monotonic archive.
3.4. Stage-Aware Objective and Scope
The normalized cell statistics are
For each dense-side stage (attention or dense FFN), its token-linear and token-pair terms are combined per DP cell before taking the slowest cell in EDP shard . The separate stage maxima are then accumulated because the stages lie serially on the projected row critical path:
The corresponding row-local EP load is
Summing the busiest physical rank independently at every MoE layer gives
Let and . At fixed , RoutePack ranks layouts by
ordered lexicographically. The primary term controls the slowest EDP shard over the optimizer step; total projected work and the worst row-local tail break ties. Conceptually, the planner minimizes ; operationally, it fixes before comparing layouts.
For equal-sized EDP shards, an assignment-independent fractional lower bound on the primary cost is
It permits fractional splitting across cells and shards, so ; integer capacity and whole-trajectory assignment can make equality unattainable.
Every construction and local move in this comparison preserves Equations 7–9, the selected row count, and the EDP topology. Exact lexicographic comparison maintains the best feasible incumbent.
Planning begins only after cross-trajectory statistics required by the learning rule have been attached to their records. Reordering then preserves every record and the complete optimizer-step multiset. It leaves the mathematical update unchanged whenever that update is invariant to record ordering and physical ownership; order-dependent algorithms must materialize their dependencies before planning.
4. Joint Dense-Side and Expert Trajectory Rescheduling
After fixing , RoutePack jointly optimizes the dense-side and expert components of Equation 16 by searching only trajectory-to-cell assignments in . Figure 7 and Algorithm 4.1 summarize the production search, which combines feasible construction, diversity-aware population selection, and parallel population annealing.
Left: Three expert-load profiles compare baseline, expert rerouting, and rerouting with trajectory rescheduling; two dense-side profiles compare the baseline schedule with the rescheduled Tiny trajectory layout. Right: Three bars per model summarize sparse and dense-side compute, peak-minus-mean gaps, and method-aligned mean row counts over 20 windows.
Figure 8. Modeled computation workloads. Left: one randomly selected non-tail Tiny execution row on separate expert and dense-side row-mean scales. Right: 20-window Tiny/Flash means; solid segments are mean compute, hatching is the peak-minus-mean gap, and whiskers show standard deviation.Left: Three expert-load profiles compare baseline, expert rerouting, and rerouting with trajectory rescheduling; two dense-side profiles compare the baseline schedule with the rescheduled Tiny trajectory layout. Right: Three bars per model summarize sparse and dense-side compute, peak-minus-mean gaps, and method-aligned mean row counts over 20 windows.
A target two-lane schedule of framework execution and CPU-side planning. Post-rollout work, optional failure handling, and placement-aware state loading form the framework path. Routing aggregation, expert balancing, seed construction, population annealing, and batch preparation form the planner path. State and prepared data join before GPU training.
Figure 9. Target post-rollout overlap schedule at training admission.A target two-lane schedule of framework execution and CPU-side planning. Post-rollout work, optional failure handling, and placement-aware state loading form the framework path. Routing aggregation, expert balancing, seed construction, population annealing, and batch preparation form the planner path. State and prepared data join before GPU training.
4.1. Population Construction and Parallel Annealing
Feasible population.
Length-FFD (Johnson et al., 1974) first establishes a feasible layout with cells. RoutePack retains it and an EDP-aware pairing of the same cells, then perturbs decreasing length order and chooses among the most occupied feasible cells. It pairs completed cells into rows by their incremental layer-wise EDP-rank peaks and rejects any trial that violates capacity, empties a cell, or changes trajectory coverage.
Canonicalization removes symmetries from row order, trajectory order within a cell, and exchangeable DP slots inside an EDP shard. Population selection keeps the exact-score winner, then adds competitive, structurally distinct candidates using co-assignment and compact token/load projections. Appendix E gives the complete construction and distance definition.
Parallel annealing.
Each population member runs an independent annealing chain over a geometric temperature segment (Kirkpatrick et al., 1983; Hukushima and Iba, 2003). A proposal either swaps trajectories between cells or relocates one trajectory without emptying its source. Most proposals choose a high-cost source row–shard and a low-cost target; the remainder preserve random exploration. Incremental rescoring updates only the two affected cells and their associated row–shard expert loads.
At a segment boundary, path weights favor chains that remain strong throughout cooling. Tempering limits population collapse, protected parents retain the best distinct terminal states, and systematic resampling (Carpenter et al., 1999) fills the remaining workers. A separate global incumbent is updated from every per-chain best state using the exact score in Equation 16. The returned layout is validated and cannot score worse than the best initial seed. Population members execute in a persistent CPU process pool, so one segment is paced by its slowest chain rather than by the sum of all proposals.
Pseudocode for \sysname{} hierarchical planning.
Algorithm 1: RoutePack hierarchical planning
Require: Replay profiles ; capacity ; DP and EDP topology; search budget
Ensure: Layer maps and feasible layout
1:
Aggregate and incrementally repair each carried placement to obtain
2:
Find the minimum-certified or best-known feasible
3:
Construct canonical fixed-row candidates from FFD, randomized best-fit, and EDP-aware cell pairing
4:
;
5:
Run parallel guided swap/relocation chains over each temperature segment; update from all per-chain best states
6:
Temper and resample terminal states while protecting strong distinct parents
7:
Validate and return
Appendix E specifies geometric cooling, path weighting, resampling, and the complete pseudocode.
4.2. Controlled Replay and Framework Integration
We replay both controls on the shared routing corpus to verify and visualize their effects on modeled dense-side and expert workloads before online measurement.
Figure 8 compares the same three policies as the online evaluation in Section 5 (DP=EP=8, EDP=1; 8192-token cap). Baseline (Base online) keeps identity placement and uses DP-local FFD: assign consecutive eight-trajectory shards to DP slots, shuffle equal-length ties, and pack decreasing lengths into the feasible cell with the fewest trajectories, opening a new cell if needed; row counts are synchronized. Expert reroute (Reroute) remaps each layer’s experts to physical EP ranks, leaving logical routing unchanged, while retaining Baseline’s packed rows; Full (Reroute+Reschedule) also reschedules the complete window at the window-level row count .
Section 2.2 predicts the control order: rescheduling cannot lower the placement-defined global EP bound, whereas rerouting can. To test both effects, we also replay Reschedule, Full’s data rescheduling under identity placement. Uniform EP work is
Table 6 separates the two EP excess terms:
As predicted, Reschedule leaves global excess unchanged; reducing only the row-local term yields 4.18% and 2.50% joint modeled savings on Tiny and Flash. Reroute nearly removes global excess, exposing a larger row-local gap for Full to reduce; Full’s joint savings reach 20.56% and 16.61%, respectively. Their modeled savings are nearly additive, consistent with distinct global and row-local targets.
Table 6. Global and row-local EP excess; joint cost saved versus Base (20-window means, %).
| Model | Policy | Global | Row-local | Joint saved |
|---|---|---|---|---|
| Tiny | Base | 61.23 | 9.40 | 0.00 |
| Reschedule | 61.23 | 1.41 | 4.18 | |
| Reroute | 0.06 | 23.17 | 15.30 | |
| Full | 0.06 | 8.84 | 20.56 | |
| Flash | Base | 36.03 | 3.18 | 0.00 |
| Reschedule | 36.03 | 2.23 | 2.50 | |
| Reroute | 0.05 | 11.39 | 13.41 | |
| Full | 0.05 | 8.24 | 16.61 |
The selected non-tail Tiny row trades a small dense-side peak increase for a larger expert-peak reduction. Across 40 windows, Full lowers the joint modeled cost and both gaps; Tiny’s residual sparse and dense-side gaps become comparable, while Flash remains sparse-dominated. Row compaction alone does not produce these modeled savings: under the same placement, global length-only FFD at raises the joint cost by 3.35% (Tiny) and 1.04% (Flash) relative to DP-local FFD, whereas RoutePack’s refinement at that row count lowers it by 9.42% and 4.68% relative to global FFD (Appendix K).
Rollout replay captures routed experts as trajectories complete. Figure 9 sketches the target: post-seal profile finalization and placement repair overlap post-rollout work; after is ready, CPU rescheduling and versioned state preparation run in parallel and join at training admission.
Let cover post-seal profile finalization and placement repair, the post-rollout statistics and safety gates, and placement-aware state loading. The data branch comprises asynchronous CPU planning () and subsequent worker batch preparation. The modeled sealing-to-admission makespan for this target schedule is
The rescheduling branch therefore stays off the modeled admission path whenever the first term does not exceed the second.
Appendix F gives host complexity and worker bounds.
4.3. Comparison with ILP Solver
Section 3.1 formulates fixed-row trajectory scheduling as a 0–1 ILP, making its optimum exactly solvable in principle. We solve it offline with Google OR-Tools CP-SAT (Perron and Furnon, 2026) as a generic diagnostic. CP-SAT presolves the integer model, then runs a parallel portfolio with conflict learning, propagation, linear relaxations, and neighborhood search. Unlike Population-SA, it can return a certified lower bound or prove optimality, but its assignment space grows as before the auxiliary peak variables are counted.
The comparison fixes placement, row count, capacity, and topology, and minimizes only from Equation 16. The common global length-only (FFD) layout supplies a complete assignment hint and a safe objective cut. The hint guides search but is not itself a registered CP-SAT incumbent; consequently, an Unknown status means that the solver returned no feasible assignment within the budget, not that the fixed-row problem is infeasible.
Table 7 compares reduction from that FFD layout on five warm profiles per model with complete eight-trajectory GRPO groups. The nested prefixes use . Population-SA has 64 members, two temperature levels, and 10,000 proposals per member and level; both methods use at most 64 workers. CP-SAT has a 60-s limit including presolve, longer than the 8K online median (Tiny: 7.39 s; Flash: 34.21 s; Table 10). Appendix J reports fixed-point quantization, statuses, and certified bounds.
Table 7. Median fixed-row primary-objective reduction from the common FFD layout over five profiles (%; higher is better). A dash means no incumbent within 60 seconds.
| Tiny SA | Tiny ILP | Flash SA | Flash ILP | |
|---|---|---|---|---|
| 32 | 6.63 | 6.64 | 12.02 | 11.59 |
| 64 | 5.68 | 5.35 | 8.38 | 6.77 |
| 128 | 7.53 | 1.04 | 6.73 | 2.38 |
| 256 | 6.19 | – | 4.99 | – |
At , only one Tiny profile is certified optimal; none of the five Flash profiles is. No profile is certified optimal at larger . By , CP-SAT’s median reduction is 1.04–2.38%, versus 6.73–7.53% for Population-SA. At , CP-SAT registers no incumbent in any selected profile, whereas Population-SA still improves FFD by 4.99–6.19% and retains a valid incumbent throughout its budget. Thus the generic solver is useful as a small-instance reference, but becomes uneconomical when the production window scales up.
The sweep stops at : a 512-trajectory solve or longer budget could improve or certify an incumbent, but would exceed the bounded online search budget.
5. Evaluation
This section reports online Megatron throughput in six configurations, plan quality, and admission timing in real post-training RL tasks.
5.1. Setup and Measurement Protocol
We evaluate the Tiny and Flash models from Section 2.3.2 in an in-house RL stack. All three policies use the same batching, state-management, routing replay, and Megatron execution interfaces. Every window holds 512 trajectories as in Section 2.3.2. Reroute and Full additionally aggregate the replayed expert IDs into one routing matrix per trajectory as rollouts complete.
Table 8 lists shared controls and per-run parallelism and rollout settings; CP and expert TP are one throughout. EDP counts planner-visible shards in the runtime partition , not additional GPUs. H20-3e uses all rows, while the cross-GPU study reuses the Tiny 16K row. Calibration is fixed for each configuration and hardware; Appendix K reports its coefficients and normalization.
Table 8. Runtime, parallelism, and rollout settings by model and context cap.
precision: BF16 moe_kernel: grouped GEMM dispatcher: DeepEP flex routing_groups: 8 group_topk: 4 expert_topk: 8 updates_per_window: 1 attention_backend: FlashAttention-3 (Shah et al., 2024) training_runtime: Megatron-LM (Narayanan et al., 2021) recompute: Attention, MoE/MLP activations loss_normalization: global
| Run | DP | TP | PP | EP | EDP | Cap. |
|---|---|---|---|---|---|---|
| Flash 8K | 8 | 1 | 4 | 8 | 1 | 8,192 |
| Flash 16K | 8 | 2 | 4 | 8 | 2 | 16,383 |
| Flash 32K | 8 | 2 | 4 | 8 | 2 | 32,767 |
| Tiny 8K | 8 | 1 | 1 | 8 | 1 | 8,192 |
| Tiny 16K | 8 | 1 | 1 | 8 | 1 | 16,384 |
| Tiny 32K | 8 | 2 | 1 | 8 | 1 | 32,768 |
Here updates_per_window: 1 means that each sealed optimizer window receives exactly one gradient update rather than PPO-style multiple updates. We normalize the loss over the full optimizer step, so the loss does not depend on the trajectory schedule.
Base, Reroute, and Full apply the policies defined in Section 4.2 to live sealed windows; unlike the offline reconstruction, Base uses its actual shuffle state. Reroute keeps Base’s DP-local rows, whereas Full uses the window-level row count . We collect online throughput during separate continuous mixed-task runs under the same deployment configuration, covering the post-admission Megatron training region rather than an isolated MoE operator. Following ReLibra (Jin et al., 2026b), we report training-stage throughput because RoutePack’s plan changes how the training stage executes; its admission-path costs are reported separately in Section 5.3.
For the mechanism analysis in Section 6.2, we additionally collect a separate all-rank Tiny 16K device trace for each method.
5.2. Online Megatron Throughput
5.2.1. Across Different Context Windows
For each deployment, we compare a common chronological prefix of the three jobs: logical step 1 is warmup, followed by 99 updates (98 for Tiny 16K). Repeated logger labels are ordered chronologically. We report , where is the effective training-token count and is Megatron training-region time, thereby weighting each processed token equally rather than averaging rates from unequal updates.
Two grouped bar charts show throughput differences from the baseline for expert rerouting and rerouting plus trajectory rescheduling on Flash and Tiny at 8K, 16K, and 32K context caps.
Figure 10. Observed Megatron training-region TPS difference from Base across six H20-3e configurations.Two grouped bar charts show throughput differences from the baseline for expert rerouting and rerouting plus trajectory rescheduling on Flash and Tiny at 8K, 16K, and 32K context caps.
Figure 10 shows the same ordering in all six deployment runs: expert placement alone (Reroute) raises TPS by 2.67–6.24% over Base, and adding trajectory rescheduling (Full) raises it by 4.44–11.85% over Base and by 1.33–5.28% over Reroute. The ordering also holds at intermediate 10-, 20-, 40-, 60-, and 80-update prefixes. The Full–Reroute contrast measures deployed training schedules, including changes in compute, collectives, and synchronization; it combines row compaction to with routing-aware refinement. At fixed , refinement alone lowers the modeled joint cost of the online plans by 2.11–5.06% (Section 5.3). Across the same configurations, both controls show reward progression comparable to Base over the first 100 optimizer updates (Appendix G).
5.2.2. Across Different GPUs
We additionally post-train the Tiny model with 16K context on NVIDIA Hopper H20 and H200 GPUs. Each GPU exposes 900 GB/s nominal bidirectional NVLink (NVIDIA, 2026a) but differs in dense BF16 throughput and HBM capacity. Training configurations remain the same as in Section 5.2.1.
Table 9 reports raw token-weighted TPS. Full improves same-platform training-region TPS by 1.92–8.37% across all three GPUs. Section 6.1 analyzes this cross-platform trend.
Table 9. Tiny 16K cross-GPU check. TPS is in kTok/s; uses the same-GPU Base. Parentheses report dense BF16 TFLOPS and HBM capacity (GB).
| GPU | Base | Reroute | Full | |
|---|---|---|---|---|
| H20-3e (148/141) | 47.119 | 49.286 | 51.064 | +8.37% |
| H200 (989/141) | 92.401 | 92.109 | 94.177 | +1.92% |
| H20 (148/96) | 42.396 | 43.459 | 44.088 | +3.99% |
5.3. Planner Quality and Admission Timing
Plan quality.
For each online input, we compare the final plan with its global length-only (FFD) initialization at fixed placement, trajectories, and row count, isolating routing-aware refinement after compaction. Let and be the initial and final primary costs, normalized by from Equation 17. Over 100 plans per configuration, we average , , excess removal , and reduction per plan. Here measures search quality, not recoverable execution time.
Six dumbbell rows show the joint cost of online plans relative to their fractional lower bound before and after routing-aware trajectory rescheduling. Every refined point is closer to one.
Figure 11. Online plan refinement of the modeled objective. Arrows point toward the fractional lower bound.Six dumbbell rows show the joint cost of online plans relative to their fractional lower bound before and after routing-aware trajectory rescheduling. Every refined point is closer to one.
Figure 11 shows that refinement removes 28.9–54.3% of the initial excess across all recorded online plans and lowers by 2.11–5.06%. Across configurations, the expert component falls by 2.6–24.8%, while dense-side cost changes by % to %; the joint search can therefore accept a small dense-side increase to remove a larger sparse tail. For EDP=2, uses the maximum shard total rather than summing shard-local component reports.
Planning and admission timing.
Against Figure 9’s target schedule, post-seal profile finalization plus placement repair takes 0.10–0.39 s p50 and finishes within in 389/594 warm windows (65.5%). Its exposed wait beyond (gate tail) has a p50 of zero in four runs and 50–61 ms in the other two; seven Flash windows have positive tails despite p95 zero. Commit takes 0.23–3.12 s p50.
CPU rescheduling takes 2.18–3.25 s p50, with 97.4–99.4% median planner/state overlap. State loading takes 4.91–34.21 s p50. Post-state batch await takes 27–55 ms on Flash versus 2.31–4.16 s on Tiny, including worker readiness and signaling during batch preparation. Base is the unmodified production admission path, which prepares batches and loads state without overlapping them, so it has no counterpart to the planner/state overlap measured here.
Table 10. Warm-window medians (s). Gate tail follows ; batch await follows state loading.
| Run | Gate tail | Batch await | |||
|---|---|---|---|---|---|
| Flash 8K | 1.82 | 0 | 2.18 | 34.21 | 0.027 |
| Flash 16K | 1.01 | 0 | 2.27 | 31.65 | 0.055 |
| Flash 32K | 1.01 | 0 | 2.67 | 31.21 | 0.055 |
| Tiny 8K | 0.045 | 0.061 | 3.25 | 7.39 | 2.418 |
| Tiny 16K | 2.02 | 0 | 2.84 | 9.08 | 4.165 |
| Tiny 32K | 0.052 | 0.050 | 2.33 | 4.91 | 2.309 |
6. Discussion and Limitations
6.1. Modeling EP Communication Overhead
Standard expert parallelism dispatches routed activations to expert-owning ranks and combines the outputs through a second all-to-allv exchange (Lepikhin et al., 2021; Jin et al., 2026a). For each execution row and MoE layer in EDP shard , we construct the off-rank traffic matrix induced by the recorded routing demand, the row assignment, and the physical expert placement. Let be its total off-rank demand and its largest send-or-receive endpoint load. SABRE’s endpoint-capacity argument (Wei and Bhatele, 2026) motivates comparing with the balanced endpoint load for an EP group of ranks. We aggregate this diagnostic across rows and layers as
Thus describes the excess endpoint pressure. Appendix B gives the full dispatch–combine derivation and its service-time assumptions.
We replay the three layouts in Table 11 on the shared 20-window corpus from Section 2.3.2. All use DP=EP=8 and EDP=1. The assignment-level diagnostic retains the baseline row count and reruns rescheduling at that fixed count, isolating redistribution from changes in collective count. For these EDP=1 runs, and each source DP slot is its own EP rank; Table 11 reports , where and are the corpus-window means of the numerator and denominator sums in Equation 19. Mean changes by less than 0.03% relative to Baseline. Expert rerouting removes 62.8% and 65.9% of the modeled imbalance overhead on Tiny and Flash, respectively; joint rescheduling raises these reductions to 82.6% and 76.5%. The improvement comes from lower endpoint concentration rather than lower assignment volume.
We additionally replay the same corpus with DeepEP’s rank-level deduplication: a token is sent once per destination rank even when several selected experts are colocated. Under the baseline’s group-top- and group-to-rank alignment, selected groups constrain destination-rank fanout. Rerouting disperses these experts across ranks and raises remote rank-token copies by 38.3% on Tiny and 23.3% on Flash while removing persistent endpoint skew. At fixed placement, rescheduling preserves window-total destination-rank copies, including local copies, but can change which copies are off-rank. It redistributes demand across rows, reducing the cumulative per-row/layer endpoint peak by 6.7% and 2.5% relative to rerouting-only, leaving it 1.3% and 4.9% above Baseline, while raising peak-weighted endpoint efficiency from 76.7% and 85.1% to 93.0% and 94.9%.
This locality–balance trade-off helps interpret the cross-GPU trend in Table 9. On H200, Reroute is slightly below Base, whereas Full is above it. Faster compute may expose reroute-induced fanout more strongly; Full’s trajectory schedule can affect compute and collectives through row count and row-local loads. The H20 and H20-3e results are consistent with more compute-tail headroom relative to communication pressure. DeepEP also streams routed activations and temporary buffers through HBM, so equal nominal NVLink bandwidth does not imply identical realized transport. H20-3e’s larger 141-GB HBM capacity can ease buffer pressure relative to H20’s 96 GB, providing a second plausible contributor to its larger gain, although these measurements do not isolate capacity from realized HBM service.
Table 11. Token assignment imbalance and DeepEP rank-deduplicated replay. Changes are relative to Baseline; Eff. is peak-weighted endpoint efficiency.
| Model | Layout | Remote | Peak | Eff. | |
|---|---|---|---|---|---|
| Tiny | Baseline | 72.7% | – | – | 76.7% |
| Reroute | 27.0% | +38.3% | +8.6% | 89.0% | |
| Full | 12.7% | +38.3% | +1.3% | 93.0% | |
| Flash | Baseline | 40.1% | – | – | 85.1% |
| Reroute | 13.7% | +23.3% | +7.6% | 93.3% | |
| Full | 9.4% | +23.3% | +4.9% | 94.9% |
6.2. Device-Side Analysis of Online Throughput
To examine the Tiny 16K H20-3e throughput result in Figure 10, we collect PyTorch traces from one randomly selected sealed optimizer window under each of Baseline, Reroute, and Full. We join kernel external IDs to their launching operators, form rank-local interval unions, and normalize by each run’s observed training tokens. The aggregate attention, dense/linear, expert, and routing compute varies by only 0.12% across traces; Table 12 groups these terms as Compute.
Relative to Baseline, Reroute has 5.9% more DeepEP payload and 10.7% more dispatch-side wait, but 74.3% less combine-side wait. Full has 3.3% more payload, 32.1% less dispatch-side wait, 82.1% less combine-side wait, and 9.4% lower total profiled rank-GPU cost. Chronologically aligned combine calls attribute 89.0–92.4% of combine wait to expert-stage rank tails. Full RoutePack has an expert-tail term 81.4% below Baseline. The remaining expert tail is only s/token, or 1.95% of the current profiled total, indicating limited headroom from further tightening expert balance.
Full RoutePack lowers combined D-wait and C-wait from to s/training token, a 66.0% reduction. The Tiny 8K replay in Section 4.2 reduces the modeled peak-minus-mean joint gap (hatched in Figure 8) by 79.6% over 20 windows; the replay isolates compute gaps, whereas the single-window trace also includes communication and synchronization, which can dilute the reduction. Appendix H details the operator and wait decomposition.
Table 12. Tiny 16K profiled rank-GPU time (s/training token).
| Layout | Compute | Payload | D-wait | C-wait | Other | Total |
|---|---|---|---|---|---|---|
| Baseline | 109.7 | 13.6 | 8.5 | 18.0 | 18.2 | 168.0 |
| Reroute | 109.7 | 14.4 | 9.4 | 4.6 | 19.4 | 157.6 |
| Full | 109.8 | 14.1 | 5.8 | 3.2 | 19.4 | 152.3 |
D/C-wait estimate differential waiting inside DeepEP dispatch/combine notify kernels. Values characterize active GPU capacity, exclude idle gaps, and are not per-token latency.
6.3. Deployment Implications
RoutePack assumes fresh routing replay for each optimizer window. Without it, expert-aware planning must use estimated demand: feasibility is preserved, but balance gains are not guaranteed. Search budget trades plan quality for host cost; trajectory bijection and the step-boundary placement contract preserve training correctness.
6.4. Limitations and Future Work
Broader validation should test workload and implementation generality separately: longer GRPO runs on varied task mixtures and group sizes (do the gains survive changing routing and reward dynamics?), Qwen- and GLM-family MoE models with other attention and routing designs (Qwen Team, 2025; GLM-4.5 Team, 2025), and an open-source RL framework such as Slime (Zhu et al., 2026), exercising replay capture, placement-consistent state loading, and trajectory rescheduling outside our in-house admission path. More windows and GPU traces would characterize D-/C-wait and expert-tail variation, and matched seal-to-update timing across profile acquisition, placement commit, and state loading would test full-window gains.
Tiny’s multi-second post-state batch await remains an admission straggler; instrumenting and parallelizing worker preparation and handoffs could remove it.
Calibration of grouped-GEMM latency across microbatch token shapes, active-expert counts, and tile occupancy would sharpen the rank-load proxy. Communication-aware planning could then incorporate DeepEP’s deduplicated fanout and endpoint peaks, with weights from topology-specific startup and overlap measurements. The objective does not model pipeline bubbles; in the PP=4 Flash deployments, PP enters only through the row floor, and modeling bubbles is a natural extension.
7. Conclusion
We presented RoutePack, a replay-guided planner coordinating state-consistent expert placement with whole-trajectory rescheduling. Incremental repair lowers the window-level physical-rank bound, while parallel population annealing balances dense-side work and row-local expert tails at a capacity-efficient row count without changing logical routing or the deployed topology. Across six deployments, full RoutePack records 4.44–11.85% higher post-admission Megatron training-region TPS than Base and 1.33–5.28% higher than rerouting-only within the same region. The communication analysis exposes a locality–balance trade-off.
Appendix A Routing and Dense-Side Details
This section complements Sections 2.1–2.2. Before planning, the replayed token-level expert IDs of each trajectory are summed into its exact per-layer expert-demand vector .
The dense-side proxy assigns every operator to one of two coefficients. Work proportional to the token count—dense FFNs, projections, recurrent state updates, and attention over a fixed-width window—enters ; token-to-token score and value aggregation enters . Hence KDA and Gated DeltaNet have , whereas MLA and full Gated Attention have . MQA and GQA shrink the projection and KV-state constants but keep the pairwise term (Ainslie et al., 2023), and top- or compressed attention patterns can be absorbed into calibrated coefficients.
In the evaluated Ling-3.0 checkpoints, KDA and MLA run as separate stages (InclusionAI, 2026a; Ant Ling, 2026). Dense FFNs and KDA depend only on the token count, so their coefficients are merged under one DP maximum; MLA keeps its linear and quadratic terms together inside each cell and takes its own stage maximum. The result is a compute proxy rather than a general kernel model; shape-aware calibration and the grouped-GEMM validation (Section C) are treated separately.
Appendix B EP Communication Model Derivation
Section 6.1 summarizes this diagnostic; here we derive it. An EP layer sends routed activations to the ranks that own the selected experts (dispatch) and returns the outputs through a second all-to-allv (combine). As a reference point, take one execution row of EDP shard at MoE layer , with balanced EP ranks, trajectories of tokens each, top- routing, and activation width . With uniform sources and destinations, each rank moves
activation elements across dispatch and combine (Jin et al., 2026a). At bytes per element and effective endpoint bandwidth , one dispatch–combine pass then takes when only bandwidth matters; backward passes and recomputation repeat this traffic and add their own multiplicative and overlap terms.
Real routing is not uniform. Let give the EP rank that hosts each source DP slot of shard . For , the row assignment , the placement , and the routed demand determine the off-rank traffic matrix
Local traffic is excluded, so the diagonal is zero, and combine traverses . Dropping the index , rank sends and rank receives . The total off-rank volume is , and the busiest endpoint carries
SABRE bounds the completion time of an exchange by its busiest endpoint (Wei and Bhatele, 2026):
With homogeneous full-duplex endpoints and both dispatch and combine counted, this gives a per-row, per-layer service estimate and its balanced counterpart:
Since , the balanced term is the fastest endpoint service possible for the given off-rank volume, and measures the excess. Uniform routing gives and , so reduces to as expected. The send/receive maximum remains a capacity lower bound even when overlap is imperfect; reaching it would additionally require concurrent service at every endpoint and no narrower bottleneck elsewhere in the topology.
Appendix C Grouped-GEMM Cost-Model Validation
This section gives the protocol behind Section 2.3.1 and Figure 4. The shapes are per-expert token counts recorded at the TEGroupedMLP input after DeepEP dispatch: 480 layer–EP-group observations with 16 ranks per group and 32 local experts per rank, i.e., 7,680 rank shapes. For each shape we time bf16 forward and backward passes of the and projections, with five warm-up and 20 timed iterations. Rank latency has a median of 3.8004 ms, a 90th percentile of 13.5175 ms, a 99th percentile of 24.4649 ms, and a maximum of 38.0371 ms. Rank demand has a median of 34,014 tokens, a 90th percentile of 163,038, and a maximum of 459,985. The benchmark covers grouped-GEMM compute only; communication is reflected in the trainer-level throughput measurements.
Over the 480 layer–EP-group observations, the EP-rank max/mean ratio of token counts and of latency is distributed as follows:
| Mean | P50 | P90 | P95 | P99 | Max | |
|---|---|---|---|---|---|---|
| Token | 3.5698 | 3.5244 | 5.0788 | 5.3517 | 6.7437 | 7.0188 |
| Latency | 2.9049 | 2.8099 | 3.9500 | 4.1629 | 5.2246 | 5.3572 |
The single-rank fixed-token control in Table 2 complements this sweep.
Appendix D State-Consistent Expert Placement
Algorithm 2: Incremental layer-local expert placement
Require: Aggregate loads ; prior map ; physical ranks ; slots per rank; CV gate
Ensure: Slot permutation with experts per rank
1:
; compute for all
2:
While , find the cross-rank pair whose swap gives the largest strict reduction in
3:
If no improving pair exists, stop; otherwise swap their rank assignments and update the two affected rank loads
4:
Keep the exact slots of experts that remain on their source rank; place incoming experts into slots vacated by outgoing experts
5:
return
Algorithm D is the incremental repair of Section 3.2. Each resulting takes effect only at a training-step boundary. Expert FC weights are copied into the existing destination tensors, so parameter objects and gradient-buffer descriptors are never rebuilt. The same map moves every expert-indexed companion: master weights, optimizer moments, quantization scales, and other per-expert metadata. Under a distributed optimizer, each source gbuf range is sent within its state-consistency domain and written into the existing destination range, keeping ownership and tensor addresses fixed.
The router still indexes experts logically; only the dispatcher translates a replayed top- expert ID into physical slot . Routing probabilities therefore keep their original differentiable columns, and expert gradients accumulate in destination-slot gbuf views whose optimizer state moved with them. DeepEP receives the remapped physical indices through its unchanged dispatch/combine API (Zhao et al., 2025a), and a checkpoint can be exported in canonical order by applying at a step boundary.
Every TP shard applies the same permutation, and DP replicas and EDP lanes commit it within their state-consistency domain. Because the layout stays fixed for the whole forward–backward interval, TP, SP, CP, PP, 1F1B, activation recomputation, gradient accumulation, and distributed-optimizer sharding all see unchanged shapes, groups, and dependencies. Mechanisms that add replicas or change ownership within an interval fall outside this contract.
Appendix E Trajectory Rescheduling Search Details
E.1. Diverse Fixed-Row Seeding
This subsection details the seeding outlined in Section 4.1. For target , the planner creates cells and always keeps two seeds: the canonical FFD layout and its EDP-aware pairing. Further trials perturb the nonincreasing length order (WindowShuffle), let RandomizedBestFit choose among the most occupied cells that still fit, and then pair the completed cells by their incremental EDP-rank peaks. Any trial that leaves is discarded.
Layouts that differ only in trajectory order within a cell, in row order, or in the order of exchangeable DP slots inside an EDP shard are identical, and canonicalization removes these symmetries. To measure structural diversity, the planner caches for the normalized row-feature matrix and fixed projections , and combines the deterministic sliced-Wasserstein term with cell- and row-level co-assignment (Rabin et al., 2011). Selection starts from the exact-score winner and then trades distance from the already selected set against the normalized gap in primary score.
Algorithm 3: Diverse fixed-row initialization
Require: Trajectories; ; ; ; EDP groups; fixed ; candidate and population budgets
Ensure: A feasible initial population
1:
2:
; insert both into canonical map
3:
Generate randomized best-fit fixed-row trials and reject any trial outside
4:
Pair trial cells with EDPAwarePair and retain the best exact score per canonical signature
5:
; repeat selected members only if needed to fill the worker population
6:
return
E.2. Cooling, Path Weights, and Resampling
Population-SA splits a geometric schedule into segments; inside segment , step runs at
Metropolis acceptance compares the scalar energy
where . The scalarization serves only acceptance; winners are always chosen by the exact tuple. Measured against a reference energy and scale , worker accumulates the path weight
At each segment boundary, the planner turns the into resampling probabilities and flattens them with the smallest tempering factor whose multinomial proxy yields the requested number of distinct parents. The strongest distinct parents are each kept once, and systematic resampling fills the remaining positions. Terminal states seed the next segment, while each chain’s best state feeds a separate exact-score incumbent, so a good transient solution is never lost even though it does not replace the parent state tied to the path weight.
Pseudocode for Fixed-row Population Annealing.
Algorithm 4: Fixed-row Population Annealing
Require: Initial population ; geometric temperatures; segment length ; fixed
Ensure: A valid, non-regressing layout
1:
Initialize from the best exact-score seed
2:
For each temperature segment, run one guided swap/relocation chain per population member in parallel
3:
Accept feasible proposals by Metropolis energy and update each per-chain best state
4:
Update by exact lexicographic comparison
5:
Temper path weights, protect strong distinct parents, and systematically resample terminal states
6:
Validate coverage, capacity, nonempty cells, row count, topology, and non-regression; return
Appendix F Planner Complexity
Figure 12 shows where the planner sits in the framework timeline; Figure 9 gives the corresponding target schedule.
SGLang rollout workers stream trajectories to reward evaluation and routing replay. A CPU planner computes row count, layer-wise expert placement, and EDP-local data layout. Model-state preparation and CPU rescheduling execute in parallel and join before Megatron training admission. SGLang rollout workers stream trajectories to reward evaluation and routing replay. A CPU planner computes row count, layer-wise expert placement, and EDP-local data layout. Model-state preparation and CPU rescheduling execute in parallel and join before Megatron training admission.
Figure 12. RoutePack in the RL framework: CPU planning overlaps post-rollout processing and state preparation.
Let trajectories fill cells, and let be the numbers of MoE layers, logical experts, physical EP ranks, and EDP shards. Aggregating routes and repairing placement costs . With workers and fixed population, temperature, and proposal budgets, annealing takes at most
wall time. Randomized best-fit costs and cell pairing ; with cached -projection sketches, encoding a candidate costs and comparing two profiles . When enough workers saturate candidate generation and population transitions, the total is
For a fixed topology and search budget, every added search term is polynomial in the row count. These bounds are conservative; Section 5.3 reports the measured planning time and exposed wait.
Appendix G Online Measurement Details
Table 13 lists the absolute rates behind Figure 10, and Figure 13 shows the reward curves of the same runs.
Choice of online policies.
The closest expert-side systems, ReLibra and ForeMoE, are not open source (Jin et al., 2026b; Zhou et al., 2026). Their microbatch-level expert replication and token splitting also change the training unit that our state-consistency contract keeps fixed, so a like-for-like deployment is not possible; Table 4 compares their signals and controls instead. Table 6 isolates the reverse control order (rescheduling under identity placement), and Section K shows that global length-only FFD raises the joint proxy on all 20 Tiny windows and on 17 of 20 Flash windows. The online study therefore follows the deployed hierarchy: Base, Reroute, and Full.
Table 13. Megatron training-region throughput (kTok/s); parentheses give within-run per-update TPS CV (%).
| Run | Base | Reroute | +Resched. |
|---|---|---|---|
| Flash 8K | 37.005 (3.65) | 37.994 (4.14) | 38.649 (4.04) |
| Flash 16K | 57.775 (4.92) | 59.416 (5.22) | 61.175 (5.95) |
| Flash 32K | 44.041 (5.46) | 46.791 (5.98) | 49.260 (5.34) |
| Tiny 8K | 49.504 (2.40) | 51.051 (1.56) | 52.225 (1.31) |
| Tiny 16K | 47.119 (2.38) | 49.286 (1.64) | 51.064 (1.33) |
| Tiny 32K | 78.323 (2.12) | 81.312 (2.42) | 82.391 (2.23) |
Tiny 16K uses 98 post-warm-up updates per policy, and the other H20-3e runs use 99. Because each policy is a separate stochastic job, update of one policy does not see the same trajectories as update of another. The fixed-input replay of Section 4.2 shows the same Base–Reroute–Full ordering in modeled joint cost on shared windows. The CVs in Table 13 describe variation within one online job, not uncertainty across independent runs.
Six reward plots arranged by context window and model compare Baseline, Expert reroute, and Reroute plus trajectory rescheduling over the first 100 optimizer updates. All curves maintain an increasing training trend.
Figure 13. Training reward over the first 100 optimizer updates on six H20-3e configurations. Faint lines show per-update rewards; emphasized traces show five-update moving averages.Six reward plots arranged by context window and model compare Baseline, Expert reroute, and Reroute plus trajectory rescheduling over the first 100 optimizer updates. All curves maintain an increasing training trend.
Appendix H Profiler Accounting
The case study of Section 6.2 covers all eight ranks of one randomly chosen sealed window per method. We keep Kineto’s GPU kernel, memcpy, and memset events, with timestamps and durations in microseconds. Writing for the interval-union duration of an event set , overlapping events of one category are counted once and nested host annotations are never summed. All methods are classified by the same ordered rules (Table 14); a kernel with an ambiguous name inherits the category of the CPU operator that launched it, found through Kineto’s external ID.
Table 14. GPU trace category rules.
| Category | Included device events |
|---|---|
| Attention | KDA and cuDNN SDPA/Flash-attention kernels, plus associated attention BMM, mask, and reduction operators recovered by external ID. |
| Dense/linear | Generic GEMM kernels launched by mm, addmm, linear, or matmul. |
| Expert | Grouped-GEMM kernels (grouped, group_gemm, or nvjet) and kernels launched by grouped-linear backward. |
| Routing | Top-, token index/scatter-add, and router mask/reduction operators recovered by external ID. |
| EP payload | DeepEP dispatch and combine kernels whose names do not contain notify. |
| Dispatch wait | Cross-rank duration above the per-call minimum for uncached- and cached-dispatch notify kernels. |
| Combine wait | Cross-rank duration above the per-call minimum for cached-combine notify kernels. |
| Other | Residual GPU-union time: model glue, non-EP collectives, copies and sets, optimizer and unmatched kernels, and the common notify/control floor. |
D-wait and C-wait in Table 12 are the Dispatch-wait and Combine-wait rows here. The names give the synchronization point, not the cause: skew in attention, dense, or routing work can surface as dispatch-side waiting, and payload or expert-path skew as combine-side waiting.
Both waits come from DeepEP’s notify kernels for uncached dispatch, cached dispatch, and cached combine. Within each kind, calls are ordered by GPU timestamp and matched across ranks by ordinal. With the duration of call of kind on rank , the wait is
Subtracting the per-call minimum removes the control work that every rank performs, so the remainder estimates how long ranks wait for one another, not network latency or total notify time. Every rank issues the same number of calls of each kind within a run, so ordinal matching drops nothing: Baseline and Reroute issue 1,334 dispatch, 1,334 cached-dispatch, and 2,668 cached-combine calls per rank, and Full issues 1,288, 1,288, and 2,576.
Let be the union of all retained GPU intervals of method on rank . Other is what remains of after subtracting the compute categories, EP payload, and the two waits; attention auxiliaries and recognizable dense, linear, and grouped-linear kernels are thus charged to their model component rather than left in Other. On every rank, the category unions overlap by at most 0.085% of the all-GPU union, and this overlap stays in Other together with unmatched events. An attention- or dense-side straggler appears only if it materializes as a retained GPU collective or control kernel; idle GPU gaps and host-side synchronization lie outside the interval union.
With observed training tokens, each entry is
so by construction Total equals . The unit is consumed rank-GPU capacity per training token; it is neither per-token latency nor unprofiled end-to-end time. Normalizing by tokens softens the effect of independent rollout sampling, but the result remains a mechanism case study rather than a paired throughput comparison.
Table 15. Disaggregated Tiny 16K trace accounting (s/training token).
| Category | Baseline | Reroute | Full |
|---|---|---|---|
| Attention | 44.875 | 44.793 | 44.982 |
| Dense/linear | 0.433 | 0.433 | 0.432 |
| Expert | 57.270 | 57.388 | 57.292 |
| Routing | 7.113 | 7.126 | 7.116 |
| EP payload | 13.619 | 14.416 | 14.073 |
| Dispatch wait | 8.532 | 9.442 | 5.795 |
| Combine wait | 17.964 | 4.616 | 3.215 |
| Other | 18.183 | 19.384 | 19.359 |
| Total | 167.989 | 157.598 | 152.264 |
The first four rows of Table 15 add up to the Compute column of Table 12; the remaining rows map one-to-one to its other columns.
Dispatch-side decomposition.
Dispatch wait spans two synchronization points: the uncached notify exchanges each row’s counts and metadata, and the cached notify reuses that layout. Rerouting raises both slightly, whereas joint rescheduling lowers both (Table 16).
Table 16. Dispatch-wait decomposition (s/training token).
| Method | Uncached | Cached | Total |
|---|---|---|---|
| Baseline | 4.397 | 4.134 | 8.532 |
| Reroute | 4.711 | 4.731 | 9.442 |
| Full | 3.372 | 2.423 | 5.795 |
Combine-side attribution.
For combine call , spans rank ’s first grouped GEMM after the preceding dispatch payload through its last grouped GEMM before the combine notify, and the expert tail is . Each combine matches exactly one dispatch, and the median spread of notify completion across the eight ranks is only s. The expert tail makes up 89.0–92.4% of combine wait (Table 17); Reroute shrinks it by 73.6% and Full by 81.4%, which accounts for 88.1% and 88.2% of their respective combine-wait reductions.
Table 17. Combine-wait attribution (s/training token).
| Method | Expert tail | Residual | Total | Share |
|---|---|---|---|---|
| Baseline | 15.987 | 1.977 | 17.964 | 89.0% |
| Reroute | 4.229 | 0.387 | 4.616 | 91.6% |
| Full | 2.971 | 0.244 | 3.215 | 92.4% |
Other.
Table 18 splits the residual. Model glue collects the remaining operator-launched elementwise, copy, normalization, residual, and miscellaneous kernels that cannot be safely charged to one model component, and the negative row corrects the small overlap between category unions. Nearly all of Other is stable framework and model glue, not hidden dense or attention GEMM work.
Table 18. Residual Other decomposition (s/training token).
| Component | Baseline | Reroute | Full |
|---|---|---|---|
| Model glue | 17.614 | 18.782 | 18.764 |
| Non-EP comm./memory | 0.305 | 0.340 | 0.336 |
| Notify/control floor | 0.276 | 0.273 | 0.274 |
| Unmatched GEMM | 0.110 | 0.111 | 0.108 |
| Overlap adjustment | |||
| Total | 18.183 | 19.384 | 19.359 |
Appendix I Online Plan Refinement Details
Table 19 lists the exact per-configuration means plotted in Figure 11.
Table 19. Online plan refinement relative to the fractional lower bound.
| Run | (%) | (%) | ||
|---|---|---|---|---|
| Flash 8K | 1.0758 | 1.0529 | 28.91 | 2.11 |
| Flash 16K | 1.0852 | 1.0553 | 33.58 | 2.75 |
| Flash 32K | 1.0612 | 1.0265 | 52.22 | 3.23 |
| Tiny 8K | 1.1213 | 1.0643 | 46.03 | 5.06 |
| Tiny 16K | 1.0871 | 1.0557 | 32.92 | 2.86 |
| Tiny 32K | 1.0774 | 1.0338 | 54.28 | 4.02 |
Appendix J Fixed-Row ILP Scaling
Section 4.3 uses five warm profiles per model, drawn with NumPy seed 42: Tiny steps 2, 8, 9, 12, and 13, and Flash steps 2, 9, 14, 15, and 17. Every nested prefix consists of complete eight-trajectory GRPO groups. For each subproblem, we first replay the chronological incremental-placement chain and then freeze the resulting physical EP loads, the global length-only (FFD) row count, capacity 8,192, DP=8, and PP=1; both models use a single eight-slot EDP shard.
Population-SA and the ILP backend, Google OR-Tools 9.15 CP-SAT (a constraint-programming solver built on satisfiability methods), optimize the same primary objective with at most 64 workers each. Population-SA uses 64 members, two temperature levels, and 10,000 proposals per member and level. CP-SAT starts from the global FFD plan, supplied as a complete hint and a safe objective cut, runs for at most 60 s including presolve, and scales weights to fixed point by . The hint does not register as an incumbent, and only an Optimal status certifies the quantized fixed-row subproblem. Expert placement, row count, capacity, and EDP topology stay fixed for both methods.
Table 20. Median objective reduction from FFD over five profiles (%). ILP uses OR-Tools CP-SAT. O/F/U: Optimal/Feasible/Unknown; U has no returned incumbent.
| Model | Pop.-SA | ILP | Status | |
|---|---|---|---|---|
| Tiny | 32 | 6.63 | 6.64 | 1O+4F |
| Tiny | 64 | 5.68 | 5.35 | 5F |
| Tiny | 128 | 7.53 | 1.04 | 5F |
| Tiny | 256 | 6.19 | – | 5U |
| Flash | 32 | 12.02 | 11.59 | 5F |
| Flash | 64 | 8.38 | 6.77 | 5F |
| Flash | 128 | 6.73 | 2.38 | 5F |
| Flash | 256 | 4.99 | – | 5U |
We report the feasible objective reduction instead of a fraction of the optimum: within the time limit, the CP-SAT lower bound can remain far from its incumbent, and Unknown is not evidence of infeasibility. Nor does the comparison establish global optimality for Population-SA. It shows only that the bounded production search keeps returning improving feasible layouts as the general-purpose formulation becomes hard to even initialize within the available budget.
Appendix K Offline Trajectory Rescheduling Ablation
Protocol.
This ablation uses the 20-window corpus of Section 2.3.2 (Table 3) with DP=8, EP=8, EDP=1, all other parallel dimensions set to one, and an 8,192-token cell capacity; recorded trajectory lengths decide capacity feasibility. Flash’s recorded PP=4 only imposes an eight-row minimum, which never binds because every replayed layout has at least 11 rows, so no pipeline schedule is modeled. Within a window, all three schedules share one thresholded layer-wise placement that starts from identity and stops at a CV of . The study isolates data layout and does not evaluate continuous placement or state migration.
Baseline is the in-house DP-local FFD defined in Section 4.2. The dumps lack live shard identifiers and RNG state, so we reconstruct it algorithmically: shard size eight, base shuffle seed 42, and the zero-based window ordinal (the plotted window index minus one) as the shuffle counter. Global FFD packs the whole window by length into a feasible row layout, and RoutePack runs diverse seeding, EDP-aware cell pairing, and Population-SA at that same global row count. Online measurements follow the deployed Base–Reroute–Full ladder; this fixed-input replay adds Global FFD to separate the row-count benefit of length-only compaction from its effect on expert peaks and from the routing-aware refinement that follows. Both models use the same planner code and search budget: eight candidate layouts, 64 population members, two levels, 10,000 proposals per member and level, at least eight surviving parents, and eight local worker processes, with rescheduling seed 0 and SA seed 42.
The dense side accumulates two maxima separately, KDA plus dense FFN (linear) and MLA, with model-specific coefficients (KDA-plus-dense linear, MLA linear, MLA quadratic) of (148.689, 42.896, 53.333) for Tiny and (155.017, 27.803, 24.889) for Flash. These values are rounded here; the replay uses the supplied full-precision values without rescaling. All costs are compute proxies, not measured latency or throughput. Each window’s cost is normalized to its own in-house-baseline reference before averaging, and raw costs are never compared across models.
Table 21. Offline trajectory rescheduling (20 windows per model; Baseline: DP-local FFD; costs: mean per-window ratios, baseline=100; Util.: token-cap utilization).
| Schedule | Rows | Util. (%) | EP | Dense-side | Joint |
|---|---|---|---|---|---|
| MoE layers experts: | |||||
| Baseline | 63.25 | 85.89 | 100.00 | 100.00 | 100.00 |
| Global FFD | 60.30 | 90.07 | 113.04 | 93.99 | 103.35 |
| RoutePack | 60.30 | 90.07 | 88.41 | 98.66 | 93.61 |
| MoE layers experts: | |||||
| Baseline | 31.70 | 90.36 | 100.00 | 100.00 | 100.00 |
| Global FFD | 29.95 | 95.77 | 105.84 | 93.19 | 101.04 |
| RoutePack | 29.95 | 95.77 | 97.18 | 94.89 | 96.31 |
Tiny: MoE layers, experts per layer
Flash: MoE layers, experts per layer
Figure 14. Offline trajectory rescheduling under shared expert placement: (a) Tiny; (b) Flash. Left: synchronized rows; right: per-window joint compute proxy relative to the DP-local FFD baseline.Twenty-window offline trajectory-rescheduling ablation for Tiny and Flash. Left panels show fewer rows under global rescheduling; Global FFD and \sysname{} have identical row counts. Right panels show that length-only scheduling raises the mean joint proxy, whereas \sysname{} reduces it in every optimizer window.
Compaction alone is insufficient.
Global FFD needs fewer rows on every window of both models: the mean drops from 63.25 to 60.30 on Tiny and from 31.70 to 29.95 on Flash (Table 21), i.e., mean per-window reductions of 4.65% and 5.64%, with 4.91% and 6.01% more tokens per cell. Yet it raises the joint proxy by 3.35% on Tiny and 1.04% on Flash and is worse on 20/20 and 17/20 windows, because higher EP peaks outweigh its lower dense-side cost. Fewer, denser rows therefore do not by themselves imply a lower joint cost or faster grouped-GEMM execution, which is why Global FFD serves online only as the planner’s fixed-row starting point, not as a deployed policy.
Routing-aware refinement.
At the same global row count, RoutePack lowers the joint proxy by 9.42% (Tiny) and 4.68% (Flash) relative to Global FFD, accepting 4.96% and 1.83% more dense-side cost in exchange for 21.77% and 8.16% less EP cost. Against the in-house baseline, the final layout lowers the joint proxy on all 20 windows of each model: by 6.39% on average for Tiny (range 3.44–8.62%) and 3.69% for Flash (2.65–4.87%). Figure 14 plots every window rather than a selected example. These fixed-row gains come from seed construction, cell pairing, and annealing together, not from annealing alone.
Checks and limitations.
All 120 layouts keep exact trajectory coverage, expert demand, and the token cap. The global row count reaches the capacity lower bound on 0/20 Tiny and 8/20 Flash windows; elsewhere it is a feasible heuristic count, not a certified minimum. Re-running the baseline reconstruction with shuffle counters 0–4 in addition to the window-ordinal counter gives 115 distinct window/counter controls per model, and RoutePack’s joint reduction stays positive in all of them: 3.40–8.62% on Tiny and 2.21–5.06% on Flash. These are sensitivity checks, not additional independent windows, and a single SA seed per window does not establish robustness to the search seed. The study does not measure kernel efficiency, pipeline bubbles, or end-to-end speedup.
References
J. Ainslie, J. Lee-Thorp, M. de Jong, Y. Zemlyanskiy, F. Lebrón, and S. Sanghai GQA: training generalized multi-query transformer models from multi-head checkpoints. arXiv preprint arXiv:2305.13245. Cited by: Appendix A, §2.2.
Ant Ling Ling model documentation. Note: Official model documentation External Links: Link Cited by: Appendix A, §2.3.2.
J. Carpenter, P. Clifford, and P. Fearnhead An improved particle filter for non-linear problems. IEE Proceedings—Radar, Sonar and Navigation 146 (1), pp. 2–7. External Links: Document Cited by: §4.1.
Y. Chen, C. Li, Y. Wang, and M. Wei MoonEP: a perfectly balanced expert parallelism library via dynamic redundant experts. Note: https://github.com/MoonshotAI/MoonEP Cited by: §1, §2.4, Table 4.
DeepSeek-AI DeepSeek-v2: a strong, economical, and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434. Cited by: §2.2.
DeepSeek-AI DeepSeek-v3 technical report. arXiv preprint arXiv:2412.19437. Cited by: §1.
DeepSeek-AI EPLB: expert parallelism load balancer. GitHub. Note: https://github.com/deepseek-ai/EPLB Cited by: §3.3.
D. M. Endres and J. E. Schindelin A new metric for probability distributions. IEEE Transactions on Information Theory 49 (7), pp. 1858–1860. External Links: Document Cited by: §2.3.2.
W. Fu, J. Gao, X. Shen, C. Zhu, Z. Mei, C. He, S. Xu, G. Wei, J. Mei, J. Wang, T. Yang, B. Yuan, and Y. Wu AReaL: a large-scale asynchronous reinforcement learning system for language reasoning. arXiv preprint arXiv:2505.24298. Cited by: §2.4, Table 4.
W. Gao et al. RollPacker: taming long-tail rollouts for RL post-training with tail batching. In Proceedings of the 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI), pp. 849–866. Cited by: §2.4.
GLM-4.5 Team GLM-4.5: agentic, reasoning, and coding (ARC) foundation models. arXiv preprint arXiv:2508.06471. External Links: Link Cited by: §6.4.
R. L. Graham Bounds on multiprocessing timing anomalies. SIAM Journal on Applied Mathematics 17 (2), pp. 416–429. External Links: Document Cited by: §3.2.
J. He, J. Zhai, T. Antunes, H. Wang, F. Luo, S. Shi, and Q. Li FasterMoE: modeling and optimizing training of large-scale dynamic pre-trained models. In Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’22. External Links: Document Cited by: §2.4.
K. Hukushima and Y. Iba Population annealing and its application to a spin glass. In AIP Conference Proceedings, Vol. 690, Melville, NY, pp. 200–206. External Links: Document Cited by: §4.1.
InclusionAI Ling-3.0-Flash. Note: Official model card External Links: Link Cited by: Appendix A, §2.3.2.
InclusionAI Ling-3.0-Tiny. Note: Official model card External Links: Link Cited by: §2.3.2.
C. Jin, Z. Jiang, Z. Bai, Z. Zhong, J. Liu, X. Li, N. Zheng, X. Wang, C. Xie, Q. Huang, W. Heng, Y. Ma, W. Bao, S. Zheng, Y. Peng, H. Lin, X. Liu, X. Jin, and X. Liu MegaScale-MoE: large-scale communication-efficient training of mixture-of-experts models in production. In Proceedings of the Twenty-First European Conference on Computer Systems, EuroSys ’26, New York, NY, USA. External Links: Document Cited by: Appendix B, §6.1.
C. Jin, X. Wei, Y. Zhong, C. Yang, B. Wu, R. Zhu, Z. Zhang, Y. Liu, and X. Jin ReLibra: routing-replay-guided load balancing for MoE training in reinforcement learning. arXiv preprint arXiv:2605.08639. Cited by: Appendix G, §1, §1, §1, §2.1, §2.4, Table 4, §5.1, footnote 1.
D. S. Johnson, A. Demers, J. D. Ullman, M. R. Garey, and R. L. Graham Worst-case performance bounds for simple one-dimensional packing algorithms. SIAM Journal on Computing 3 (4), pp. 299–325. External Links: Document Cited by: §4.1.
Kimi Team Kimi linear: an expressive, efficient attention architecture. arXiv preprint arXiv:2510.26692. Cited by: §2.2.
S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi Optimization by simulated annealing. Science 220 (4598), pp. 671–680. External Links: Document Cited by: §4.1.
D. Lepikhin, H. Lee, Y. Xu, D. Chen, O. Firat, Y. Huang, M. Krikun, N. Shazeer, and Z. Chen GShard: scaling giant models with conditional computation and automatic sharding. In International Conference on Learning Representations, Cited by: §6.1.
J. Li, Y. Jiang, Y. Zhu, C. Wang, and H. Xu Accelerating distributed MoE training and inference with Lina. In 2023 USENIX Annual Technical Conference (USENIX ATC 23), pp. 945–959. Cited by: §2.4.
Y. Li, Z. Zhang, Z. Wang, P. Chen, and P. Zheng Semantic parallelism: redefining efficient MoE inference via model–data co-scheduling. arXiv preprint arXiv:2503.04398. Cited by: §2.4, Table 4.
X. Liu, Y. Wang, F. Fu, X. Xiao, H. Li, J. Li, and B. Cui LAER-MoE: load-adaptive expert re-layout for efficient mixture-of-experts training. In Proceedings of the 31st ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2, External Links: Document Cited by: §2.4.
W. Ma, H. Zhang, L. Zhao, Y. Song, Y. Wang, Z. Sui, and F. Luo Stabilizing MoE reinforcement learning by aligning training and inference routers. arXiv preprint arXiv:2510.11370. Cited by: §1, §2.1.
B. Meng et al. HARTS: efficient agentic reinforcement learning for hybrid-attention models over arbitrary rollout trees. arXiv preprint arXiv:2608.28158. Cited by: §1, §2.4.
D. Narayanan, M. Shoeybi, J. Casper, P. LeGresley, M. Patwary, V. A. Korthikanti, D. Vainbrand, P. Kashinkunti, J. Bernauer, B. Catanzaro, A. Phanishayee, and M. Zaharia Efficient large-scale language model training on gpu clusters using Megatron-LM. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, New York, NY, pp. 1–15. External Links: Document Cited by: Table 8.
X. Nie, X. Miao, Z. Wang, Z. Yang, J. Xue, L. Ma, G. Cao, and B. Cui FlexMoE: scaling large-scale sparse pre-trained model training via dynamic device placement. Proceedings of the ACM on Management of Data 1 (1). External Links: Document Cited by: §2.4.
NVIDIA NVIDIA Hopper GPU Architecture. Note: Official architecture documentation External Links: Link Cited by: §5.2.2.
NVIDIA Sequence packing and dynamic batching in NeMo RL. Note: https://docs.nvidia.com/nemo/rl/latest/design-docs/sequence-packing-and-dynamic-batching.html Cited by: §1, §2.1, §2.4.
OpenRLHF Team OpenRLHF: sample packing and dynamic batching. Note: https://github.com/OpenRLHF/OpenRLHF Cited by: §1, §2.1, §2.4.
L. Perron and V. Furnon OR-Tools. Note: Software, version 9.15 External Links: Link Cited by: §4.3.
Qwen Team Qwen3-Next: towards ultimate training and inference efficiency. Note: Qwen Blog External Links: Link Cited by: §2.2, §6.4.
J. Rabin, G. Peyré, J. Delon, and M. Bernot Wasserstein barycenter and its application to texture mixing. In Scale Space and Variational Methods in Computer Vision, Berlin, Heidelberg, pp. 435–446. External Links: Document Cited by: §E.1.
J. Shah, G. Bikshandi, Y. Zhang, V. Thakkar, P. Ramani, and T. Dao FlashAttention-3: fast and accurate attention with asynchrony and low-precision. In Advances in Neural Information Processing Systems, Cited by: Table 8.
Z. Shao, P. Wang, Q. Zhu, R. Xu, J. Song, X. Bi, H. Zhang, M. Zhang, Y. K. Li, Y. Wu, and D. Guo DeepSeekMath: pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300. Cited by: §2.3.2.
Y. Sun, Z. Zhang, J. Jiang, G. Haffari, M. Xu, F. Liu, R. Buyya, and A. N. Toosi Coordinated scheduling for MoE LLM serving. arXiv preprint arXiv:2606.15177. Cited by: §2.4, Table 4.
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin Attention is all you need. In Advances in Neural Information Processing Systems, Cited by: §2.2.
verl Team Sequence-length balancing in verl. Note: https://verl.readthedocs.io/en/latest/_modules/verl/utils/seqlen_balancing.html Cited by: §1, §2.1, §2.4, Table 4.
W. Wang, Z. Lai, S. Li, W. Liu, K. Ge, A. Shen, H. Su, and D. Li Pro-Prophet: a systematic load balancing method for efficient parallel training of large-scale MoE models. arXiv preprint arXiv:2411.10003. External Links: Link Cited by: §2.4.
Y. Wang, X. Yuan, K. Yang, J. Peng, P. Lu, M. Li, Z. Zhang, C. Si, Z. Ruan, et al. Libra: taming attention workload skew in long-context LLM training with bounded sequence pool. arXiv preprint arXiv:2607.23250. Cited by: §1, §2.4, Table 4.
C. Wei and A. Bhatele Skew-aware adaptive all-to-allv algorithms for dynamic deep learning workloads. In Proceedings of the 40th ACM International Conference on Supercomputing, ICS ’26, pp. 450–462. External Links: Document Cited by: Appendix B, §6.1.
X. Wei, C. Jin, T. Dai, Y. Zhong, S. Yu, C. Yang, B. Wu, Z. Zhang, J. Mai, Q. Zhu, Z. Li, Y. Liu, and G. Luo UltraEP: unleash MoE training and inference on rack-scale nodes with near-optimal load balancing. arXiv preprint arXiv:2606.04101. Cited by: §1, §2.2, §2.4, Table 4.
M. Zhai, J. He, Z. Ma, Z. Zong, R. Zhang, and J. Zhai SmartMoE: efficiently training sparsely-activated models through combining offline and online parallelization. In 2023 USENIX Annual Technical Conference (USENIX ATC 23), pp. 961–975. Cited by: §2.4.
Z. Zhang and C. Wu Dynamic expert migration for expedited mixture-of-experts training. In Proceedings of the IEEE/ACM International Symposium on Quality of Service (IWQoS), External Links: Link Cited by: §3.3.
C. Zhao, S. Zhou, L. Zhang, C. Deng, Z. Xu, Y. Liu, K. Yu, J. Li, and L. Zhao DeepEP: an efficient expert-parallel communication library. GitHub. Note: https://github.com/deepseek-ai/DeepEP Cited by: Appendix D, §1, §2.4, Table 4.
C. Zhao, W. Wu, L. Song, Y. Xu, and Y. Yuan FineMoE: fine-grained load balancing for mixture-of-experts with token scheduling. arXiv preprint arXiv:2511.16947. Cited by: §1, §2.4, Table 4.
Y. Zhou, H. Li, S. Lin, Y. Zhao, T. Zhao, X. Miao, J. Jiang, F. Fu, and B. Cui Harnessing routing foresight for micro-step-level MoE load balancing in RL post-training. arXiv preprint arXiv:2606.11867. Cited by: Appendix G, §1, §1, §2.4, Table 4, footnote 1.
Z. Zhu, C. Xie, X. Lv, and slime Contributors slime: data packing and dynamic batching. Note: https://github.com/THUDM/slime Cited by: §2.4, Table 4, §6.4.