Manuscript Offprint
arXiv:2611.09207RPEG: Training Reasoning Language Models Scalably and Cost-Effectively
Maciej Besta*†, Leonard Schmidt†, Pierre Pang†, Patrik Okanovic, Robert Gerstenberger, Torsten Hoefler
Department of Computer Science, ETH Zurich
Abstract—Reinforcement learning (RL) is now central to training Reasoning Language Models (RLMs), but RLM pipelines are difficult to scale and costly to run because each RL step couples multiple large models, heterogeneous stages, cross-step state, and complex asynchronous dependencies. Existing systems typically optimize only parts of this design space. We address this complexity by jointly optimizing the pipeline structure as well as its execution using a novel data-centric graph intermediate representation called RLM Pipeline Execution Graph (RPEG). RPEG exposes structural choices such as bounded asynchrony and actor-critic sharing together with execution optimizations such as stage fusion, fine-grained scheduling, and multi-dimensional model parallelism. It is coupled with a comprehensive analytical performance model for RLM training, jointly capturing compute, communication, memory, and hierarchical rack-, node-, and GPU-level effects. Across systems with up to 256 GH200 GPUs, our distributed runtime engine implementing RPEG improves performance by up to 2× over ReaL and reduces step latency by up to 2.48× over verl, while increasing hardware utilization by up to 30%. Overall, RPEG provides a graph-driven foundation for next-generation training pipelines for frontier reasoning LLMs.
Code: https://github.com/spcl/RPEG
I. INTRODUCTION
ReINFORCEMENT learning (RL) has become central to post-training large language models (LLMs) for human preferences, safety constraints, and task-specific objectives [4, 38, 48]. More recently, RL-based post-training has become the foundation of reasoning language models (RLMs, also called reasoning models): models that perform extended reasoning, produce chain-of-thought (CoT) trajectories [52], exploit richer structures [6, 7, 14, 58, 60], self-correct [15], and allocate more computation to harder problems [21, 23, 36]. Examples include DeepSeek-R1 [23], GPT-5 Thinking [47], Kimi K2.5 Thinking [3], and Grok 4.7 [56]. Here, RL becomes a mechanism by which models learn to reason. The computational footprint is enormous and continues to grow: frontier-scale models consume millions of GPU-hours, while scaling both train-time RL and inference-time reasoning continues to improve model capabilities [20, 30, 35]. These costs grow further in agentic systems [8, 12, 13, 16, 28, 32, 51, 55, 57, 59]: long-horizon tool use and multi-agent execution increase system overhead [26], with reported token usage reaching 4×–15× that of ordinary chat [1] and roughly three orders of magnitude higher for agentic coding workloads [2].
Yet, RLM post-training is substantially more complex than a single-model workload. In the canonical Proximal Policy
Optimization (PPO) pipeline, each step comprises a generation stage that samples responses with a trainable actor (also called policy), an assessment stage that evaluates them using a reward model, critic, and frozen reference model, and a training stage that updates the trainable components [31, 62]. Other widely used online RLM-training paradigms, such as Group Relative Policy Optimization (GRPO) [43], simplify parts of this pipeline (for example by removing the critic) but retain essentially the same generation–assessment–training template and its heterogeneous execution characteristics. In PPO, generation is autoregressive and latency-sensitive, assessment is largely teacher-forced and throughput-oriented, while training adds backward passes, optimizer state, and parameter updates. RLM training is therefore simultaneously multi-model, multi-stage, heterogeneous, and iterative – and fundamentally a parallel and distributed computing problem [53].
Scaling individual models does not by itself optimize an RLM training pipeline. Data (DP), tensor (TP), pipeline (PP), context (CP), sequence (SP), and expert parallelism (EP) must be coordinated with cross-stage placement, state exchange, and execution order [5, 17]. Existing systems pursue three roughly complementary directions: (1) effective execution planning, including placement and parallel-strategy selection in ReaL [31] and HybridFlow/VERL [45], and workflow compilation in RLinf [61]; (2) fine-grained and asynchronous execution, including sample- and microbatch-level fusion in RLHFuse [63] and decoupled rollout–training pipelines in AReaL [22], Laminar [44], and StaleFlow [29]; and (3) adaptive resource orchestration, which adjusts parallelism or reallocates resources as workloads evolve [18, 49, 50]. These mechanisms increasingly coexist within the same system.
The key design question is therefore how broadly these decisions can be optimized together. Aspects such as overlap, placement, parameter freshness, model sharing, parallelism, sharding vs. replication, and memory cannot be optimized independently: improving one may increase communication, resharding, or memory pressure elsewhere. This interaction becomes even more important on hierarchical supercomputers, where communication costs differ substantially within a node, across nodes, and across racks. Finally, maximizing throughput alone may still leave expensive hardware poorly utilized. Taken together, these couplings make it difficult to achieve both high performance and high hardware utilization while respecting communication and memory constraints.
We address this challenge by optimizing not only how an RLM pipeline executes, but also selected aspects of the pipeline structure itself (contribution 1). We represent both
*Corresponding author †Core contributions
Simple Established Baselines

RPEG
Fig. 1: Representative PPO schedules selected by different planners. RPEG exposes stage-level and fine-grained overlap, enabling disaggregated placements and bounded-asynchrony that are not available under fully colocated or coarse-stage baselines. No AI was used to conceive or draw the picture.
jointly as a single optimization object , exposing structural and execution decisions within one searchable configuration space. Specifically, the compact steady-state graph captures the recurring pipeline structure and cross-step state semantics, including structural variants such as bounded asynchrony and actor-critic (AC) sharing [17]; the execution plan P specifies per-invocation hardware mapping, multi-dimensional model parallelism, and microbatching. Thus, the pipeline itself becomes an optimization variable rather than merely a fixed graph to be mapped onto hardware.
We realize this abstraction in the RLM Pipeline Execution Graph (RPEG), a data-centric graph intermediate representation and optimization framework (contribution 2). Inspired by property graphs from the graph database domain [9–11], RPEG is property-rich rather than a bare dependency graph, compactly attaching rich data (e.g., the model, role, staleness, execution semantics) needed for subsequent optimization. A staged graph-transformation pipeline materializes execution refinements such as stage fusion and fine-grained sub-invocation execution, and converts each candidate configuration C into a schedulable hardware-aware graph. This allows the optimizer to evaluate structural and execution choices jointly without directly searching a fully materialized multi-step graph. We showcase RPEG execution plans in Figure 1.
We further develop a distributed-memory runtime (contribution 3) that executes the selected RPEG plans faithfully on supercomputers, connecting the graph-level optimization decisions to their physical execution.
RPEG is coupled with a calibrated comprehensive analytical performance model for end-to-end RLM training (contribution 4). The model jointly captures compute, communication, and memory costs of heterogeneous RLM operators, including resharding, pipeline bubbles, optimizer traffic, co-resident model state, and hierarchical GPU-, node-, rack-, and inter-rack communication. Automated hardware calibration replaces reliance on nominal vendor peaks, enabling rapid evaluation of large numbers of candidate plans.
Finally, we comprehensively evaluate RPEG from analytical modeling to large-scale distributed execution (contribution 5). We validate the performance and memory models, study optimizer stability and ablations, and execute RPEG plans on up to 256 GH200 GPUs. Optimized synchronous plans are faster than their executable fully colocated inputs; against RealL, RPEG improves end-to-end performance by up to ; and in the controlled synchronous comparison with separate actor and critic models, RPEG achieves up to lower time per step than VERL (median ). RPEG also improves hardware utilization by up to 30%, while experiments with AC sharing, stage fusion, and bounded asynchrony expose further performance gains and tradeoffs enabled by the representation, all while preserving training semantics and accuracy (within 0.47% of the VERL baseline), and with negligible optimizer overheads even at 2k GPUs.
In PPO-style RLHF, the trainable actor generates responses; the frozen reward model scores them; the trainable critic estimates token-level future returns; and the frozen reference model supplies log-probabilities for policy regularization. One RL step therefore contains six invocations: actor generation, reward/reference/critic inference, and actor/critic training [31, 62]. PPO compares current-policy probabilities with those of the policy that generated the responses and uses reward/value estimates to construct advantages, which guide the update [38, 42]. GRPO removes the critic and estimates advantages from rewards within groups of responses, but retains the generation-assessment-training template [43].
These invocations have different computational profiles. Generation first processes the prompt (prefill) and then decodes tokens sequentially, making it latency-sensitive and increasingly memory-bound as the KV cache grows. Assessment instead processes complete sequences with highly parallel forward passes and is typically throughput-oriented. Training adds backpropagation, optimizer state, and parameter updates, substantially increasing both computation and memory requirements. Intra-model parallelism distributes one invocation using standard techniques such as data (DP), tensor (TP), pipeline (PP), sequence (SP), context (CP), and expert parallelism (EP) [5]. A microbatch is a smaller batch partition processed within an invocation. A microtask, such as one pipeline stage's forward or backward computation for one microbatch, is a finer execution unit. Sub-invocation execution exposes units smaller than a whole model invocation, such as microbatches, pipeline microtasks, or groups of responses that finish at similar lengths, to the scheduler.
Inter-model strategies organize different model invocations [17]. Co-location places them on overlapping GPU sets; disaggregation uses disjoint sets. Different invocations of one model may use different parallel layouts, requiring resharding, i.e., redistribution of parameter tensors. Stage fusion overlaps work within an RL step: assessment of completed responses can overlap continuing generation, or actor/critic training microtasks can interleave while retaining separate parameters. Bounded asynchrony instead overlaps different RL steps by allowing serving invocations (generation or assessment) to use parameter versions delayed by at most a configured number of RL steps. Actor-critic (AC) sharing uses one backbone with policy & value heads instead of two separate models. Unlike fusion, AC sharing changes the trainable model; asynchrony changes parameter freshness. Both are thus explicit configuration choices rather than universally interchangeable implementations of synchronous, separate-model PPO.
III. OVERVIEW OF RPEG
RPEG's key idea is to optimize not only how an RLM training pipeline executes, but also selected aspects of the pipeline structure itself. We represent the complete optimization object as an RPEG configuration ; captures the pipeline structure while P specifies its execution plan. Symbols used in the paper are listed in Table I.
The graph captures the steady-state algorithmic structure of one RL step and cross-step semantics. Its vertices are operators, i.e., individual model invocations in specific roles such as generation, inference, or training. Its edges encode how data and updated model state flow between them within and across steps. The representation is richer than a bare dependency graph. Operators carry their role, associated model, and declared input/output sets used for consistency checks, while edges distinguish within-step dataflow from cross-step model-state publication and carry typed data containers.
The execution plan P specifies how each operator is mapped to hardware through device allocation, multi-dimensional model parallelism, and microbatching.
During staged graph transformation, C is progressively refined. For example, a model invocation may be decomposed into finer-grained executable phases, while communication and redistribution implied by the selected hardware mapping become explicit graph nodes. Thus, the same graph-centric abstraction evolves from a compact logical description into a detailed executable representation that specifies the operations, data movement, and resource requirements on a given cluster (Figure 2). This transformation consists of the following steps:
Unrolling ① expands the cyclic steady-state graph IR over a finite horizon , yielding an acyclic graph in which cross-step publication dependencies become explicit. By representing bounded-staleness publication already at the compact IR level, this stage exposes asynchronous inter-step overlap while keeping the search space compact. Lowering ② then combines with the execution plan P and produces a hardware-aware executable DAG , inserting explicit COMM and RESHARD nodes whenever the selected mapping requires communication or redistribution. Lowering also materializes finer-grained executable units, such as response-length phases, when they enable scheduling below a whole model invocation.
Local evaluation assigns analytical cost semantics to : it produces a node-level time map and estimates memory requirements under the selected hardware mapping, without yet resolving global resource contention. We denote the resulting graph, annotated with time/memory estimates, by . Scheduling then constructs a resource-aware execution order under precedence and device-reservation constraints, yielding the predicted makespan and scheduled resource usage. Finally, the optimizer scores the configuration using steady-state throughput or, optionally, a throughput-utilization objective, together with a soft penalty for memory-infeasible candidates. The optimizer treats this score as a search signal and iteratively updates both and . In this way, the framework jointly optimizes pipeline structure and execution mapping rather than treating the RLHF graph as fixed.
After optimization, the runtime reconstructs the selected configuration and its physical mapping and executes it on persistent distributed workers. Operations start only when their actual predecessors have completed, the required model versions are available, and the necessary resources are free. Runtime traces verify the executed dependencies, model versions, transfers, and resource ownership.
IV. RPEG TRANSFORMATION PIPELINE
We now detail the RPEG transformation pipeline that transforms a compact high-level graph-driven algorithmic description of the RL post-training into a low-level representation schedulable on a give cluster; see also Figure 2. Extensive mathematical details of all the subsections are in Appendix A.
A. Graph-Centric RLM Training Representation
defines the algorithmic structure of RLM training:
Here, is the finite set of logical operators in one steady-state training step; is the set of within-step data

Fig. 2: Overview of the RPEG. A steady-state graph template and execution plan are unrolled, lowered to an executable DAG with explicit communication and resharding, evaluated with local analytical costs, and scheduled to obtain a steady-state score. No AI was used to conceive or draw the picture.
dependencies; is the set of cross-step model-state publication dependencies, which determine how updated model parameters become available to later consumers; is the set of typed dataflow containers, such as completions, rewards, log-probabilities, or model weights; is a set of all the used models (here, is the set of trainable models); and is a per-trainable-model staleness budget. Intuitively, specifies what recurring RLM computation is performed and which cross-step state dependencies are semantically admissible, while deliberately leaving how it is mapped to hardware to the execution plan.
Each vertex denotes one model invocation. It carries a role , its associated model , and declared input/output sets specifying which typed containers the operator may consume and produce. For instance, a generation vertex consumes prompts and actor weights and produces completions, while a reward-inference vertex consumes prompt-completion pairs and produces rewards.
Every edge refers to one typed container , whose size metadata specifies its element count and bytes per element. Its byte volume is . Containers represent both transient products such as completions, log-probabilities, rewards, and values, and persistent state such as model weights. Data edges encode within-step dependencies, whereas model-state publication edges encode cross-step state
flow from training to future-step consumers. This distinction makes the cross-step reuse of updated model state explicit and exposes bounded asynchrony through the staleness map .
The graph must satisfy four well-formedness conditions. First, input/output consistency requires every container carried by an edge to belong to the source output set and the destination input set. Second, model-state publication edges must originate at training vertices and carry model parameters. Third, boundary consistency requires every container without a producer or consumer to be represented as an explicit graph input or output. Fourth, the within-step graph must be acyclic; cycles may arise only through publication edges representing cross-step model updates. These conditions ensure acyclicity after valid unrolling; physical feasibility additionally depends on the execution plan, model versions, memory, and resource constraints.
We use a cyclic representation instead of searching directly on a flat multi-step DAG. First, it keeps the search space compact. Suppose invocation has possible execution-plan assignments. In the compact RPEG, this choice is made once for and reused by all of its copies after unrolling, giving combinations. If instead each of the unrolled copies could choose its plan independently, invocation alone would have combinations, and the full plan space would grow to . Second, staleness becomes a first-class structural variable: synchronous and bounded-asynchronous
TABLE I: Main notation used throughout the paper.
| Models & their architecture and workload | |
|---|---|
| Set of all models; a trainable subset of models (). | |
| Batch size (input prompts per step); generated rollouts per prompt. | |
| Average prompt length; average rollout length. | |
| Number of bytes per scalar in working precision ( for BF16). | |
| Hardware & its architecture | |
| Device space; . | |
| Number of racks; nodes/rack; GPUs/node. | |
| Latency; inverse bandwidth ( model). | |
| Workload-effective GPU throughput (FLOP/s per GPU). | |
| HBM bandwidth (bytes/s per GPU). | |
| GEMM SM-utilization constants (batch dim.; hidden dim.). | |
| Per-GPU HBM capacity, effective capacity after runtime overhead. | |
| RPEG | |
| An RPEG configuration: . | |
| An RPEG: . | |
| : RPEG vertices, : data edges, : publication edges. | |
| A set of containers and a single container . | |
| The unrolling of : . | |
| The lowering of : . | |
| Evaluation of (estimating runtimes of all vertices). | |
| Unrolling horizon (#steps considered when unrolling into ). | |
| Staleness budget per trainable model; . | |
| RPEG's Execution Plan | |
| RPEG's execution plan: . | |
| Device allocation of operator (the set of GPUs reserved by ). | |
| The number of GPUs in this allocation. | |
| Data/pipeline/tensor parallelism ; microbatch count. | |
| Evaluation Pipeline | |
| Node-level time map (runtime estimations for operators), . | |
| Per-GPU parameter count (weight shard) for operator . | |
| Per-device peak memory (persistent + worst-case transient). | |
| Throughput estimate for configuration . | |
| Achieved per-GPU GEMM throughput of operator . | |
| Arithmetic intensity and calibrated GEMM utilization of operator . | |
variants are obtained by modifying and re-unrolling rather than by manually rewiring a materialized multi-step graph. Third, the cyclic form expresses steady-state semantics directly, independently of the finite horizon used for evaluation.
The execution plan assigns hardware-dependent attributes to each RPEG vertex. Here, is a device allocation, is a multi-dimensional model-parallel configuration, and is the number of microbatches. In the evaluated implementation, instantiated nested data, pipeline, and tensor parallelism. We model the cluster as a hierarchical device space , comprising racks, nodes per rack, and GPUs per node. Placement therefore determines not only co-residency and disaggregation but also whether communication remains intra-node, crosses nodes within a rack, or crosses racks.
B. Joint Structural and Execution Configuration
Crucially, is itself part of the optimization space rather than a fixed workload graph. The current optimizer explicitly searches structural variants defined by AC sharing and the per-
model staleness map . AC sharing changes the model structure and associated dependencies, while changing changes the cross-step state dependencies and hence the admissible degree of asynchronous overlap. For every such structural candidate , the optimizer searches its execution plan variants . and are thus evaluated jointly rather than optimizing only a hardware mapping for one fixed pipeline.
Additional execution refinements are materialized during lowering. Stage fusion can realize multiple operations through a composite fine-grained execution structure, while response-length-aware splitting replaces generation and downstream inference invocations by matching executable phases when their selected placements permit overlap. These transformations enlarge the executable design space without treating arbitrary graph topology as an outer-loop search variable.
C. Unrolling: Making Asynchrony Explicit
The cyclic RPEG cannot be scheduled directly because model-state publication edges connect training in one step to consumers in later steps. Unrolling expands over a finite horizon into an acyclic graph , where each vertex is replicated once for every step index . Each within-step edge is copied inside the same replicated step, whereas each publication edge is instantiated across steps according to the staleness budget. Version zero is the initial checkpoint; training at step produces version , and successive updates of the same optimizer state remain ordered. A serving consumer (generation or inference) at step requires version : training step supplies it when , and otherwise the initial checkpoint supplies it. The synchronous case consumes the immediately preceding update for , and initialization for .
This construction makes bounded asynchrony explicit in the graph. If , no publication edge is created and the corresponding early steps consume the initial parameter version; because they have no training predecessor, their serving operations may overlap subject to all remaining constraints (e.g., resource or update order). Generally, publication edges always point from smaller to larger step indices, while within-step edges preserve the step index. Hence, if the within-step dependency graph is acyclic, the unrolled graph is also acyclic. Unrolling thus exposes inter-step overlap without sacrificing the compact steady-state search space at the RPEG level.
D. Lowering: Delivering Executable Representation
Unrolling makes semantic dependencies explicit, but not the physical consequences of the selected execution plan. Lowering combines with the candidate execution plan and produces an executable DAG with three kinds of vertices: Op nodes for unrolled operators, Comm nodes for explicit data transfers, and Reshard nodes for parameter redistribution between incompatible layouts. Every Op node carries its placement, model-parallel configuration, and microbatch count; every Comm or Reshard node carries an explicit byte payload and the source and destination GPU allocations.
The component specifies the set of GPUs assigned to invocation , with ; its unrolled Op nodes inherit this allocation. For analytical scheduling, denotes the GPUs reserved by an executable node : the assigned GPUs for Op nodes and the destination (and optionally source) GPUs for Comm/Reshard nodes.
Lowering also realizes the principal mechanisms behind fine-grained overlap and asynchrony. First, when generation and downstream inference are placed on disjoint devices, generation can be split into quantile-based sub-nodes and inference into matching sub-nodes using a profiled response-length distribution. Inference for early-finishing responses can then overlap with later generation phases. Second, lowering detects shadow pairs: if a trainable model is consumed asynchronously ( ) and its producer and consumer use disjoint allocations, the two sides retain distinct parameter copies and intra-step resharding can be avoided, enabling cross-step overlap. For non-shadow pairs, lowering inserts Reshard nodes when layouts differ on the same devices, or precedence edges and explicit model-state transfers when
mappings use different device sets. Transfers also account for partially overlapping source and destination allocations.
E. Scoring and Scheduling
A schedule assigns a start time to every node of the executable DAG. Formally, it is a function ; the finish-time function is , where the analytical model of Section V supplies . Precedence requires for every . Resource exclusivity requires that nodes with overlapping reserved GPU sets, , do not execute concurrently. The predicted makespan is
We construct this schedule with a greedy scheduler, whose input is the DAG, a map , and GPU reservations defined during lowering, and whose output is the start/finish times of each node. At each step, it considers nodes whose predecessors have already been assigned finish times, computes their earliest possible start times subject to precedence and GPU availability, and schedules the node that can start earliest.
Ties first favor Comm/Reshard nodes, reducing unnecessary delays in transfers needed by downstream computation. Remaining ties favor nodes with the longest remaining dependency path, measured by the sum of predicted execution times along a path to a terminal node (one without successors), since delaying such work is more likely to increase the makespan. Generation phases inherit the priority of their first phase, discouraging unrelated work from interrupting consecutive phases that reuse the same KV cache.
We score a configuration by
where is the number of prompts per RL step, is the number of rollouts per prompt, and are the average prompt and rollout lengths. The numerator counts logical prompt-response tokens, not repeated processing by every model role. The score amortizes execution over the unrolled horizon.
Memory infeasibility is handled by a soft penalty,
Here controls the penalty strength and reserves part of physical HBM for runtime overhead and fragmentation ( in the analytical baseline). A candidate slightly above this usable capacity may be explored, but the returned configuration must satisfy for every GPU. “Nearly feasible” candidates are not accepted as executable plans.
For a fixed GPU budget, throughput is the default objective. The optional efficiency objective also uses
where is the time GPU d is occupied by scheduled nodes. For a user-specified throughput tolerance , it is
where is the highest raw throughput found so far and strongly penalizes plans below the throughput floor. The same memory penalty is then applied to . Thus, the floor is a search preference, whereas the final memory bound is mandatory. GPU-hours are reported separately as reserved GPUs multiplied by elapsed hours.
V. ANALYTICAL PERFORMANCE MODEL FOR RLMs
We now describe the performance model for RLM training. Given the executable DAG produced by unrolling and lowering, we assign each node an analytical execution-time estimate and check whether the resulting configuration is memory-feasible. The performance model therefore consists of (1) a node-level time map , and (2) a memory-feasibility predicate MemFeasible(C) with being a given configuration. Together, these model the runtime consequences of different placement strategies, multi-dimensional parallelism, microbatching, communication effects such as resharding, bounded asynchrony, and co-residency on a hierarchical supercomputing machine.
Due to space constraints, we focus on key aspects specific to RL post-training; detailed derivations appear in Appendix D, while calibration, modeling assumptions, and implementation details appear in Appendix C.
A. Model Configuration
We first discuss several setup aspects of the used model.
- Modeling Communication: Communication arises both between executable DAG nodes, through explicit COMM and RESHARD nodes, and within operator OP nodes (through multi-dimensional parallelism). We use a standard model [25] , for a message of M bytes. The appropriate pair is selected from the tier spanned by the communicating allocations: intra-node, inter-node within a rack, or inter-rack. If an operation spans multiple tiers, we conservatively use the slowest one.
For collectives, we use ring-based reduction/gather estimates and a pairwise-exchange estimate for all-to-all, summarized in Table II. The message-size convention depends on the primitive: M is the buffer size for AllReduce/ReduceScatter, the final gathered buffer size for AllGather, and the aggregate exchanged bytes per GPU for AlltoAll. P2P uses the transferred bytes. Collective costs are zero for p = 1.
- Model Input: The model is parameterized by three input groups. The workload specifies batch size , rollouts per prompt , average prompt length , and average rollout length . Then, for each model , the model architecture specification provides layer count, hidden dimension, feed-forward dimension, vocabulary size, head dimension, and working precision (i.e., the number of bytes per scalar in the runtime tensor format, e.g., for BF16). The hardware description consists of a hierarchical device space , with racks, nodes per rack, and GPUs per node, plus calibrated performance parameters.
TABLE II: Communication estimates for participating GPUs; is the message size; are calibrated for the primitive and communication tier.
| Primitive | Time | Application |
|---|---|---|
| AllReduce | TP partial-result aggregation | |
| AllGather | ZeRO-2 weight gather | |
| ReduceScatter | ZeRO-2 gradient reduce | |
| AlltoAll | RESHARD nodes | |
| P2P | PP send/recv, COMM nodes |
- Hardware Calibration: Rather than relying on vendor peak numbers, we calibrate effective hardware parameters on the target system. These include workload-effective compute throughput , HBM bandwidth , separate parameters for collective and point-to-point communication at all three tiers, GEMM efficiency constants , and GPU memory capacity . This distinction is important because both compute and communication are strongly topology-dependent on modern hierarchical systems, and because NCCL collectives and P2P transfers can differ substantially in achieved bandwidth.
B. Intra-Model Runtime
For each operator node , we model runtime under the evaluated 3D (DP/PP/TP) strategy and microbatch count by the decomposition
where the five terms capture GEMM execution, pipeline bubbles, intra-operator communication, non-GEMM overheads, and optimizer traffic. The dominant GEMM compute term is obtained from the operator work , i.e., the total FLOP count induced by the operator role and model type. For an operator with execution strategy , we define as the number of GPUs allocated to that operator. Assuming balanced sharding across this 3D mesh, the GEMM work is divided across these devices, giving
The denominator states that the devices allocated to v execute its data, pipeline, and tensor shards concurrently (other operators may use disjoint allocations at the same time if the schedule permits). is the achieved per-GPU GEMM throughput for v after accounting for arithmetic intensity and calibrated GEMM shape efficiency. Thus, specifies how much computation the operator performs, while specifies how fast that computation can be sustained in practice.
We model with a roofline-style throughput corrected for both bandwidth limits and calibrated GEMM shape under-utilization. This captures inefficient GEMM execution at small local batch sizes or narrow tensor-parallel dimensions. The separate terms and account for layer operations whose latency does not decrease proportionally with tensor parallelism (e.g., normalization, residual additions, positional embeddings, attention softmax, activation functions) and memory-bandwidth-bound optimizer traffic. Concretely, ; is the operator's arithmetic intensity and is a calibrated GEMM shape efficiency factor. In our implementation, decreases for small local batch/sequence dimensions and for narrow tensor-parallel hidden dimensions, parameterized by and .
The work term is itself role- and model-specific: generation, inference, and training have different FLOP counts, and actor/reference, critic/value, and reward operators differ further through their output heads and whether backward and recomputation phases are present; optimizer traffic is accounted for separately. Finally, generation receives an additional RLM-specific refinement by splitting its work into a compute-oriented prefill phase and a memory-bandwidth-bound decode phase sensitive to weight and KV-cache traffic, which is essential to capture long-response reasoning workloads. We use work terms for different RLM model roles as presented in a recent extensive work–depth analysis [17].
C. Inter-Model Communication and Resharding
Explicit communication and redistribution nodes are computed separately from operator nodes. If a COMM node transfers container between operators and , its runtime is ; is the device allocation of operator , is its size in #GPUs (for , the tier-specific point-to-point values are used). The division by the smaller allocation reflects the limiting side in concurrent send/recv. If a RESHARD node transforms weights between two incompatible layouts on the same device set, we model it as an all-to-all over that allocation , where is the full parameter size of a given model in bytes and is the collective all-to-all cost for per-GPU message size across GPUs. Together with the operator-node formulas from Section V-B, these define the complete time map over .
D. Memory Model
Many configurations that look attractive under the time model are infeasible in practice as they exceed HBM capacity. We thus use an analytical memory model both to exclude clearly infeasible candidates during search and to softly penalize memory-violating candidates instead of discovering OOMs only at runtime. We assume mixed-precision training [33] with BF16 parameters and FP32 Adam [27] optimizer state, and activation checkpointing [19]. Optimizer state and gradients are sharded across data-parallel ranks via ZeRO-2 [39].
We target high-throughput RLM training on GPU-rich HPC systems, where 3D parallelism and ZeRO-2 sharding enable GPU-resident execution [34, 39]. CPU offloading primarily addresses insufficient GPU memory [40, 41], but introduces host-device transfers and potentially CPU-side optimizer work that can reduce throughput and disrupt the pipeline overlap targeted by RPEG [46].
- Parameter and Persistent-State Accounting: We use the dominant parameter counts derived in a recent work [17] and retain the placement-specific byte accounting required here. Let denote the maximum per-GPU parameter shard size of invocation v, accounting for its pipeline and tensor partitioning and any replicated embeddings or heads. For device-level accounting, denotes the corresponding parameter shard of model m on GPU d under the relevant execution layout.
The persistent footprint depends on how each GPU uses the model. A training GPU retains FP32 master weights and two Adam moment arrays, sharded across data-parallel ranks under ZeRO-2 (12 bytes per parameter before sharding). Its BF16 weights are instead materialized on demand. A GPU serving a trainable model with on an allocation disjoint from training retains a persistent BF16 shadow copy; frozen models such as reference and reward likewise retain BF16 weights. If training and serving allocations overlap, no additional shadow copy is needed. Synchronous serving-only allocations retain no persistent weights between invocations.
Thus, the per-model persistent footprint is
Here, is the training layout's data-parallel degree, and is the BF16 scalar size in bytes.
-
Transient-State Accounting: In addition to persistent state, each invocation v requires a peak transient allocation , including activations, generation KV cache, BF16 weights materialized on demand, training gradients, and local working buffers. Under ZeRO-2, the sharded BF16 gradient term is . State already included in is excluded from to avoid double counting. Since invocations sharing a GPU cannot execute simultaneously, only the largest transient allocation on that device needs to be considered.
-
Co-Residency-Aware Device Peaks: The key inter-model issue is that RL pipelines place multiple models on the same physical devices. A GPU may participate, for example, in actor generation, reference inference, and actor training within one overlapping steady-state schedule. Thus, memory cannot be evaluated operator by operator in isolation.
We thus define device-level peak memory as persistent co-resident state plus the largest transient term among operators mapped to that device:
To account for runtime memory not explicitly captured by the analytical model (e.g., allocator reservations, communication workspaces, fragmentation) we reserve a calibrated safety fraction of GPU memory. The effective capacity is . Finally, a given configuration is memory-feasible iff every device respects the effective capacity bound:
Figure 3 illustrates this persistent/transient classification for five representative two-GPU cases: (1) synchronous disjoint execution, where inference receives weights transiently via communication and holds no persistent copy; (2) asynchronous disjoint execution, where a shadow pair is active and both sides keep persistent weight copies; (3) partial overlap where one device is shared between training and inference while the other remains inference-only; (4) partial overlap with the complementary overlap pattern; and (5) full colocation with resharding, where the same devices execute both roles and a layout transformation bridges inference and training. These cases show how bounded asynchrony changes memory behavior: enabling a shadow pair increases static memory by keeping persistent copies on both sides, but it avoids repeated redistribution and allows cross-step overlap.

Fig. 3: Per-device memory classification for 5 allocation and staleness configurations of one trainable model (critic) on two GPUs. In Case 1 (sync, disjoint), GPU 0 receives weights transiently via a COMM node. In Case 2 (async, disjoint), both GPUs hold persistent weight copies (shadow pair). Cases 3–4 show partial device overlap. Case 5 shows full colocation where a RESHARD node transforms the weight layout between inference and training. No AI was used to conceive or draw the picture.
VI. JOINT STRUCTURAL AND EXECUTION OPTIMIZATION
The preceding sections define how to evaluate a configuration . For each such candidate, the transformation pipeline (Section IV) delivers an executable DAG . The analytical performance model (Section V) estimates node execution times and per-GPU memory demands, while scheduling (Section IV-E) determines the predicted makespan and score, including memory penalties. During optimization, this evaluation is repeated for each newly proposed configuration; the resulting scores guide the search, while the best memory-feasible configuration found is retained.
The optimization problem is defined by four fixed inputs: (1) the RL training algorithm (e.g., PPO, GRPO, or DPO), (2) workload parameters such as batch and sequence sizes, (3) model specifications, and (4) the available hardware. The RL algorithm determines the initial RPEG structure; for example, PPO contains actor, critic, reward, and reference invocations, whereas GRPO has no critic. Together, these inputs establish the initial compact RPEG and its optimization constraints.
This search has two levels. First , we enumerate a small set of pipeline-structure candidates . Second, for each such graph, we search its much larger space of execution plans . Algorithm 1 summarizes the complete procedure. In the following, we detail the key aspects of the algorithm; further details are in Appendix A-J.
A. Pipeline Structure Candidates
For a fixed RL algorithm, the explicitly searched structural choices are actor-critic sharing and bounded staleness. We represent them by , where determines whether actor and critic parameters are shared, and is the allowed staleness of each trainable model . AC sharing is considered only when both an actor and critic exist. Each is chosen from a small user-defined finite set. We denote the resulting set of legal tuples by . Each determines one RPEG .
B. Execution Plan Candidates
For every model invocation in a fixed , we enumerate its legal execution choices as , where is the GPU allocation, is the DP/PP/TP configuration, and is the microbatch count. “Legal” means that the choice can be mapped to the given workload, model, and machine: for example, pipeline stages must receive valid layer partitions, tensor parallelism is kept within a node, and the allocation must contain the GPUs required by . We enumerate aligned contiguous GPU blocks satisfying these constraints and discard obviously infeasible choices early.
An execution plan assigns one legal choice to each invocation . The search starts from an initial plan and repeatedly replaces the assignment of one or two invocations, as described next.
C. Stochastic Plan Search
For each structural candidate , we search its execution plans using simulated annealing. Starting from the current plan , one search round proposes up to nearby plans. Each proposal defines a complete configuration , which is evaluated using the pipeline from Section III. Thus, unrolling, lowering, analytical modeling, scheduling, and scoring are performed for every newly proposed configuration.
At the beginning of each search round, the optimizer chooses one of two proposal mechanisms. With probability , it uses the two-invocation mechanism described below; otherwise, with probability , it uses the single-invocation mechanism.
For a single-invocation move, the optimizer first chooses the invocation whose execution-plan assignment will be modified. With probability , is sampled from the current schedule's critical (bottleneck) path with probability proportional to its predicted execution time; with probability , it is sampled uniformly from all invocations. The optimizer then samples alternative assignments for from , producing up to neighboring plans. The subsequent evaluation determines whether any of them is better than the current plan.
For a two-invocation move, the optimizer instead changes two allocations jointly. It samples a donor invocation with probability proportional to its current GPU count , so invocations occupying more GPUs are more likely to donate resources. It then chooses a receiver invocation among invocations whose current allocations overlap with the donor's allocation. The donor is assigned a legal smaller allocation, while the receiver is resampled from so that it may use some of the released GPUs. A receiver can already be feasible and still benefit from additional GPUs: feasibility only means that its assignment is legal, whereas a larger allocation may reduce its execution time and hence the overall makespan. The coordinated move allows such a resource redistribution to be tested directly instead of first passing through a plan that leaves the donor's released GPUs unused.
D. Proposal Evaluation and Acceptance
Regardless of which proposal mechanism is used, one search round produces up to complete candidate configurations . They are evaluated independently, with uncached evaluations executed in parallel when possible. The optimizer then selects
and only this highest-scoring proposal is considered for updating the current plan.
Let and . If , is accepted. Otherwise it is accepted with probability
The temperature controls how readily the search accepts a temporarily worse configuration: larger increases exploration, whereas smaller makes the search more greedy. The normalization by makes the temperature largely independent of the absolute score scale.
A sequence of proposal-and-acceptance rounds forms a search chain. The temperature remains fixed within each chain. The first chain uses temperature . Each subsequent, warm-restarted chain uses , allowing broader exploration around a previously discovered high-scoring plan. If the selected proposal is rejected in ten consecutive rounds, the chain is considered stuck and a new one is started.
The search budget is specified either as wall-clock time or as a maximum number of full configuration evaluations. The budget is allocated equally across structural candidates: in wall-clock mode, the remaining time is divided evenly among the remaining ; in evaluation-budget mode, each candidate receives the same fixed budget of uncached configuration evaluations.
E. Caching
Evaluating a configuration is considerably more expensive than generating a new proposal, so evaluated configurations
Algorithm 1: RPEG optimization
Input: Fixed RL algorithm, workload, model, and hardware inputs; legal structural choices ; wall-clock or uncached-evaluation search budget; temperatures
Output: : highest-scoring memory-feasible configuration found within the search budget
1 Initialize cache and . Define to return (penalized score , memory feasibility, schedule) via cached unrolling/lowering (Sec. IV), performance modeling (Sec. V), and scheduling/scoring (Sec. IV-E)
2 foreach
3 Construct (Sec. VI-A); For each , enumerate/reuse by filtering combinations for legal parallelism, device packing, and HBM feasibility (Sec. VI-B, App. A-J2a)
first true
while budget remains for plan-search on
if first then Initialize P using the concurrent baseline: group independent invocations, partition GPUs, and choose to minimize estimated step time (Sec. VI-B, App. A-J2h) ; first false
else Initialize P from a cached high-scoring feasible plan with a compatible vertex set (Sec. VI-E, App. A-J2h)
end
If ok and the score improves , set rejected 0
while budget remains and rejected < 10 do
if pair kernel selected with then Sample donor u proportional to its GPU count and receiver v from overlapping allocations; for , copy , shrink using , and resample from (Sec. VI-C, App. A-J2f)
else Select v using critical-path weights from schedule Q with probability , otherwise uniformly; for , copy and sample (Sec. VI-C, App. A-J2f)
end
For each , evaluate
;
Update from all evaluated memory-feasible proposals with higher scores
if accept the best proposal with probability (Sec. VI-D, App. A-J2e) then ; ; ; ok ok'_i; rejected 0
else rejected rejected + 1
end
If ok, retain the current P as a possible restart seed
end
33 end
34 Polish by repeatedly testing every for each invocation v, replacing only , and greedily accepting feasible score improvements until none remain (Sec. VI-F, App. A-J2j)
35 return
are cached using their complete graph and execution-plan description. Repeated proposals therefore reuse their previous score. Structural candidates with the same invocation set also reuse the corresponding sets. The implementation additionally retains high-scoring feasible plans with compatible invocation sets as seeds for subsequent search chains.
F. Stopping and Final Refinement
The search stops when its wall-clock or evaluation budget is exhausted and always retains the the highest-scoring memory-feasible configuration found so far. Finally , we deterministically refine that plan. We visit every invocation in a fixed order and try its legal execution choices while keeping all other assignments unchanged; if any choice improves the score, we retain the best one. These passes repeat until an entire pass produces no improvement. Thus, the final “greedy coordinate descent” simply removes any remaining improvement that can be obtained by changing one invocation at a time.
VII. COMPLETION-DRIVEN DISTRIBUTED RUNTIME
The RPEG runtime realizes a configuration selected by the optimized on physical GPUs, preserving its execution dependencies, placement, parallelism, and model-version semantics. Crucially, while predicted execution times guide plan selection, actual node completion events govern execution, allowing the runtime to adapt to varying computation and communication durations without changing the selected plan.
Execution proceeds in three stages, see Alg. 2. First , graph realization unrolls and lowers into an executable DAG (as in Sec. IV), and assigns concrete GPU/worker bindings and resource requirements to every executable node . Then , persistent worker groups instantiate the selected DP/PP/TP configurations. Each logical RPEG invocation reuses its assigned workers across unrolled training steps, avoiding repeated model initialization and distributed-group setup. Third , completion-driven dispatch executes nodes as their predecessors finish and required physical resources become available.
The controller operates directly on the executable DAG, including OP, COMM, and RESHARD nodes. A node x becomes ready when all predecessors in have completed, and may execute when its exclusive resource set is available. These resources include assigned workers and GPUs and, for direct transfers, the participating endpoints. Among ready nodes, priority is given to earlier RL steps, then communication/resharding, and finally a fixed topological order. The graph also determines the exact parameter version consumed by each invocation and when intermediate data or obsolete parameter copies can be released, thereby preserving bounded-staleness semantics while enabling safe overlap.
Model invocations use PyTorch/Megatron with the selected DP/PP/TP groups. NCCL supports tensor-native parameter transfers and redistribution, while the principal experimental campaign uses Gloo for semantic data transfers. On Clariden, worker processes share a pooled Slurm launch with NCCL communication over OFI/libfabric/CXI. These backend choices realize the graph's operations and transfers without changing its logical dependencies.
Physical realization. Table III summarizes how RPEG's optimization decisions are translated into physical execution, connecting the selected graph and execution plan to concrete Megatron workers, communication operations, and parameter versions.
Execution verification. Since RPEG jointly optimizes graph structure, placement, parallelism, and scheduling, its
Algorithm 2: Completion-driven RPEG execution
Input: Optimized configuration , execution horizon
Output: Completed execution and runtime trace
1
2
3 remaining(x) for every
4 Busy, Launched, Done
5 while Done do
6 Ready
7 Order Ready by RL step, COMM/RESHARD before OP, then topological order
8 foreach
9 if then
10 Reserve in Busy
11 Bind inputs and required parameter versions
12 Record dispatch; submit x asynchronously to
13 Launched
end
end
Wait for newly completed nodes
foreach newly completed node x do
18 Record completion; publish outputs and model versions
19 Release from Busy
20 Done
21 foreach successor z of x do
22 remaining(z) remaining(z) - 1
23 end
24 Release artifacts and parameter copies with no remaining consumers
end
25 end
26 end
27 Stop workers; return execution trace
performance gains are meaningful only if the runtime executes the configuration actually selected by the optimizer. Otherwise, unintended changes in execution could invalidate the predicted-to-measured performance correspondence or alter training semantics. RPEG therefore identifies each optimized plan (and fused microtask schedule, if applicable) by a hash and verifies its physical GPU bindings, parallelism, dependencies, parameter versions, and execution order against the runtime trace.
VIII. EVALUATION
We show the advantages of RPEG along four complementary dimensions: accuracy of the analytical time/memory model, schedule quality, improvements over prior systems, and optimizer efficiency & stability.
Experiments use two HPC platforms: an A100 system with eight 40-GB GPUs, intra-node NVSwitch, and four 200-Gb/s InfiniBand interfaces per node; and a GH200 system with four GPUs and four Slingshot-11 interfaces per node. Due to space constraints, further setup details are in Appendix B.
A. Model Validation
We first validate both execution-time and peak-memory predictions against measurements on NVIDIA GH200 GPUs. The study covers 123 configurations spanning three LLaMA model sizes (3B, 7B, 13B), batch sizes , GPU counts from 1 to 128, and 25 distinct strategies, including DP-only, TP-only, PP-only, and 3D-hybrid configurations. We fix , , and . All runs use BF16, FlashAttention-2, activation checkpointing
| Optimized RPEG component Runtime action | |
|---|---|
| and its typed edges | Instantiate step-indexed model operations, data dependencies, and explicit transfer nodes. |
| Placement | Bind the invocation's worker ranks to its selected physical GPUs. |
| Parallelism | Form DP replica groups, PP layer stages, and TP tensor shards/collectives in Megatron. |
| Microbatch count | Split each DP replica's local batch into the selected number of microbatches and issue the corresponding model operations. |
| Publication edges and | Resolve each consumer's required parameter version and install its corresponding shards. |
| Cross-layout dependencies | Route tensor fragments between producer and consumer layouts through COMM/RESHARD operations. |
| Resource set | Reserve the GPUs and worker groups needed by x until its completion; transfers reserve their participating endpoints. |
TABLE III: Example concrete realization of RPEG components within its runtime.

Fig. 4: Predicted vs. measured operator latency. Each point is one (workload, strategy) configuration. Marker shape indicates the parallelism strategy. The solid line denotes exact agreement and the shaded band marks error. Overall MAPE is 15.5% with Spearman (n = 123), correctly ranking 95.4% of all configuration pairs.
for training, and ZeRO-2 gradient sharding for . Hardware parameters come from the automated calibration suite described in Section V-A3.
Execution Time. Figure 4 compares predicted and measured operator latency for generation, inference, and training. The model attains 15.5% mean absolute percentage error (MAPE) and Spearman rank correlation , correctly ranking 95.4% of all configuration pairs. NCCL microbenchmarks directly calibrate the communication parameters ( ); the operator measurements then test their combined effect with compute and other costs including TP AllReduce, PP point-to-point transfers, and ZeRO-2 gradient synchronization.
Peak Memory. Figure 5 compares predicted and measured per-device peak memory. The memory model achieves 15.1% MAPE with Spearman , correctly identifying which configuration uses more memory in 93.7% of pairs. The systematic underprediction for inference and generation reflects unmodeled CUDA context overhead of roughly 2–3 GB per GPU, for which the margin in reserves capacity.
B. Predicted Schedule Advantages
We also compare the execution plans selected by RPEG against heuristic baselines under the analytical model. This isolates the effect of joint optimization of placement, parallelism, overlap, and bounded asynchrony from runtime-system overheads. We compare to two baselines: the greedy baseline chooses a feasible strategy for each invocation on the full GPU set and executes invocations sequentially; the concurrent baseline assigns independent invocations disjoint allocations.
- Weak Scaling: The weak scaling results are in Figures 6 and 7; we increase actor size, critic/reward size, or both as

Fig. 5: Predicted vs. measured peak GPU memory. The model achieves 15.1% MAPE with Spearman , correctly ordering memory use for 93.7% of configuration pairs. The remaining underprediction in inference and generation reflects unmodeled CUDA context overhead ( 2–3 GB per GPU).

Fig. 6: Weak scaling: predicted throughput (tokens/s) across three scaling experiments (rows) and three workload regimes (columns). OOM marks infeasible baselines. Percentage labels indicate the optimizer's gain over the concurrent heuristic. Models: LLaMA-2.
GPU count grows from 8 to 128. The settings vary workload characteristics.
RPEG improves throughput by 5–60% over the concurrent heuristic where that baseline is feasible, and finds feasible plans in all tested cases, including those with OOM baselines. Gains are largest for long responses, which expose more generation-assessment overlap. Next, RPEG does not optimize for raw device occupancy alone. Instead, it assigns generation, assessment, and training (and their subunits) to different GPU subsets with different 3D strategies. The resulting GPU utilization-aware plans attain 78–100% scheduled

Fig. 7: Weak scaling: predicted GPU utilization for the same configurations as Figure 6. The throughput×utilization objective (red) consistently improves utilization over the throughput-only objective (green) by up to +25 pp (absolute difference between utilization percentages). Models: LLaMA-2.
GPU utilization. Relative to throughput-only optimization, they trade 1–3% throughput for up to 25 percentage points higher utilization. This is scheduled resource occupancy, not a measurement of GPU arithmetic utilization.
- Strong Scaling: In the strong-scaling regime (Figure 8) the model is fixed and GPU count increases. With 13B models, , , and , RPEG finds a feasible 8-GPU plan at 8,966 tokens/s while both baselines are OOM. From 16 to 128 GPUs, predicted throughput is 20–49% higher than the greedy baseline, reaching 104,930 tokens/s at 128 GPUs.

— Greedy heuristic — Concurrent heuristic — RPEG (throughput) — RPEG (util)
Fig. 8: Strong scaling. (a) Absolute throughput (tokens/s). At 8 GPUs, both baselines are OOM. (b) Percentage improvement over the greedy heuristic. The optimizer's advantage grows with GPU count. Model: LLaMA-2 13B.
- Ablations: Table IV varies one feature at a time (out of nine) across four scenarios: memory-constrained execution (16 GPUs, 50-GB HBM limit), a wide search space (128 GPUs), heterogeneous model sizes (34B actor and 7B critic/reward), and deep pipelines (70B critic/reward across two racks). Each setting uses five seeds, for 200 runs in total. The largest average losses in predicted performance come from disabling bounded asynchrony (A2, 16.1%), generation-inference overlap (A1, 9.2%), and microbatch tuning (A3, 4.3%). A3 fixes
mb = 1 for ; otherwise, it fixes mb = for generation/inference and mb = for training. All A1–A9 modifications are identified in the table.
TABLE IV: Ablation study. Search space features (A1–A3) dominate. The last row (A4–A8) summarises pair moves, warm restarts, critical-path vertex selection, and soft OOM penalty, which show < 1% impact across 9 configurations spanning memory-constrained and wide-search-space regimes. We describe the details of each ablation configuration in Appendix B.
| Ablation | 16 GPU, 13B (PFLOP/s) | 32 GPU, 34B (PFLOP/s) | 64 GPU, 70B (PFLOP/s) | Avg. |
|---|---|---|---|---|
| Full system (r=1) | 0.233 | 0.656 | 1.339 | - |
| A1: gen-inf overlap | 0.203 (-12.8%) | 0.569 (-13.2%) | 1.318 (-1.5%) | -9.2% |
| A2: async execution | 0.189 (-18.8%) | 0.497 (-24.3%) | 1.270 (-5.2%) | -16.1% |
| A3: mb tuning | 0.238 (+2.1%) | 0.672 (+2.4%) | 1.105 (-17.5%) | -4.3% |
| A7: polish phase | 0.233 (+0.0%) | 0.647 (-1.5%) | 1.269 (-5.2%) | -2.2% |
| A9: geometric cooling | 0.233 (+0.0%) | 0.607 (-7.5%) | 1.327 (-0.9%) | -2.8% |
| A4/A5/A6/A8 | < 1% average impact across all tested configurations < 1% | |||
The effects are workload-dependent, e.g., A3 improves performance by 2.1–2.4% in the two smaller configurations but reduces it by 17.5% in the 70B case. Search-algorithm changes have smaller average effects: disabling final polishing (A7) and using geometric cooling (A9) reduce performance by 2.2% and 2.8%, respectively, while A4/A5/A6/A8 have less than 1% average impact. Thus, most of the gain is due to the available execution choices, not to any single search heuristic.
A representative case study illustrates the trade-off between minimizing individual operator times and the overall schedule makespan (Figure 9). We quantify effective operator parallelism as , i.e., the sum of individual operator durations divided by the total schedule makespan. The greedy heuristic minimizes individual operator times under a fully collocated allocation, but executes them sequentially ( ). The concurrent heuristic overlaps operators ( ), but splitting GPUs among them increases their individual execution times, largely negating the benefit of overlap. RPEG also makes locally suboptimal choices: most operators execute more slowly than under greedy, yet their overlap ( ) reduces overall makespan by 17–22%. Notably, actor generation is an exception: RPEG accelerates it despite allocating fewer GPUs, because the larger local batch improves utilization during memory-bound decoding. Thus, minimizing individual operator times or maximizing overlap alone is insufficient; the objective must be the global schedule makespan.
C. Measured Performance Improvements
We next assess end-to-end performance.
- Comparison with Existing Systems: We first evaluate RPEG against two existing systems under synchronous PPO, without bounded asynchrony. On A100 GPUs, we compare RPEG against RealL (Figure 10), using models from 7B to 70B. RPEG is faster in 11 of the 13 jointly executable configurations and comparable in two (7B/16 GPUs and 32B/32 GPUs). Throughput improves by , with up to 30% higher effective GPU utilization. For 32B/16 GPUs, RPEG also finds and executes a memory-feasible plan where RealL finds none. On GH200 GPUs, we compare RPEG against

Fig. 9: Predicted per-operator wall-time breakdown for LLaMA-2 13B PPO on 16, 32, and 64 GPUs; , , and . The greedy heuristic (left) executes all operators sequentially. The concurrent heuristic (center) partitions GPUs but does not reduce makespan significantly. The optimizer (right) reduces makespan by 17–22% via GPU partitioning, gen-inf overlap, and asynchronous execution.

Fig. 10: RPEG versus ReaL. System: A100s.
VERL (Figure 11), using Llama 3.1 8B and Llama 3.3 70B with separate actor/critic models. RPEG achieves speedup (median ).
- Joint Pipeline-Structure and Execution Optimization: We next investigate deeper the benefits of jointly optimizing pipeline structure and execution plan .
a) Optimization Within A Fixed Training Structure: We compare feasible, fully colocated baseline configurations against RPEG-optimized configurations executed using the same runtime on GH200 GPUs, eliminating cross-framework differences. For each baseline, we preserve the AC architecture (shared or separate), synchronous execution, model size, workload, and GPU budget, while optimizing placement, DP/PP/TP parallelism, microbatching, and applicable execution refinements. Seven Llama 3.1 8B baselines yield 20 measured comparisons (Table V). All optimized configurations outperform

Fig. 11: RPEG versus VERL. System: GH200s.
their respective baselines by (mean ), reducing graph execution time by approximately 20–32%. This establishes the benefit of optimization within each structural variant, independently of switching variants.
TABLE V: Benefits of RPEG optimization within fixed actor-critic architectures. Model: Llama 3.1 8B. System: GH200s.
| Nodes | AC structure | Baseline time [seconds/step] | RPEG time [seconds/step] | Speedup |
|---|---|---|---|---|
| 2 | Shared | 11.678 | 8.026–8.158 | 1.432–1.455× |
| 4 | Shared | 14.311 | 10.726–10.960 | 1.306–1.334× |
| 4 | Separate | 16.752 | 11.392–12.436 | 1.347–1.471× |
| 8 | Shared | 12.822 | 9.129–9.167 | 1.399–1.404× |
| 8 | Separate | 16.770 | 11.837–12.780 | 1.312–1.417× |
| 16 | Shared | 13.189 | 10.479–10.552 | 1.250–1.259× |
| 16 | Separate | 16.852 | 12.244–13.031 | 1.293–1.376× |
b) Optimization Across Structural Variants: We summarize the effects of structural optimizations using Llama 3.1 8B and Llama 3.3 70B on GH200 GPUs. Bounded asynchrony () improves every available same-architecture comparison against synchronous RPEG, accelerating separate-model execution by at 8B and at 70B. AC sharing generally reduces execution time by eliminating duplicated model computation and state, by 12–34% ( speedup). Stage fusion preserves separate actor/critic parameters while interleaving their execution: a topology-matched 8B test reduces runtime by 7%, although expensive resharding can reverse the benefit.
Importantly, for a given fixed PPO configuration, RPEG preserves outcome accuracy: it optimizes the scheduling of PPO operations without changing the underlying generation, reward computation, advantage estimation, or loss functions; bounded asynchrony only changes parameter freshness. Following the evaluation methodology of AsyncFlow, we compare RPEG's asynchronous execution () against synchronous VERL in terms of mean rollout reward and response length, using comparable PPO hyperparameters (including update rate, batch size, learning rate, and maximum sequence lengths), generation settings, and old-policy log-probability computation. RPEG achieves a mean reward on the final rollout within 0.47% relative difference of the VERL baseline, providing empirical evidence of comparable training outcomes under the evaluated settings.
D. Optimizer Efficiency and Stability
A richer optimization space is only useful if it can still be searched efficiently. RPEG remains practical because candidate evaluation is analytical and heavily cached.
Search Cost. A convergence study spanning 256–2048 GPUs (Figure 12, left) shows that the optimizer reduces predicted makespan by approximately 14–19% relative to the
TABLE VI: Design dimensions of representative RLM-training systems. “☐” denotes explicit support, “☐” partial or restricted support, and “✗” no first-class support in the cited design. Brief annotations indicate the mechanism or scope of support.
| Framework | Cross-iteration asynchrony | Intra-iteration overlap | Sub-invocation execution | Execution plan search | Pipeline structure search | Performance + memory model | Plan verification | Resource-eff. objective |
|---|---|---|---|---|---|---|---|---|
| RealL [31] | ✗ | ☐ (indep. ops) | ✗ | ☐ (place+3D+mb) | ✗ | ☐ (profiled) | ✗ | ✗ |
| HybridFlow/VERL [45] | ☐ (VERL runtime) | ☐ | ✗ | ☐ (place+3D) | ✗ | ☐ (simulation) | ✗ | ✗ |
| RLHFuse [63] | ✗ | ☐ (fusion) | ☐ (sample+mb) | ☐ (fusion plans) | ☐ (fusion) | ☐ (simulation) | ✗ | ✗ |
| AReAL [22] | ☐ (rollout/train overlap) | ✗ | ☐ (samples) | ☐ (resource split) | ✗ | ✗ | ☐ (version control) | ✗ |
| AsyncFlow [24] | ☐ (streaming pipeline) | ☐ (pipeline) | ☐ | ☐ (load balance) | ✗ | ✗ | ☐ (staleness checks) | ✗ |
| Laminar [44] | ☐ | ✗ | ☐ (samples) | ☐ (repacking) | ✗ | ✗ | ✗ | ✗ |
| StaleFlow [29] | ☐ (bounded) | ☐ (disaggregation) | ☐ (samples) | ☐ (rollout coord.) | ✗ | ✗ | ☐ (staleness checks) | ✗ |
| RLInf [61] | ☐ (pipelining) | ☐ (elastic pipeline) | ☐ (microflows) | ☐ (place+pipeline) | ☐ (flow rewrite) | ☐ (profiled) | ✗ | ✗ |
| OrchestraRL [49] | ☐ (1-step overlap) | ☐ (disaggregation) | ☐ (generation) | ☐ (generation only) | ✗ | ☐ (compute+net sim.) | ✗ | ☐ (network cost) |
| Libra [18] | ☐ (rollout/train overlap) | ☐ (disaggregation) | ☐ (requests) | ☐ (stage-level) | ✗ | ☐ (analytical) | ☐ (state sync.) | ☐ (resource split) |
| RPEG [This work] | ☐ (bounded) | ☐ (fusion) | ☐ (phase+ microtask) | ☐ (place+3D+mb) | ☐ (AC+fusion+ staleness) | ☐ (calibrated, analytical) | ☐ (hash+versioning) | ☐ (throughput utilization) |
initial plan. Importantly, within just 300 seconds, even at 2048 GPUs, the best discovered plan is already within 5% of the makespan achieved after a full hour of searching. Thus, most optimization benefits are obtained within minutes. For perspective, amortizing a one-time 300-second (600-second) search over 1,000 PPO updates at our measured 70B/64-node rate of 23.7 seconds/update yields an estimated overhead of only 1.3% (2.5%) of total runtime.
Run-to-Run Stability. To quantify robustness, we evaluate 200 independent runs per configuration over scales from 64 to 1024 GPUs. Figure 12 (right) shows score gaps relative to the best result found across seeds for each configuration. The coefficient of variation ranges from 0.27% to 2.31%. All runs at 64–512 GPUs are within 6% of the best observed score; at 1024 GPUs they are within 11%.

Fig. 12: (Left: Optimizer search effectiveness study) Best discovered predicted makespan relative to the initial plan (lower is better) versus search time, across 256–2048 modeled GPUs. (Right: optimizer stability study) Cumulative distribution of gaps to the best found outcome across 200 independent seeds per configuration (600-second searches).
IX. RELATED WORK
Recent RLM-training systems can be compared along several complementary architectural features: cross-iteration asynchrony, which overlaps different RL iterations; intra-iteration overlap, which overlaps or fuses generation, assessment, and training within an iteration; sub-invocation execution, which schedules units smaller than a whole model invocation; execution plan search, which automatically selects placement, parallelism, or microbatching; pipeline structure search, which automates changing the pipeline structure or execution semantics themselves; performance and memory modeling, which predicts candidate execution costs; plan verification, which checks that the selected logical and physical plan is faithfully realized at runtime; and resource-efficiency
objectives, which explicitly consider resource use beyond raw runtime or throughput. Existing systems expose different subsets of these capabilities [18, 22, 24, 29, 31, 44, 45, 49, 61, 63].
Our work extends this landscape along three main axes. First, RPEG exposes a richer graph configuration that enables searching over AC-sharing and bounded-staleness settings together with per-invocation placement, parallelism, and microbatching, all while supporting fusion and sub-invocation response-length refinements. Second, RPEG couples this space to a comprehensive analytical model that captures heterogeneous computation, communication and resharding, hierarchical hardware, co-resident and versioned state, and explicit throughput-resource-efficiency tradeoffs. Third, RPEG provides an execution-faithful runtime: optimized graph structure, placement, model versions, transfers, and resource ownership are reconstructed and verified during distributed execution. Table VI provides a more fine-grained comparison.
X. CONCLUSION
RLM training is no longer a single-model scaling problem: it is a heterogeneous, multi-model, asynchronous pipeline optimization problem. RPEG addresses this by making pipeline structure, overlap, placement, and parallelization explicit within one graph-centric representation, and by coupling that representation to calibrated HOC-focused analytical models of time and memory. This enables the optimizer to search jointly over structural and execution decisions, yielding better schedules than prior baselines and translating those gains into measured improvements in throughput, makespan, and utilization on real hardware.
More broadly, RPEG points toward a general systems layer beyond PPO-style RLM training, jointly optimizing heterogeneous operators, bounded asynchrony, communication hierarchy, and cost. Such a layer could support multi-agent and tool-augmented LLM systems, training with richer verification or search, and inference-time reasoning. Thus, RPEG is not merely a training optimizer, but a step toward graph-native orchestration of future large-scale LLM systems.
ACKNOWLEDGMENTS
We thank Hussein Harake, Colin McMurtrie, Mark Klein, Angelo Mangili, and the whole CSCS team granting access to the Ault and Alps machines, and for their excellent technical support. We gratefully acknowledge Polish high-performance computing infrastructure PLGrid (HPC Center: ACK Cyfronet AGH) for providing compute facilities within computational grant no. PLG/2026/019437; we also thank Łukasz Flis and the whole Cyfronet team for their excellent technical support. We thank Timo Schneider for help with infrastructure at SPCL. This project received funding from the European Research Council (Project PSAP, No. 101002047). This project was supported by the ETH Future Computing Laboratory (EFCL), financed by a donation from Huawei Technologies. ChatGPT [37] served as an editorial tool for this manuscript, while ideas and content are original work of the authors.
REFERENCES
[1] Anthropic, “How We Built Our Multi-Agent Research System,” https://www.anthropic.com/engineering/multi-agent-research-system, Jun. 2025, accessed 2026-10-18.
[2] L. Bai, Z. Huang, X. Wang, J. Sun, R. Mihalcea, E. Brynjolfsson, A. Pentland, and J. Pei, “How do ai agents spend your money? analyzing and predicting token consumption in agentic coding tasks,” Oct. 2026, arXiv:2604.22750. [Online]. Available: https://arxiv.org/abs/2604.22750
[3] T. Bai, Y. Bai, Y. Bao, S. H. Cai, Y. Cao, Z. Chai, Y. Charles, H. S. Che, C. Chen, G. Chen, et al., “Kimi K2.5: Visual Agentic Intelligence,” Aug. 2026, arXiv:2602.02276. [Online]. Available: https://arxiv.org/abs/2602.02276
[4] Y. Bai, A. Jones, K. Ndousse, A. Askell, A. Chen, N. DasSarma, D. Drain, S. Fort, D. Ganguli, T. Henighan et al., “Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback,” Apr. 2022, arXiv:2204.05862. [Online]. Available: https://arxiv.org/abs/2204.05862
[5] T. Ben-Nun and T. Hoefler, “Demystifying Parallel and Distributed Deep Learning: An In-depth Concurrency Analysis,” ACM Comput. Surv., vol. 52, no. 4, pp. 65:1–65:43, Aug. 2019. [Online]. Available: https://doi.org/10.1145/3320060
[6] M. Besta, J. Barth, E. Schreiber, A. Kubicek, A. Catarino, R. Gerstenberger, P. Nyczyk, P. Iff, Y. Li, S. Houliston et al., “Reasoning Language Models: A Blueprint,” Jun. 2025, arXiv:2501.11223. [Online]. Available: https://arxiv.org/abs/2501.11223
[7] M. Besta, N. Blach, A. Kubicek, R. Gerstenberger, M. Podstawski, L. Gianinazzi, J. Gajda, T. Lehmann, H. Niewiadomski, P. Nyczyk, and T. Hoefler, “Graph of Thoughts: Solving Elaborate Problems with Large Language Models,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 38, no. 16, pp. 17682–17690, Mar. 2024. [Online]. Available: https://ojs.aaai.org/index.php/AAAI/article/view/29720
[8] M. Besta, S. Chandran, R. Gerstenberger, M. Lindner, M. Chrapek, S. H. Martschat, T. Ghandi, P. Iff, H. Niewiadomski, P. Nyczyk et al., “Psychologically Enhanced AI Agents,” Sep. 2025, arXiv:2509.04343. [Online]. Available: https://arxiv.org/abs/2509.04343
[9] M. Besta, R. Gerstenberger, M. Fischer, M. Podstawski, N. Blach, B. Egeli, G. Mitenkov, W. Chlapek, M. Michalewicz, H. Niewiadomski, J. Mueller, and T. Hoefler, “The graph database interface: Scaling online transactional and analytical graph workloads to hundreds of thousands of cores,” in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, ser. SC '23. Denver, CO, USA: Association for Computing Machinery, Nov. 2023, pp. 22:1–22:18. [Online]. Available: https://doi.org/10.1145/3581784.3607068
[10] M. Besta, R. Gerstenberger, E. Peter, M. Fischer, M. Podstawski, C. Barthels, G. Alonso, and T. Hoefler, “Demystifying Graph Databases: Analysis and Taxonomy of Data Organization, System Designs, and Graph Queries,” ACM Comput. Surv., vol. 56, no. 2, pp. 31:1–31:40, Sep. 2023. [Online]. Available: https://doi.org/10.1145/3604932
[11] M. Besta, P. Iff, F. Scheidl, K. Osawa, N. Dryden, M. Podstawski, T. Chen, and T. Hoefler, “Neural Graph Databases,” in Proceedings of the First Learning on Graphs Conference (LOG '22), ser. Proceedings of Machine Learning Research, B. Rieck and R. Pascanu, Eds., vol. 198. Virtual Event: PMLR, Dec. 2022, pp. 31:1–31:38. [Online]. Available: https://proceedings.mlr.press/v198/besta22a.html
[12] M. Besta, L. Jarmocik, O. Hrycyna, S. Klaiman, K. Maczka, R. Gerstenberger, J. Müller, P. Nyczyk, H. Niewiadomski, and T. Hoefler, “GraphSeek: Next-Generation Graph Analytics with LLMs,” Mar. 2026, arXiv:2602.11052. [Online]. Available: https://arxiv.org/abs/2602.11052
[13] M. Besta, A. Kubicek, R. Gerstenberger, M. Chrapek, R. Niggli, P. Okanovic, Y. Zhu, P. Iff, M. Podstawski, L. Weitzendorf et al., “Multi-Head RAG: Solving Multi-Aspect Problems with LLMs,” Feb. 2026, arXiv:2406.05085. [Online]. Available: https://arxiv.org/abs/2406.05085
[14] M. Besta, F. Memedi, Z. Zhang, R. Gerstenberger, G. Piao, N. Blach, P. Nyczyk, M. Copik, G. Kwaśniewski, J. Müller et al., “Demystifying Chains, Trees, and Graphs of Thoughts,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 47, no. 12, pp. 10967–10989, Dec. 2025. [Online]. Available: https://ieeexplore.ieee.org/document/11123142
[15] M. Besta, L. Paleari, M. Copik, R. Gerstenberger, A. Kubicek, P. Nyczyk, P. Iff, E. Schreiber, T. Srindran, T. Lehmann et al., “CheckEmbed: Effective Verification of LLM Solutions to Open-Ended Tasks,” Jul. 2025, arXiv:2406.02524. [Online]. Available: https://arxiv.org/abs/2406.02524
[16] M. Besta, L. Paleari, J. H. A. Jiang, R. Gerstenberger, Y. Wu, J. G. Hannesson, P. Iff, A. Kubicek, P. Nyczyk, D. Khimey et al., “Affordable AI Assistants with Knowledge Graph of Thoughts,” Oct. 2025, arXiv:2504.02670. [Online]. Available: https://arxiv.org/abs/2504.02670
[17] M. Besta, L. Schmidt, L. Nonino, R. Gerstenberger,
P. Pang, P. Okanovic, A. Kubicek, T. Chen, B. Lipshitz, and T. Hoefler, "Performance foundations of parallel & distributed reasoning language models," Aug. 2026, arXiv:2608.27046. [Online]. Available: https://arxiv.org/abs/2608.27046
[18] K. Chen, X. Tan, J. Li, Z. Zhou, C. Li, J. Liu, M. Jie, J. Jiang, and H. Xu, “Libra: Efficient Resource Management for Agentic RL Post-Training,” Sep. 2026, arXiv:2606.03077. [Online]. Available: https://arxiv.org/abs/2606.03077
[19] T. Chen, B. Xu, C. Zhang, and C. Guestrin, “Training Deep Nets with Sublinear Memory Cost,” Apr. 2016, arXiv:1604.06174. [Online]. Available: https://arxiv.org/abs/1604.06174
[20] B. Cottier, R. Rahman, L. Fattorini, N. Maslej, T. Besiroglu, and D. Owen, “The Rising Costs of Training Frontier AI Models,” Feb. 2025, arXiv:2405.21015. [Online]. Available: https://arxiv.org/abs/2405.21015
[21] A. Du, B. Gao, B. Xing, C. Jiang, C. Chen, C. Li, C. Xiao, C. Du, C. Liao, C. Tang et al., “Kimi k1.5: Scaling Reinforcement Learning with LLMs,” Jun. 2025, arXiv:2501.12599. [Online]. Available: https://arxiv.org/abs/2501.12599
[22] W. Fu, J. Gao, X. Shen, C. Zhu, Z. Mei, C. He, S. Xu, G. Wei, J. Mei, W. Jiashu, T. Yang, B. Yuan, and Y. Wu, “AREAL: A Large-Scale Asynchronous Reinforcement Learning System for Language Reasoning,” in Proceedings of the Thirty-Ninth Annual Conference on Neural Information Processing Systems (NeurIPS '25), ser. Advances in Neural Information Processing Systems, D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen, Eds., vol. 38. San Diego, CA, USA: Curran Associates, Dec. 2025, pp. 36256–36282. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2025/hash/33c00862bfa29ac72ecf630a41e19352-Abstract-Conference.html
[23] D. Guo, D. Yang, H. Zhang, J. Song, P. Wang, Q. Zhu, R. Xu, R. Zhang, S. Ma, X. Bi et al., “DeepSeek-R1 Incentivizes Reasoning in LLMs through Reinforcement Learning,” Nature, vol. 645, no. 8081, pp. 633–638, Sep. 2025. [Online]. Available: https://www.nature.com/articles/s41586-025-09422-z
[24] Z. Han, A. You, H. Wang, K. Luo, G. Yang, W. Shi, M. Chen, S. Zhang, Z. Lan, C. Deng et al., “AsyncFlow: An Asynchronous Streaming RL Framework for Efficient LLM Post-Training,” Sep. 2026, arXiv:2507.01663. [Online]. Available: https://arxiv.org/abs/2507.01663
[25] R. W. Hockney, “The Communication Challenge for MPP: Intel Paragon and Meiko CS-2,” Parallel Computing, vol. 20, no. 3, pp. 389–398, Mar. 1994. [Online]. Available: https://www.sciencedirect.com/science/article/abs/pii/S0167819106800219
[26] J. Kim, B. Shin, J. Chung, and M. Rhu, “The Cost of Dynamic Reasoning: Demystifying AI Agents and Test-Time Scaling from an AI Infrastructure Perspective,” in Proceedings of the IEEE International Symposium on High-Performance Computer Architecture, ser. HPCA
'26. Sydney, Australia: IEEE Press, Feb. 2026, pp. 1–16. [Online]. Available: https://ieeexplore.ieee.org/document/11408569
[27] D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” in Proceedings of the 3rd International Conference on Learning Representations, ser. ICLR '15, San Diego, CA, USA, May 2015, pp. 1–15. [Online]. Available: https://arxiv.org/abs/1412.6980
[28] G. Li, H. Hammoud, H. Itani, D. Khizbullin, and B. Ghanem, “CAMEL: Communicative Agents for “Mind” Exploration of Large Language Model Society,” in Proceedings of the Thirty-Seventh Annual Conference on Neural Information Processing Systems (NeurIPS '23), ser. Advances in Neural Information Processing Systems, A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine, Eds., vol. 36. New Orleans, LA, USA: Curran Associates, Dec. 2023, pp. 51 991–52 008. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/hash/a3621ee907def47c1b952ade25c67698-Abstract-Conference.html
[29] H. Li, S. Lin, F. Fu, Y. Zhou, X. Ji, Y. Zhao, L. Wang, J. Jiang, and B. Cui, “StaleFlow: Staleness-Aware Data Management for Mitigating Data Skewness in Fully Disaggregated RL Post-Training,” Proc. ACM Manag. Data, vol. 4, no. 4, pp. 287:1–287:29, Sep. 2026. [Online]. Available: https://doi.org/10.1145/3837125
[30] A. Liu, B. Feng, B. Xue, B. Wang, B. Wu, C. Lu, C. Zhao, C. Deng, C. Zhang, C. Ruan et al., “DeepSeek-V3 Technical Report,” Feb. 2025, arXiv:2412.19437. [Online]. Available: https://arxiv.org/abs/2412.19437
[31] Z. Mei, W. Fu, K. Li, G. Wang, H. Zhang, and Y. Wu, “ReaL: Efficient RLHF Training for Large Language Models through Parameter Reallocation,” in Proceedings of the Eighth Annual Conference on Machine Learning and Systems (MLSys '25), ser. Proceedings of Machine Learning and Systems, M. Zaharia, G. Joshi, and Y. Lin, Eds., vol. 7, Santa Clara, CA, USA, May 2025, pp. 1–20. [Online]. Available: https://proceedings.mlsys.org/paper_files/paper/2025/hash/3b3889d313ba9476c12c2d77ea66b24f-Abstract-Conference.html
[32] G. Mialon, C. Fourrier, T. Wolf, Y. LeCun, and T. Scialom, “GAIA: A Benchmark for General AI Assistants,” in Proceedings of the Twelfth International Conference on Learning Representations, ser. ICLR '24, B. Kim, Y. Yue, S. Chaudhuri, K. Fragkiadaki, M. Khan, and Y. Sun, Eds., Vienna, Austria, May 2024, pp. 9025–9049. [Online]. Available: https://proceedings.iclr.cc/paper_files/paper/2024/hash/25ae35b5b1738d80f1f03a8713e405ec-Abstract-Conference.html
[33] P. Micikevicius, S. Narang, J. Alben, G. Diamos, E. Elsen, D. Garcia, B. Ginsburg, M. Houston, O. Kuchaiev, G. Venkatesh, and H. Wu, “Mixed Precision Training,” in Proceedings of the Sixth International Conference on Learning Representations, ser. ICLR '18. Vancouver, Canada: OpenReview, Apr. 2018, pp. 1–12. [Online]. Available: https://openreview.net/forum?id=r1gs9JgRZ
[34] D. Narayanan, M. Shoeybi, J. Casper, P. LeGresley,
M. Patwary, V. 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, ser. SC '21. St. Louis, MO, USA: Association for Computing Machinery, Nov. 2021, pp. 58:1–58:15. [Online]. Available: https://doi.org/10.1145/3458817.3476209
[35] OpenAI, “OpenAI o3,” https://openai.com/index/introducing-o3-and-o4-mini/, Apr. 2025, accessed 2026-08-06.
[36] —, “OpenAI o3 and o4-mini System Card,” https://openai.com/index/o3-o4-mini-system-card/, Apr. 2025, accessed 2026-08-06.
[37] —, “ChatGPT,” https://chatgpt.com/, Apr. 2026, accessed 2026-08-06.
[38] L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray et al., “Training Language Models to Follow Instructions with Human Feedback,” in Proceedings of the Thirty-Sixth Annual Conference on Neural Information Processing Systems (NeurIPS '22), ser. Advances in Neural Information Processing Systems, S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, Eds., vol. 35. New Orleans, LA, USA: Curran Associates, Dec. 2022, pp. 27730–27744. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/hash/b1efde53be364a73914f58805a001731-Abstract-Conference.html
[39] S. Rajbhandari, J. Rasley, O. Ruwase, and Y. He, "ZeRO: Memory Optimizations Toward Training Trillion Parameter Models," in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, ser. SC '20. Atlanta, GA, USA: IEEE Press, Nov. 2020, pp. 20:1–20:16. [Online]. Available: https://ieeexplore.ieee.org/document/9355301
[40] S. Rajbhandari, O. Ruwase, J. Rasley, S. Smith, and Y. He, “ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning,” in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, ser. SC '21. St. Louis, MO, USA: Association for Computing Machinery, Nov. 2021, pp. 59:1–59:14. [Online]. Available: https://doi.org/10.1145/3458817.3476205
[41] J. Ren, S. Rajbhandari, R. Y. Aminabadi, O. Ruwase, S. Yang, M. Zhang, D. Li, and Y. He, “ZeRO-Offload: Democratizing Billion-Scale Model Training,” in Proceedings of the USENIX Annual Technical Conference (USENIX ATC), ser. ATC '21. Virtual Event: USENIX Association, Jul. 2021, pp. 551–564. [Online]. Available: https://www.usenix.org/conference/atc21/presentation/ren-jie
[42] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal Policy Optimization Algorithms,” Aug. 2017, arXiv:1707.06347. [Online]. Available: https://arxiv.org/abs/1707.06347
[43] Z. Shao, P. Wang, Q. Zhu, R. Xu, J. Song, X. Bi, H. Zhang, M. Zhang, Y. Li, Y. Wu, and D. Guo, “DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models,” Apr. 2024, arXiv:2402.03300. [Online]. Available: https://arxiv.org/abs/2402.03300
[44] G. Sheng, Y. Tong, B. Wan, W. Zhang, C. Jia, X. Wu, Y. Wu, X. Li, C. Zhang, Y. Peng, H. Lin, X. Liu, and C. Wu, “Laminar: A scalable asynchronous rl post-training framework,” in Proceedings of the 21st European Conference on Computer Systems, ser. EuroSys '26. Edinburgh, Scotland, UK: Association for Computing Machinery, Apr. 2026, pp. 400–422. [Online]. Available: https://doi.org/10.1145/3767295.3803580
[45] G. Sheng, C. Zhang, Z. Ye, X. Wu, W. Zhang, R. Zhang, Y. Peng, H. Lin, and C. Wu, “HybridFlow: A Flexible and Efficient RLHF Framework,” in Proceedings of the Twentieth European Conference on Computer Systems, ser. EuroSys '25. Rotterdam, Netherlands: Association for Computing Machinery, Mar. 2025, pp. 1279–1297. [Online]. Available: https://doi.org/10.1145/3689031.3696075
[46] Y. Sheng, L. Zheng, B. Yuan, Z. Li, M. Ryabinin, B. Chen, P. Liang, C. Re, I. Stoica, and C. Zhang, “FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU,” in Proceedings of the 40th International Conference on Machine Learning (ICML '23), ser. Proceedings of Machine Learning Research, A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett, Eds., vol. 202. Honolulu, HI, USA: PMLR, Jul. 2023, pp. 31094–31116. [Online]. Available: https://proceedings.mlr.press/v202/sheng23a.html
[47] A. Singh, A. Fry, A. Perelman, A. Tart, A. Ganesh, A. El-Kishky, A. McLaughlin, A. Low, A. Ostrow, A. Ananthram et al., “OpenAI GPT-5 System Card,” May 2026, arXiv:2601.03267. [Online]. Available: https://arxiv.org/abs/2601.03267
[48] N. Stiennon, L. Ouyang, J. Wu, D. Ziegler, R. Lowe, C. Voss, A. Radford, D. Amodei, and P. F. Christiano, “Learning to Summarize with Human Feedback,” in Proceedings of the Thirty-Fourth Annual Conference on Neural Information Processing Systems (NeurIPS '20), ser. Advances in Neural Information Processing Systems, H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, Eds., vol. 33. Virtual Event: Curran Associates, Dec. 2020, pp. 3008–3021. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2020/hash/1f89885d556929e98d3ef9b86448f951-Abstract.html
[49] X. Tan, Y. Feng, Y. Zhou, Y. Jiang, Y. Zhu, and H. Xu, “OrchestrRL: Dynamic Compute and Network Orchestration for Disaggregated RL,” Mar. 2026, arXiv:2601.01209. [Online]. Available: https://arxiv.org/abs/2601.01209
[50] Z. Tan, M. Wang, S. Wang, Y. Yin, Q. Wang, X. Chu, and S. Shi, “Bidirectional Resource Scheduling for Disaggregated and Asynchronous RL Post-Training,” Aug. 2026, arXiv:2607.09207. [Online]. Available:
https://arxiv.org/abs/2607.09207
[51] L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, Z. Chen, J. Tang, X. Chen, Y. Lin, W. X. Zhao, Z. Wei, and J. Wen, "A Survey on Large Language Model Based Autonomous Agents," Frontiers of Computer Science, vol. 18, no. 6, pp. 186345:1–186345:26, Mar. 2024. [Online]. Available: https://link.springer.com/article/10.1007/s11704-024-40231-1
[52] J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. Chi, Q. V. Le, and D. Zhou, “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models,” in Proceedings of the Thirty-Sixth Annual Conference on Neural Information Processing Systems (NeurIPS '22), ser. Advances in Neural Information Processing Systems, S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, Eds., vol. 35. New Orleans, LA, USA: Curran Associates, Dec. 2022, pp. 24824–24837. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract-Conference.html
[53] A. Weingram, D. Zhang, Z. Chen, H. Qi, and X. Lu, “HPC-R1: Characterizing R1-Like Large Reasoning Models on HPC,” in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, ser. SC '25. St. Louis, MO, USA: Association for Computing Machinery, Nov. 2025, pp. 1368–1380. [Online]. Available: https://doi.org/10.1145/3712285.3759827
[54] S. J. Wright, “Coordinate Descent Algorithms,” Mathematical Programming, vol. 151, no. 1, pp. 3–34, Mar. 2015. [Online]. Available: https://link.springer.com/article/10.1007/s10107-015-0892-3
[55] Q. Wu, G. Bansal, J. Zhang, Y. Wu, B. Li, E. Zhu, L. Jiang, X. Zhang, S. Zhang, J. Liu, A. H. Awadallah, R. W. White, D. Burger, and C. Wang, “AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation,” in Proceedings of the First Conference on Language Modeling, ser. COLM '24. Philadelphia, PA, USA: OpenReview, Oct. 2024, pp. 1–46. [Online]. Available: https://openreview.net/forum?id=BAakY1hNKS
[56] xAI, “Introducing Grok 4.7,” https://x.ai/news/grok-4-7, Sep. 2026, accessed 2026-10-18.
[57] J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press, “SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering,” in Proceedings of the Thirty-Eighth Annual Conference on Neural Information Processing Systems (NeurIPS '24), ser. Advances in Neural Information Processing Systems, A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang, Eds., vol. 37. Vancouver, Canada: Curran Associates, Dec. 2024, pp. 50528–50652. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2024/hash/5a7c947568c1b1328ccc5230172e1e7c-Abstract-Conference.html
[58] S. Yao, D. Yu, J. Zhao, I. Shafran, T. Griffiths, Y. Cao,
and K. Narasimhan, “Tree of Thoughts: Deliberate Problem Solving with Large Language Models,” in Proceedings of the Thirty-Seventh Annual Conference on Neural Information Processing Systems (NeurIPS '23), ser. Advances in Neural Information Processing Systems, A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine, Eds., vol. 36. New Orleans, LA, USA: Curran Associates, Dec. 2023, pp. 11809–11822. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/hash/271db9922b8d1f4dd7aaef84ed5ac703-Abstract-Conference.html
[59] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao, “ReAct: Synergizing Reasoning and Acting in Language Models,” in Proceedings of the Eleventh International Conference on Learning Representations, ser. ICLR '23. Kigali, Rwanda: OpenReview, May 2023, pp. 1–24. [Online]. Available: https://openreview.net/forum?id=1PL1NIMMrw
[60] Y. Yao, Z. Li, and H. Zhao, “GoT: Effective Graph-of-Thought Reasoning in Language Models,” in Findings of the Association for Computational Linguistics: NAACL 2024, K. Duh, H. Gomez, and S. Bethard, Eds. Mexico City, Mexico: Association for Computational Linguistics, Jun. 2024, pp. 2901–2921. [Online]. Available: https://aclanthology.org/2024.findings-naacl.183/
[61] C. Yu, Y. Wang, Z. Guo, H. Lin, S. Xu, H. Zang, Q. Zhang, Y. Wu, C. Zhu, J. Hu, Z. Huang, M. Wei, Y. Xie, K. Yang, B. Dai, Z. Xu, J. Du, X. Wang, X. Fu, L. Shi, Z. Liu, K. Chen, W. Liu, G. Liu, B. Li, J. Yang, Z. Yang, G. Dai, and Y. Wang, “RLinf: Flexible and Efficient Large-Scale Reinforcement Learning via Macro-to-Micro Flow Transformation,” in Proceedings of the 20th USENIX Symposium on Operating Systems Design and Implementation, ser. OSDI '26. Seattle, WA, USA: USENIX Association, Jul. 2026, pp. 829–846. [Online]. Available: https://www.usenix.org/conference/osdi26/presentation/yu-chao
[62] R. Zheng, S. Dou, S. Gao, Y. Hua, W. Shen, B. Wang, Y. Liu, S. Jin, Q. Liu, Y. Zhou et al., “Secrets of RLHF in Large Language Models Part I: PPO,” Jul. 2023, arXiv:2307.04964. [Online]. Available: https://arxiv.org/abs/2307.04964
[63] Y. Zhong, Z. Zhang, B. Wu, S. Liu, Y. Chen, C. Wan, H. Hu, L. Xia, R. Ming, Y. Zhu, and X. Jin, “Optimizing RLHF Training for Large Language Models with Stage Fusion,” in Proceedings of the 22nd USENIX Symposium on Networked Systems Design and Implementation, ser. NSDI '25. Philadelphia, PA, USA: USENIX Association, Apr. 2025, pp. 489–503. [Online]. Available: https://www.usenix.org/conference/nsdi25/presentation/zhong
APPENDIX A
RPEG PIPELINE: FORMULATION & DESIGN DETAILS
We now provide extended mathematical details of RPEG.
A. RPEG Pipeline Execution Graph
Definition A.1 (RLM Pipeline Execution Graph): An RLM Pipeline Execution Graph (RPEG) is a tuple
where:
-
is a finite set of RPEG vertices (representing model invocations);
-
and are finite sets of data and publication edges, where each edge connects a source vertex to a destination vertex and carries a single container ;
-
is the finite set of containers referenced by the RPEG; the boundary subsets (external inputs and outputs) are characterized by well-formedness condition 3;
-
is a set of all models represented in the RPEG pipeline (e.g., actor, critic, reference, reward for PPO-based training);
-
is the set of trainable models, where denotes the full set of models;
-
assigns a bounded-staleness budget per trainable model.
Figure 13 illustrates the PPO RPEG. A complete formal instantiation – including all container definitions, operator input and output interfaces, and edge annotations – is given in Section A-D.
We now further detail each component of the RPEG.
- Vertices and Operator Types: Each RPEG vertex represents a model invocation. A vertex is characterized by three attributes:
-
a role ,
-
a model , and
-
input/output container interfaces declaring which containers the operator may read and write.
We write for the operator kind of .
The vertex set therefore determines which models participate in the algorithm and how they appear within one iteration. Different policy optimization algorithms correspond to different choices of and dependency structure (). For example, the base PPO RPEG comprises six vertices – generation, three inference passes, and two training passes – while GRPO eliminates the critic and reduces to four. DPO removes online generation entirely, collapsing the graph to three.

Fig. 13: RPEG for a PPO-based RLM training pipeline. The trainable model set is (actor and critic), both with staleness budget (synchronous execution; depicted like this only in this example). External inputs are , and no external outputs are exposed (). Containers: prompts, completions, per-token value predictions, per-completion reward, reference log-probs, actor log-probs, and model 's weights. Edges encode scheduling dependencies, not all data accesses: boundary inputs are accessible to all operators that declare them in their interface, and containers such as and reach training transitively through the assessment stage without requiring direct edges. The structure is shown for a fixed workload.
- Containers: A container has an identity and size metadata (#a, ), where #a is the element count and is the element size in bytes. The total byte volume of a container is #a .
Containers make communication volume explicit in the IR: the byte volume #a of a container on a connecting edge determines the data transfer cost when source and destination are placed on different devices. The set collects all containers in the RPEG, covering both within-step data (e.g., completions, log-probabilities, or rewards) and cross-step model weights.
- Data and Publication Edges: Each RPEG edge carries exactly one container and represents the algorithmic dependence of the destination on the data produced by the source. The RPEG distinguishes two classes of edges:
-
Data edges represent within-step dependencies. Generation produces completions consumed by inference; inference produces log-probabilities, rewards, and values consumed by training.
-
Publication edges represent cross-step weight updates. After training updates a model's parameters, a publication edge carries the new weights to the operators that consume them in subsequent iterations. These are the edges whose unrolling semantics are governed by the staleness budget .
An important distinction separates edges from operator interfaces. Each operator declares input and output interfaces ( and ) that specify which containers it may access, but not every declared input requires a corresponding incoming edge, since edges impose both a data-transfer requirement and a scheduling dependency. Two cases lack edges: boundary inputs (e.g., prompts, frozen weights) are accessible to all operators that declare them since they are external to the graph; and containers already resident from a prior stage can be accessed transitively without a direct edge. For example, training operators read and from generation, but the RPEG by default omits direct generation-to-training edges – unless explicitly determined by the user.
B. Well-Formedness
Not every tuple of vertices, edges, and containers constitutes a valid RPEG. We therefore impose a set of static well-formedness conditions on that are fundamental for lowering, scheduling, and costing the RPEG.
Definition A.2 (Well-Formedness): An RPEG is well-formed if the following conditions hold:
- Interface consistency. For every edge carrying container , the container must satisfy
That is, edges may only transfer containers that the source declares as output and the destination declares as input.
-
Publication edges carry model parameters. For every publication edge , the source vertex must be a training operator and the container must represent the weight tensor of the trained model.
-
Boundary consistency. If a container is read by some vertex but has no producer, then . If a container is written by some vertex but has no consumer, then . This condition ensures that all data entering or leaving the RPEG is accounted for explicitly.
-
Acyclicity of within-step dependencies. The directed graph induced by data edges is acyclic. Cyclic dependencies may only arise through publication edges, which represent cross-iteration weight updates.
These conditions are checked statically on the RPEG and ensure that represents a well-defined steady-state computation before unrolling, lowering, scheduling, and costing.
C. Execution Plan and Device Space
While the RPEG specifies the algorithmic structure of a steady-state RLM training iteration, execution-level decisions determine how this structure is mapped onto a concrete hardware topology. We formalize both the device space and the execution plan in this section.
1 ) Device Space:
Definition A.3 (Device Space): We model the physical hardware as a hierarchical device space
where denotes the number of racks, the number of nodes per rack, and the number of GPUs per node. The total number of devices is therefore .
Here we interpret (analogously for , ), and we use half-open integer intervals when specifying contiguous blocks.

Fig. 14: Device space and allocation. The device space organizes GPUs into a 3D hierarchy. An allocation selects a contiguous rectangular region, ensuring that all devices assigned to an operator are physically co-located.
Definition A.4 (Device Allocation): A device allocation is a contiguous hyper-rectangle , defined by an origin and an extent :
We write for the number of devices in an allocation. Figure 14 illustrates the device space and a sample allocation.
Example A.1 (Device Allocation): Given a cluster with two racks, eight nodes per rack and four GPUs per node, the device space is . Allocating the first two nodes in the first rack corresponds to and .
- Execution Plan: The execution plan is a set of functions over that assign hardware-dependent attributes – placement, 3D parallelization strategy, and microbatch count – to each RPEG vertex. It does not alter the structure of .
Definition A.5 (Execution Plan): Given an RPEG , an execution plan is a tuple
where for every RPEG vertex :
• is a device allocation;
• specifies data, pipeline, and tensor parallel degrees;
• is the number of pipeline microbatches.
The parallelization tuple determines how operator v's computation is partitioned into shards, while specifies where these shards are placed in the device space. We require for every vertex v that
ensuring that the number of logical shards induced by the parallel degrees matches the number of allocated devices.
Furthermore, if , then , since microbatching is meaningful only in the presence of pipeline parallelism.
D. PPO RPEG Instantiation
This section provides the complete formal instantiation of the PPO RPEG.
- Models: The PPO pipeline uses four models , of which are trainable. The RPEG has six vertices (Table VII):
| Vertex | Role | Model | Description |
|---|---|---|---|
| generation | Autoregressive rollout: produces completions Y and log-probabilities . | ||
| inference | Reference forward pass: produces baseline log-probabilities . | ||
| inference | Reward scoring: produces per-sequence rewards r. | ||
| inference | Value estimation: produces per-token values v. | ||
| training | Actor policy-gradient update. | ||
| training | Critic value-loss update. |
TABLE VII: PPO RPEG vertices with operator kinds. Each vertex is characterized by a role and a model .
- Containers: Table VIII lists all containers. Let denote the batch size, the number of rollouts per prompt, the average prompt length, the average rollout length, the working precision (2 bytes for BF16), and the parameter counts.
| Container | #a | s(a) | Description |
|---|---|---|---|
| Weight containers (carried by publication edges) | |||
| Actor parameters. | |||
| Critic parameters. | |||
| Reference parameters (frozen). | |||
| Reward parameters (frozen). | |||
| Data containers (carried by data edges) | |||
| X | Prompt tokens. | ||
| Y | Completions (prompt + response). | ||
| Actor log-probabilities. | |||
| Reference log-probabilities. | |||
| r | BR | Rewards (per sequence). | |
| v | Value estimates (per token). | ||
TABLE VIII: PPO RPEG containers. Boundary inputs: ; no external outputs ( ).
- Operator Interfaces: Each vertex declares which containers it reads and writes (Table IX). These interfaces determine interface consistency (Section A-B) and are used by the lowering pass to derive communication payloads.
| Vertex | I(v) | O(v) |
|---|---|---|
TABLE IX: PPO operator input/output interfaces. Training operators declare containers in their read set that are not delivered by incoming edges (e.g., reads Y and from device memory rather than via a direct edge from ).
- Edges: We also formulate PPO edges.
Data edges.
No direct edges connect generation to training.
Publication edges.
Staleness. Each publication edge is governed by the staleness budget of its source model: for the actor publication , and for the critic publication . Setting both to zero recovers synchronous execution; setting allows one step of actor overlap (see Section A-F).
E. Other RLM Training Algorithms
The RPEG formalism applies to any RLM training algorithm by adjusting the vertex and edge sets. GRPO removes the critic vertices and derives training signals from relative rewards within groups of sampled responses, reducing the graph to four vertices. DPO removes both the reward model and the online generation loop, collapsing the graph to an offline preference-optimization pipeline. The unrolling, lowering, cost modeling, and optimization procedures from the preceding sections apply without modification to all three variants.
Fig. 15 shows the synchronous PPO case. Fig. 16 illustrates how varying changes the structure of the unrolled graph.
F. Unrolling
Unrolling expands the cyclic RPEG into a finite acyclic graph over steps, resolving cross-step publication edges according to the staleness budget . We use PPO as the running example throughout this section, but the same procedures apply to GRPO and DPO graphs.
Before the cyclic RPEG can be unrolled into a finite DAG, we must resolve an ambiguity: the staleness budget bounds how old the consumed weights may be, but does not specify which training step provides them. We first formalize this publisher selection, then define the unrolled graph that results from it.

Fig. 15: Unrolled RPEG for a PPO-based RLM training pipeline. The cyclic RPEG from Fig. 13 is unrolled over synchronous steps (). Each RPEG vertex is replicated per step, data edges are copied within each step, and publication edges are wired across step boundaries according to the staleness budget .
a) Synchronous

b) 1-Step Asynchrony

c) 2-Step Asynchrony

Fig. 16: Unrolled RPEGs under different staleness budgets (simplified; operator attributes and edge containers omitted for clarity). (a) Synchronous execution (): publication edges connect consecutive steps, enforcing strict ordering. (b) One-step bounded staleness (): actor publication edges span two steps, enabling concurrent generation and training. (c) Two-step bounded staleness (, ): deeper overlap with longer publication arcs. Red arrows denote publication edges carrying weight containers and ; black arrows denote within-step data edges.
- Publication and Bounded Staleness: When for some model , generation at step may overlap with training at step k, using slightly stale policy weights for rollout generation.
As noted above, does not determine which specific step provides the weights. To resolve this during unrolling, we introduce a publisher-selection function that maps each step k to the concrete training step whose output it consumes.
Definition A.6 (Publisher Selection): Fix . For each trainable model , define
This choice selects the maximally stale admissible publisher and is deterministic. It satisfies
The synchronous case is recovered by enforcing for all trainable models, yielding .
- Unrolled Graph: Given the deterministic publisher selection function, we can now formally define the unrolling process.
Definition A.7 (Unrolled Graph): Given a well-formed RPEG and an evaluation horizon , the unrolled graph is
with the following components:
• Vertices.
Each RPEG vertex is replicated once per step index.
• Within-step edges. For each data edge and each ,
carrying the same container a as the RPEG edge.
• Publication edges. For each publication edge and each with , where denotes the model invoked by vertex u,
carrying the same weight container a as the RPEG edge. For early steps , no publication edge is created: these steps use the initial parameter version and have no training predecessor. Because no dependency connects them to prior training, the early serving invocations may overlap when the remaining data, ordered-update, and physical-resource constraints permit it; they read the same initial version but process distinct data batches.
The key structural property of the unrolled graph is acyclicity, which we verify next.
Recall that .
Algorithm 3: UNROLL: Unroll cyclic RPEG
Input: RPEG , evaluation horizon
Output: Unrolled DAG
1 , , ; /* Step 1: replicate vertices / 2 for to do 3 foreach do 4 | add to ; 5 end 6 end / Step 2: replicate within-step data edges / 7 for to do 8 foreach do 9 | add to ; 10 end 11 end / Step 3: instantiate publication edges with bounded staleness / 12 for to do 13 foreach do 14 ; 15 if then 16 continue; / step uses initial weights of model */ 17 end 18 ; 19 add to ; 20 end 21 end 22 return ;
Lemma A.1 (Acyclicity): If is acyclic, then the unrolled graph is a DAG.
Proof. Within-step edges preserve and are acyclic by the well-formedness assumption on . Publication edges strictly increase because . Together, no directed cycle can exist.
- Ensuring Ordering of Training Updates Under Asynchrony: Successive training updates of the same model are ordered independently of the staleness budget. For each trainable model m with training operator , unrolling additionally introduces
These dependencies ensure that consecutive updates of the same optimizer state remain ordered.
- Unrolling Algorithm: Algorithm 3 gives the complete unrolling procedure. The runtime is
as each of the three steps in the pseudocode iterates over one component of the RPEG, replicated times.
Each unrolled edge inherits the container from its RPEG edge. The algorithm omits this for brevity.
G. Lowering
Lowering incorporates the execution plan P to produce the executable graph , inserting explicit communication and resharding nodes wherever placement or strategy differences require data movement. Thus, lowering is the stage at which

Fig. 17: Executable graph for one step of a PPO-based RLM training pipeline. Derived from the RPEG in Fig. 13 via unrolling and lowering. COMM and RESHARD nodes are inserted wherever the execution plan requires data movement between different device allocations or parallel layouts.
the unrolled graph and the execution plan are combined into a single hardware-aware DAG. The resulting executable graph serves as input to the cost model and scheduler defined further. Both transformations are defined generically over any RPEG. We use PPO as the running example throughout this section, but the same procedures apply to GRPO and DPO graphs.
Concretely, lowering takes the pair and constructs the executable graph by traversing the nodes and edges of and inserting COMM and RESHARD nodes wherever the execution plan requires data movement or weight redistribution.
Definition A.8 (Executable Graph): The executable graph is a DAG
whose nodes are of three kinds:
- OP nodes correspond to unrolled RPEG vertices, each attributed with a device allocation, parallel strategy, and microbatch count from the execution plan.
- COMM nodes represent data transfer between OP nodes placed on different device allocations (on both data and publication edges).
- RESHARD nodes represent weight redistribution when successive invocations of the same model use different parallel layouts on the same devices.
Fig. 17 shows the PPO-based executable graph for one step. Before describing the lowering procedure itself, we specify the attributes that distinguish the three node kinds.
Allocation. Each OP node occupies exactly one device allocation (as specified by the execution plan). COMM and RESHARD nodes are attributed with both the source and destination allocations.
Payload. Every node in carries a payload in bytes:
- each COMM node carries a payload equal to the byte volume of the container on the corresponding data edge,
- each RESHARD node carries a payload equal to the full parameter size of the associated model,
- OP nodes carry zero payload.
We now describe how the executable graph is constructed by lowering the unrolled graph with the execution plan.
- Stage 1: Operator Instantiation: For every unrolled vertex , we create an OP node with device allocation , parallel strategy , and microbatch count .
When generation quantile splitting is enabled (see below), generation and inference vertices may be replaced by multiple sub-nodes during this stage.
Response-length-aware sub-node splitting. Autoregressive generation produces responses of highly variable length. In reasoning workloads, response-length distributions are heavily skewed: many sequences finish quickly while a small number of long-tail rollouts dominate wall-clock time [17, 44, 63]. In a monolithic generation operator, the entire batch must finish before any downstream inference can begin – the longest response delays all subsequent work. When generation and a) Executable Graph

b) Schedule

Fig. 18: Without sub-node splitting. (a) Executable graph: generation on GPU 0 feeds three inference operators on GPUs 1–3 via COMM nodes. (b) Schedule: inference GPUs are idle for the entire duration of generation, since no partial results are available until the full batch completes. For clarity, only device allocations (origin , extent ) are shown on each node; parallel strategies, microbatch counts, and read/write interfaces are omitted.
a) Executable Graph

b) Schedule

Fig. 19: With quantile-based sub-node splitting (). (a) Executable graph: generation and each inference operator are split into three sub-nodes chained sequentially. Each generation sub-node feeds the corresponding inference sub-nodes via COMM nodes. (b) Schedule: inference sub-nodes from early-finishing sequences overlap with later generation phases, substantially reducing idle time and makespan. For clarity, only device allocations (origin , extent ) are shown on each node; parallel strategies, microbatch counts, and read/write interfaces are omitted.
inference are placed on disjoint devices, the lowering pass can exploit this skewness by splitting generation into phases based on the response-length distribution, allowing inference to start processing early-finishing sequences while longer ones continue decoding. This is related to the inter-stage fusion mechanism proposed by RLHFuse [63], but expressed here as a structural graph transformation within the lowering pass rather than a runtime scheduling decision.
Definition A.9 (Response-Length Quantiles): The response-length distribution is specified by Q quantile breakpoints
where each is a cumulative fraction of sequences and is the number of generated tokens at which that fraction completes. We require (all sequences finish by ) and .
Example A.2 (Response-Length Quantiles): With Q = 4 and breakpoints
25% of sequences finish within 512 tokens, 50% within 1024, 85% within 1536, and all by 2048.
Obtaining the response-length distribution. The quantile breakpoints are obtained empirically by profiling generation lengths on a representative sample of prompts. Before optimization, a small subset of the training prompts (e.g., a few hundred) is processed through the current model checkpoint, and the empirical response-length distribution is recorded. The quantile breakpoints are then fitted directly from this sample. The number of quantiles Q controls the granularity of the sub-node splitting: recovers the monolithic generation operator, while larger Q enables finer-grained overlap at the cost of additional nodes in the executable graph. In practice, captures the relevant structure of the distribution without introducing excessive graph complexity.
Splitting mechanism. The lowering pass splits a generation vertex into sub-nodes only when the execution plan places generation and at least one downstream inference operator on disjoint devices – otherwise no overlap is possible and the operator remains an indivisible OP node. Concretely, for each generation vertex with a disjoint downstream inference vertex:
-
The single OP node is replaced by Q generation sub-nodes , chained sequentially on the same devices. Sub-node represents the decode phase during which the fraction of sequences complete (with ). The first sub-node additionally includes the prefill phase.
-
Each downstream inference vertex on disjoint devices is similarly split into inference sub-nodes , also chained sequentially on their own devices.
-
Generation sub-node is connected to inference sub-node via a COMM node with payload
bytes – the container volume scaled by the fraction of sequences completing in that phase.
All sub-nodes inherit the device allocation, parallel strategy, and microbatch count from the original RPEG vertex.
Figs. 18 and 19 illustrate the effect of sub-node splitting on both the executable graph and the resulting schedule for a 4-GPU example.
Crucially, this wiring makes gen-inf overlap (inter-stage fusion) possible but does not enforce it. The optimizer controls whether overlap occurs by choosing the device allocations: if it places generation and inference on disjoint devices, the scheduler can execute inference sub-nodes concurrently with later generation sub-nodes. If the optimizer places them on the same devices, the scheduler serializes them and no overlap occurs – in this case, no splitting is performed, since sub-nodes on shared devices would add graph complexity without enabling any concurrency.
- Stage 2: Communication Node Insertion: When sub-node splitting has been applied, the edges between generation and inference sub-nodes created in Stage 1 are processed by the following stages in the same way as edges between unsplit OP nodes – COMM and RESHARD insertion does not distinguish between them.
We traverse the data edges of . For each edge with container :
• Same allocation : no transfer is needed. We add a precedence edge .
• Different allocation : data must move between device allocations. We insert a COMM node with payload bytes and add edges .
After this stage, all cross-allocation data movement is represented explicitly.
- Stage 3: Intra-Iteration Weight Redistribution: When two operators of the same trainable model appear within one iteration, the lowering pass must ensure that the second operator receives weights in a compatible layout. To identify such pairs, we compute a topological ordering of , collect all vertices with for each trainable model (frozen models have fixed weights and are never resharded), and define as the consecutive pairs in this ordering.
Not every pair requires resharding. Depending on the staleness budget and device placement, a pair falls into one of two categories – shadow pairs and non-shadow pairs – which the lowering pass handles differently.
Shadow pairs. In synchronous RLM training, generation and training of the same model execute sequentially and may share a single weight copy that is resharded between them as needed [31]. When and the optimizer places the two operators on disjoint device allocations, a more efficient pattern becomes possible: each device allocation maintains its own persistent weight copy, avoiding intra-step resharding between those copies while retaining cross-step publication and enabling concurrent execution. We call this a shadow pair.
Definition A.10 (Shadow Pair): A consecutive pair of a trainable model is a shadow pair under execution plan if:
-
(bounded asynchrony), and
-
(device disjointness).
These conditions identify the shadow-pair optimization. Synchronous persistent serving workers can still retain a copy to avoid reconstruction; therefore a single-copy policy is not universally faster. Overlapping allocations restrict concurrency, but physical copy lifetime is determined by actual workers and required versions, not solely by the shadow-pair predicate.
When a shadow pair is active, two weight instances coexist in the device space:
• Training instance on : holds up-to-date weights, optimizer state (FP32 master weights, first and second moments), and gradients. This is the source of parameter updates.
• Shadow instance on the consumer's devices (e.g., for generation or for inference): holds a read-only BF16 weight snapshot. This copy is periodically refreshed by a COMM node that transfers updated weights from the training instance (Stage 4).
Because no intra-step reshard or precedence edge connects the two sides, they are free to execute concurrently. The idea of maintaining stale parameter replicas for concurrent execution appears in recent asynchronous RLM training systems [22]; our framework exposes it as a structural property of the execution plan that the optimizer can discover automatically.
For shadow pairs, the lowering pass skips the intra-step reshard entirely: no RESHARD node and no precedence edge are inserted between and within any step k.
Non-shadow pairs. For each non-shadow pair and each
• Same allocation and strategy : the weight layout is already compatible; no action.
• Same allocation, different strategy : the weights reside on the same devices but in an incompatible parallel layout. We create a RESHARD node with payload bytes (the full parameter count of model ) and add edges to .
• Different allocation : the two operators run on different (possibly overlapping) device allocations – for example, inference on 8 GPUs and training on 16 GPUs with partial overlap. Since this is not a shadow pair, or the allocations are not fully disjoint. Each side holds its own weight copy: training devices have weights from the optimizer state, while inference devices load them transiently via a prior publication transfer and free them after the operator completes. No redistribution is needed, but a bare precedence edge enforces that the first operator completes before the second begins.
- Stage 4: Cross-Iteration Publication Edges: Stages 1–3 handle within-step structure. The final stage wires the cross-step publication edges that carry updated weights from training at an earlier step to consumers at a later step. For each publication edge with , the lowering pass selects one of three actions based on the relative placement and strategy of source and destination:
• Same allocation and strategy : a bare precedence edge suffices.
• Same allocation, different strategy : we insert a RESHARD node as in Stage 3.
- Different allocation : the updated weights must be sent from the training devices to the consumer's devices. We insert a COMM node with edges ; the source retains its copy. When the source and destination allocations partially overlap, devices in the intersection can produce their weight shard locally, reducing the transfer to , where and .
- Lowering Algorithm: Algorithm 4 gives the complete lowering procedure. The runtime is
since the number of intra-step model pairs is bounded by .
H. Scheduling
Given the executable graph and the node-level time map (delivered by our performance model), this section details the derivation of the execution time of the entire graph and derives a throughput-based score that serves as the optimization objective.
The key challenge is that the graph's makespan cannot be obtained by simply summing node execution times: nodes may execute concurrently when their precedence constraints are satisfied and their device allocations do not conflict, but must initialize when they compete for the same devices. Computing an optimal schedule under these constraints is NP-hard; we therefore use a greedy list-scheduling heuristic.
Definition A.11 (Schedule): A schedule for assigns each node a start time and finish time such that:
- Precedence.
That is, a node may only start after all its predecessors have finished.
- Device reservation.
That is, nodes that reserve overlapping devices may not execute concurrently. Here denotes the reserved device allocation: the full allocation for OP nodes, and the destination allocation for COMM/RESHARD nodes (source devices are free after send initiation).
Algorithm 4: LOWER: lower unrolled DAG to executable graph
Input: Unrolled DAG , execution plan , RPEG , quantiles (optional)
Output: Executable DAG
1 , ;
/* Stage 1: Op nodes (optional quantile splitting) */
2 foreach do
3 if
4 replace by sub-nodes and chain ;
5 split each disjoint downstream inf into ;
6 connect with scaled payload;
else
8 create OP node with ;
9 end
10 end
/* Stage 2: Comm insertion on data edges */
/* For refined operators, resolve the corresponding input/output interfaces; do not duplicate phase edges already created in Stage 1. */
11 foreach do
12 if then
13 add to ;
14 else
15 create COMM node with payload ;
16 add to ;
17 end
18 end
/* Stage 3: intra-step weight redistribution */
19 Compute Pairs from Topo for each trainable ;
20 foreach do
21 if and then
22 skip;
23 /* shadow pair */
24 end
25 if and then
26 skip;
27 end
28 if then
29 create RESHARD with payload ;
30 add ;
31 else
32 add ;
33 end
/* Stage 4: cross-step publication edges */
34 foreach do
35 if the exact required version already has an equivalent installation dependency then
36 reuse that dependency;
37 end
38 if and then
39 add ;
40 end
41 else if then
42 create RESHARD with payload ;
43 add ;
44 end
45 else
46 create COMM with payload ;
47 add ;
48 end
49 end
50 return ;
Definition A.12 (Makespan): The makespan of a schedule is the latest finish time across all nodes:
- Scheduling Heuristic: The scheduler constructs a feasible schedule by processing nodes greedily, assigning each node the earliest start time that satisfies both constraints from the schedule definition above. When multiple nodes are ready simultaneously, the scheduler must decide which to schedule first. We prioritize nodes that lie on or near the critical path, since delaying them is most likely to increase the makespan. This is captured by the downstream rank:
Definition A.13 (Downstream Rank):
with . The rank approximates the remaining work on the longest path from v to any sink.
Definition A.14 (Earliest Feasible Start Time): For a ready node v (all predecessors scheduled), the earliest feasible start time is
where tracks when device d becomes free. The first term enforces precedence; the second ensures all blocking devices are available.
Selection and tie-breaking. At each step, the scheduler selects the ready node with the smallest EST. Ties are broken by:
-
COMM/RESHARD nodes before OP nodes (to avoid artificial serialization of transfers),
-
larger downstream rank .
After scheduling v at , the availability of all devices in is updated to . Two additional tie-breakers (sub-node rank inheritance and RPEG-order consistency) are described after the algorithm.
- Scheduling Algorithm: Algorithm 5 returns MS( ). Since and , the runtime is
The implementation uses a min-heap with lazy deletion, which accounts for the log factor.
Sub-node rank inheritance. When generation quantile splitting (Section A-G) produces a chain of sub-nodes on the same devices, rank naturally decreases along the chain (later sub-nodes have shorter remaining paths). Without correction, the scheduler may interleave unrelated operators between generation phases, which disrupts KV-cache residency (the cache built during earlier phases would be evicted before later phases use it). To prevent this, all sub-nodes in a chain inherit the rank of the chain head (the first sub-node).
RPEG-order tie-breaking. Beyond rank, the scheduler uses the RPEG vertex index as an additional tie-breaker: operators from the same RPEG position across different unrolled
Algorithm 5: GREEDYSCHEDULE( )
Input: Executable DAG , time map , device space . Output: Schedule and makespan.
1 Compute rank(v) for all v in reverse topological order; 2 Initialize avail(d) 0 for all ; 3 ; 4 while do 5 Select ; /* Tie-break: Comm/Reshard before Op, then larger rank / s(v) EST(v*), ; foreach do | avail(d) ; end 10 Update : remove , add newly-ready successors; 11 end 12 return ;
steps are scheduled in the same relative order. This produces steady-state regularity in the schedule, which is important for asynchronous execution where overlapping iterations should exhibit consistent device-usage patterns.
I. Optimization Objective
The executable graph spans unrolled iterations. Under bounded staleness, work from different iterations may overlap in time, so a per-iteration latency metric is not applicable: it cannot capture how consecutive iterations overlap. We instead use global throughput over the full evaluation horizon as the optimization objective.
- Throughput Objective: Since is constant for a fixed workload, maximizing throughput is equivalent to minimizing the makespan. The optimizer uses (Equation 5) as its search objective; when the utilization objective is enabled, the penalty is applied to (Equation 6) instead. The score captures the end-to-end effect of all optimization decisions: the RPEG structure , the staleness budget , the execution plan , and structural choices such as stage fusion and placement strategies.
Definition A.15 (Throughput Score): The throughput score of a configuration is
where is the number of tokens processed per iteration and MS( ) is the makespan from Algorithm 5.
Memory penalty. Not all configurations are memory-feasible. Rather than rejecting infeasible configurations outright (which would create hard boundaries in the search landscape), the optimizer applies a soft exponential penalty to the raw throughput score:
where is the worst-case peak-to-capacity ratio across all devices and controls the penalty steepness. When (feasible), the penalty is 1 and the score is unchanged. For moderately infeasible configurations (1–3% overflow), the penalty is small enough that the optimizer can temporarily accept high-throughput configurations that slightly exceed memory, then refine them toward feasibility through subsequent moves. At 10% overflow, the factor is ; it decreases further for larger violations. The optimizer never returns an infeasible configuration as its final result; the penalty only guides intermediate search decisions.
- Cost-Efficiency (Throughput×Utilization) Objective: Plans that partition devices across operators may achieve high throughput but leave a fraction of devices idle between operators. For example, two plans on the same 32-GPU cluster may achieve similar throughput, but one keeps all devices busy while the other leaves 8 devices idle whenever generation is not active. To steer the optimizer toward plans that are both fast and resource-efficient, we define an optional efficiency-aware score. Let denote the total time device d spends executing vertices of , and define the mean device utilization as
Definition A.16 (Throughput Utilization Score): Given the mean device utilization of configuration C, we define the efficiency score (throughput utilization) as
where is the best raw throughput found so far during the search, is a user-specified maximum throughput loss, and penalizes plans that fall below the throughput floor.
J. Search and Optimization
The preceding sections defined a deterministic evaluation pipeline that compiles any configuration into a quantitative score. This section defines how the optimizer searches over the configuration space to maximize that score.
The search operates on two levels. An outer loop enumerates structural variants of the RPEG (staleness budgets, actor-critic sharing), while an inner loop optimizes the execution plan for each fixed RPEG using simulated annealing with multi-vertex moves and elite-seeded warm restarts. The procedure is an anytime heuristic: the best feasible configuration found so far can be returned at any point, making it practical for users who simply set a time or evaluation budget.
- Optimization Problem: Throughout this section, we fix the workload , model specifications , hardware , and evaluation horizon . The optimization variable is the configuration .
Definition A.17 (Optimization Objective): Given the scoring function from Definition A.15 (or Definition A.16), the optimizer seeks
A configuration is valid if:
(V1) Well-formedness. is well-formed (Section A-B).
(V2) Plan feasibility. For every : .
(V3) Staleness feasibility, (Section A-J2b).
(V4) Memory feasibility. The peak memory on every device fits within GPU capacity. The final returned configuration must satisfy this condition. During search, however, the hard constraint is relaxed via the soft penalty from Equation 5, which allows the optimizer to temporarily explore near the memory boundary and refine toward feasibility.
- Search Space: The configuration space is a union of structure-specific plan spaces: sharing or fusion can change the invocation set and therefore the available plan assignments. It has two conceptual components: the structural space over RPEGs and the plan space over execution plans .
a) Plan-Level Search Space: Using the nested 3D parallelization model, the plan for each vertex v must satisfy several constraints to ensure that the logical parallel structure maps cleanly onto the physical device topology. Let B be the batch size, the layer count of the model invoked at v, and the per-replica sequence count.
Parallelization degrees.
(P1) Tensor parallelism. : TP is restricted to intra-node placement, so the group size must divide the GPU count per node.
(P2) Pipeline parallelism. and is 1 or even: each stage receives an equal share of layers. Odd depths > 1 cause asymmetric packing and are excluded.
(P3) Data parallelism. and (the total GPU count). Every replica processes the same number of samples. When the pipeline fits on a single node, intra-node DP is permitted.
Microbatch count.
(P4) No pipeline, no microbatching. If , then mb=1.
(P5) Microbatch alignment. If :
The first ensures equal-sized microbatches. The second provides enough microbatches to fill the pipeline. The third maintains a minimum per-device microbatch size for SM utilization.
Device packing. Given , each node can host pipeline stages (limited by either the pipeline depth or the available GPUs after TP). A single data-parallel replica spans nodes (divisibility guaranteed by P8 below), so the operator's total allocation requires nodes.
(P6) Feasible layout. Either (all required nodes fit within a single rack) or with (the allocation spans one or more complete racks).
(P7) Aligned origin. The allocation origin is a multiple of the extent in each dimension, so allocations tile the device space without overlap.
(P8) Exact packing. , so each allocated GPU hosts exactly one logical shard of the model: .
Combining all of the above, the per-vertex plan candidate set collects every admissible combination of placement, parallelization strategy, and microbatch count:
Definition A.18 (Plan Candidate Set):
Together, these constraints guarantee a unique deterministic mapping of logical shards to physical GPUs.
b) Structure-Level Search Space: Plan-level modifications optimize intra-model parallelism and placement for a fixed RPEG. Inter-model modifications, in contrast, change the RPEG itself. The optimizer re-runs the plan-level search for each structural variant.
The base RPEG (e.g., PPO) is specified chosen by the user and fixed for a given optimization run. Within that graph, the optimizer searches over two structural dimensions: (i) whether actor and critic parameters are shared, and (ii) the staleness budgets that control asynchronous execution. A third structural transformation, response-length quantile splitting, is not represented as an explicit structural move but applied automatically during lowering whenever the optimizer places generation and inference operators on disjoint device allocations.
We represent inter-model choices by an inter-model configuration
where ac = 1 indicates that actor-critic parameter sharing is enabled and is the staleness budget.
Structural and inter-model constraints. We enforce the following constraints on y:
(S1) Applicability of AC-sharing. The actor-critic shared variant (ac = 1) may only be selected if the base RPEG contains both an actor and a critic model.
(S2) Staleness candidate set. Since is a function, the search enumerates its image componentwise: for each trainable model ,
where is a finite set of allowable budgets (typically ).
Algorithm 6: EVALUATECACHED: configuration scoring
Input: Configuration , evaluation horizon , cache.
Output: Penalized score Score_{pen}(C).
1 ;
2 if then
3 | return Cache[h];
4 end
5 ; // Alg. 3
6 ; // Alg. 4
7 ; // Alg. 5
8 Score(C) ;
9 Apply memory penalty (Equation 5) to obtain Score_{pen}(C);
10 Cache[h] ;
11 return Score_{pen}(C);
Definition A.19 (Inter-Model Candidate Set): The inter-model candidate set collects all admissible combinations of sharing flag and staleness budget:
Selecting determines the structural RPEG variant and the staleness budget, which controls how publication edges are instantiated during unrolling (Section A-F).
c) Evaluation Pipeline: Having defined what the optimizer searches over, we now describe how it scores each candidate configuration. Since local search frequently proposes configurations that have already been evaluated (e.g., a candidate that was explored in an earlier restart), results are memoized in a hash-based cache. The cache key is a canonical hash derived from the RPEG structure (vertices, edges, containers, staleness budget ) and the execution plan . The evaluation budget counts only cache misses (full pipeline executions); cache hits are free.
The algorithm first computes the raw score via the standard pipeline (unroll, lower, schedule), then applies the soft memory penalty from Equation 5.
Runtime. On a cache miss, EVALUATECACHED executes the full pipeline. The dominant step is scheduling (Section A-H1), so the total cost per evaluation is
Cache hits are (hash lookup).
d) Optimization Strategy: The inter-model candidate set is small and can be enumerated exhaustively. The combinatorial difficulty lies in the plan space: each vertex admits valid choices, and the joint plan space grows as , which is exponential in the number of RPEG vertices. Similar to ReaL [31], we associate each configuration with a cost defined by its (penalized) score and formulate the search as sampling from an energy-based distribution over configurations. We augment this approach with multi-vertex proposals, best-of- candidate selection, and elite-seeded warm restarts. We therefore adopt a two-level strategy:
-
Outer loop (structural enumeration). Enumerate all . For each structural variant, run an independent plan-level search and retain the best feasible configuration found.
-
Inner loop (plan search). For a fixed RPEG , optimize the execution plan P via multi-start simulated annealing (SA). Each iteration selects one or two RPEG vertices, proposes alternative plan assignments, and accepts or rejects the best proposal according to the Metropolis criterion. Multiple SA chains (restarts) are run per structural variant, seeded from an elite set of previously discovered plans.
The overall procedure is anytime: it maintains the best feasible configuration across all structural variants and can return it whenever a wall-clock time limit or evaluation budget is reached.
e) Score-Normalized Acceptance.: We use a stochastic acceptance rule to balance exploration and exploitation. Given the current configuration with penalized score and a proposed configuration with score , define the relative score change
The proposal is accepted with probability
The temperature controls exploration: improving proposals are always accepted, while worsening proposals may also be accepted. Normalization by S makes the acceptance rule largely independent of the absolute score scale. This is a stochastic search heuristic rather than exact sampling from a prescribed target distribution.
Since Score(C) is a product of a positive throughput and a positive penalty factor, always holds. The normalization by makes the acceptance threshold scale-invariant: the same temperature produces comparable acceptance rates regardless of the absolute score magnitude. This differs from the standard Metropolis ratio , which would require re-tuning for every workload.
Improving proposals are always accepted. Crucially, worsening proposals are accepted with non-zero probability, which allows the chain to escape local optima by temporarily traversing lower-scoring regions of the landscape. This is the central advantage over greedy search: a purely greedy optimizer can become permanently trapped in a suboptimal basin, whereas the stochastic acceptance mechanism provides a principled way to trade short-term score regression for long-term exploration. As detailed in Section A-J2g, t is held constant throughout each chain rather than decreased as in classical SA. The exploration-exploitation tradeoff is instead controlled through the multi-start mechanism described in Section A-J2h.
f) Move Proposals: Evaluating a full configuration through the pipeline is expensive relative to enumerating valid strategy tuples. To avoid wasting evaluations on invalid or obviously poor candidates, the optimizer pre-computes a candidate directory for each RPEG vertex before the SA search begins. The directory contains all valid strategy tuples satisfying constraints P1–P8, filtered by per-vertex memory feasibility (strategies that exceed GPU capacity even in isolation are excluded; the soft penalty from Equation 5 handles joint infeasibility across co-resident operators during search) and sorted by estimated execution time. Candidates are sampled uniformly from the full directory.
Each SA iteration proposes up to neighbor configurations by modifying the plan of one or two RPEG vertices while keeping fixed. The proposal mechanism uses two move kernels.
Single-vertex kernel. A target vertex is selected with a bias toward scheduling bottlenecks: with probability 0.6, the vertex is sampled proportionally to its execution time on the critical path (the longest path through the current schedule). Otherwise it is chosen uniformly at random. For the selected vertex, candidate strategies are sampled uniformly from the directory and each is paired with a randomly chosen aligned device origin.
Donor-receiver pair kernel. Single-vertex moves cannot redistribute devices between operators in a single step: shrinking one vertex's allocation without simultaneously expanding another leaves devices idle. To address this, a donor-receiver kernel proposes coordinated two-vertex moves. A donor is selected with probability proportional to its device count, and a receiver is chosen among vertices whose allocation overlaps with the donor's. The donor is shrunk to a smaller contiguous region, and the receiver is re-sampled to potentially expand into the freed devices. For example, if generation occupies two full racks while inference is constrained to a single node, a pair move can transfer one rack from generation to inference in one step. No sequence of single-vertex moves can reach this configuration without passing through intermediate states where devices are left unassigned. The pair kernel is selected with probability .
Best-of- selection. All proposals are evaluated via EVALUATECACHED (Section A-J2c), with cache misses dispatched to a thread pool for parallel evaluation. Only the highest-scoring proposal is subjected to the acceptance step (Equation 9). This best-of- strategy amortizes evaluation cost across multiple local directions before committing to a single chain update.
g) Temperature and Chain Termination: Unlike classical simulated annealing, which decreases over the course of a single run, our optimizer holds constant within each chain. The first chain runs at ; warm-restarted chains run at , which allows broader exploration around the elite seed. The higher restart temperature is safe because the chain starts from a known-good plan rather than an arbitrary initial point. The exploration-exploitation tradeoff is therefore managed across chains (via the two temperature levels and the multi-start mechanism in Section A-J2h) rather than within a single chain. The implementation also supports geometric cooling () as an alternative; our ablation finds that it degrades throughput by 1–5% compared to constant temperature.
Chains are not run for a fixed number of iterations. Instead, the optimizer monitors consecutive rejections: if proposals are rejected in a row, the chain is terminated and a new restart begins. This ensures that productive chains continue while stuck chains are recycled quickly.
h) Restarts and Elite Seeding: Random restarts are a standard technique to escape local optima in SA, but they waste budget rediscovering plans that earlier chains already found. We instead use warm restarts: the first chain (r = 0) is seeded from a concurrent baseline heuristic that groups operators into concurrent groups – sets of operators with no data dependencies that can run in parallel – and partitions the device space so that each operator within a group receives a disjoint allocation, selecting the partition that minimizes the estimated step time. All subsequent chains begin from the best feasible plan discovered so far (the elite seed) and run at , allowing broader exploration around the known-good starting point. The optimizer maintains an elite set of the top- feasible plans per vertex set, shared across staleness variants that share the same vertices (since a good plan under one is a structurally sound seed for another).
i) Outer Loop and Budget: The outer loop iterates over all inter-model candidates . Termination is governed by either a wall-clock time limit or an evaluation budget (cache misses), whichever is reached first. In time-limited mode, the remaining wall-clock time is split evenly among the remaining structural variants; in budget-limited mode, each variant receives a fixed budget . The candidate directory (Section A-J2f) is rebuilt only when the vertex set changes (e.g., when transitioning from the base RPEG to the AC-shared variant); staleness variants that share the same vertices reuse the same directory.
The best feasible configuration is maintained across all structural variants. In practice, a 10-minute time budget suffices for workloads up to 1024 GPUs, producing 75K–220K evaluations depending on cluster and model size. After the SA search completes, a deterministic polish phase (Section A-J2j) performs greedy coordinate descent to extract any remaining local improvements. Algorithm 7 gives the complete procedure.
j) Polish Phase: The SA search is stochastic: even when the chain has converged near a good basin, it may not have evaluated every neighbor of the final plan. The polish phase addresses this by performing deterministic greedy coordinate descent [54] on the best plan returned by OPTIMIZE. It visits each RPEG vertex in a fixed order and, for each vertex, evaluates all feasible strategies in the candidate directory. If any strategy strictly improves the score, the best one is applied before moving to the next vertex. This process repeats in passes over all vertices until a full pass yields no improvement.
Two properties make the polish phase efficient. First, isolated local operator costs can be reused across identical strategy/extent choices on homogeneous hardware. Second, many candidates will already reside in the evaluation cache from the preceding SA search, so the polish phase primarily
Algorithm 7: OPTIMIZE: multi-start SA with structural enumeration
Input: Baseline , candidates , time limit or budgets , temperature , stagnation window , proposal count .
Output: Best feasible configuration .
1 foreach do 2 for each restart until budget exhausted do 3 Seed from baseline or elite plan ; 4 repeat 5 Propose neighbors (single-vertex or pair kernel); 5 // Section A-J2f 6 Evaluate proposals via EVALUATECACHED ; 7 // Alg. 6 8 among proposals; 8 Accept with prob. ; 9 // Eq. 9 9 Update elite set and global best ; 10 until consecutive rejections or budget exhausted; 11 end 12 end 13 ; 14 return ;
/* Section A-J2j */
performs hash lookups rather than full pipeline evaluations. Cache misses are dispatched to the thread pool in parallel, as in the SA inner loop.
The polish phase is guaranteed to terminate (the score increases strictly at each accepted move, and the candidate set is finite) and is deterministic (no random choices). It cannot discover plans that require coordinated multi-vertex changes, but it reliably extracts any single-vertex improvements that the stochastic search may have missed.
APPENDIX B
EVALUATION: SUPPLEMENTARY DETAILS
This appendix specifies different evaluation configurations.
Platforms. GH200 execution and hardware calibration use Clariden at CSCS, with four NVIDIA GH200 superchips per node (each with a 72-core Grace CPU and 120GB HBM3), intra-node NVLink connectivity (≈160 GB/s per GPU pair), and four HPE Slingshot-11 interfaces per node. The runtime uses persistent PyTorch/Megatron workers launched through Slurm, NCCL over OFI/libfabric/CXI for GPU collectives and weight transfers, and Gloo for semantic data. The A100 experiments use Athena at AGH Cyfronet, with dual 64-core AMD EPYC 7742X CPUs, 1 TB RAM, and eight NVIDIA A100 40-GB GPUs per node, interconnected via NVLink/N-VSwitch and four 200-Gb/s HDR InfiniBand interfaces. The A100 comparison with ReaL uses a ReaL-derived runtime (Python 3.10, CUDA 12.1; one worker per GPU) and matched synchronous PPO workloads, without response-length splitting or bounded asynchrony. Analytical optimizer searches run on Piora CPU nodes at CSCS, each with dual 64-core AMD EPYC 7773X processors and 1 TB RAM, using six CPU cores per concurrent search task.
Workload hyperparameters. We use one PPO epoch, actor/critic learning rates , zero weight decay, gradient clipping at 1.0, PPO clip 0.2, , GAE , and KL coefficient 0.01.
Analytical model validation. The 123 configurations comprise 34 generation, 51 inference, and 38 training cases. These cases span 3B, 7B, and 13B models, 1–128 GPUs, batch sizes of 32–2048, and 25 DP/PP/TP strategies. Measurements use BF16, FlashAttention-2, , , and one rollout per prompt; training uses activation checkpointing and ZeRO-2 for . The memory comparison accounts for checkpointing and ZeRO-2 profiling conventions; traces recorded before Adam-state materialization are excluded.
Predicted-schedule configurations. Schedules unroll steps with one-step bounded staleness and three response-length phases: completion fractions (0.50, 0.85, 1.0) at lengths . The throughput-utilization objective uses . Three scaling sweeps cover actor-only, critic/reward, and joint model growth. The first two use 8/16/32/64 GPUs: the scaled models grow as 7/13/34/70B, while unscaled models remain at 7B. The joint sweep uses 16/32/64/128 GPUs, with actor and critic sizes 7/13/34/70B and reward sizes 7/7/13/13B. Each configuration is evaluated at , yielding 36 analytical cases. The strong-scaling study fixes 13B models and the workload specified in the main evaluation.
Optimizer stability. Table X specifies five modeled configurations used in the 200-seed stability study. Each CPU-side analytical search runs for 600 seconds; its throughput is the number of evaluated plans, not the number of physical training runs. A separate convergence study evaluates 7B/256, 13B/512, 34B/1024, and 70B/2048 model/GPU configurations over 3,600 seconds, tracking the best predicted makespan relative to the initial plan.
Ablations. Each experiment disables one mechanism, with five seeds per scenario. The 50GB HBM limit in MEM-
TABLE X: Optimizer-stability workloads. A/C/R denotes actor/critic/reward model size (billions of parameters); topology denotes racks nodes/rack GPUs/node.
| GPUs | Topology | A/C/R (B) | B | Evals/600 s | |
|---|---|---|---|---|---|
| 64 | 2×8×4 | 13/13/7 | 1024 | 128/384 | ~220K |
| 128 | 2×16×4 | 34/13/13 | 1024 | 128/384 | ~200K |
| 256 | 4×16×4 | 70/34/13 | 1024 | 128/384 | ~160K |
| 512 | 8×16×4 | 70/70/34 | 2048 | 128/384 | ~105K |
| 1024 | 16×16×4 | 175/70/34 | 2048 | 128/384 | ~75K |
TIGHT is imposed analytically to evaluate memory-constrained planning. Table XI identifies the four workloads; results are reported in Table IV.
TABLE XI: Analytical ablation workloads. A/C/R denotes actor/critic/reward model size (billions of parameters); topology denotes racks nodes/rack GPUs/node.
| Scenario | GPUs | Topology | HBM/GPU | A/C/R (B) | B; |
|---|---|---|---|---|---|
| MEM-TIGHT | 16 | 1×4×4 | 50 GB | 13/13/13 | 128;128/896 |
| WIDE | 128 | 1×32×4 | 102 GB | 7/7/7 | 1024;128/384 |
| HETERO | 32 | 1×8×4 | 102 GB | 34/7/7 | 512;128/128 |
| DEEP | 64 | 2×8×4 | 102 GB | 7/70/70 | 512;128/128 |
A1 disables response-length splitting; A2 disables bounded asynchrony; A3 fixes microbatch counts to for generation/inference and for training; A4 removes coordinated donor–receiver moves; A5 disables warm restarts; A6 uses uniform rather than critical-path invocation selection; A7 removes final polishing; A8 replaces soft memory penalties with hard rejection; and A9 uses geometric cooling instead of constant-temperature chains.
APPENDIX C
ANALYTICAL PERFORMANCE AND MEMORY MODEL: ADDITIONAL DETAILS
This appendix complements Section V with the assumptions, calibration procedure, and implementation choices behind the analytical performance model. We follow the same order as the main paper: model configuration and communication, intra-model execution time, inter-model communication, and device-level memory feasibility. The role-specific work-depth-memory foundations are given in [17]. The RPEG-specific execution-time, communication, and physical device-memory equations are derived in Appendix D; we do not duplicate them here. The analytical model assigns node times and checks memory feasibility MemFeasible(C) to rank execution plans, not to prescribe physical start times.
A. Model Configuration and Calibration
- Inputs and Modeling Assumptions: The analytical model receives three groups of inputs. The workload specifies input prompts per step, rollouts per prompt, average prompt length, and average rollout length. Each invoked model supplies its transformer architecture, model role, and working scalar precision . The hardware description supplies the hierarchical device topology, GPU memory capacity, and calibrated compute and communication parameters. The candidate execution plan assigns each invocation its GPU allocation , DP/PP/TP degrees , and microbatch count .
We use mixed-precision BF16 computation, FP32 Adam master weights and moment arrays, activation checkpointing, and ZeRO-2 sharding for optimizer state and reduced gradients. The estimator targets GPU-resident training rather than CPU offloading. These choices determine both the HBM accounting and the communication primitives costed within a training invocation. Parameter formulas retain the dominant attention projections, FFN weights, embeddings, and task heads; small bias and normalization parameters are omitted in the baseline.
The nominal hardware topology is given as . Device placements are mapped to physical nodes and racks, rather than assuming a flat, uniform interconnect. The time model distinguishes three communication tiers: intra-node, inter-node within a rack, and inter-rack. When a transfer spans more than one tier, it uses the slowest applicable tier as a conservative proxy. For tensor parallelism, the legal plan space constrains each TP group to one node.
These assumptions are specific to the evaluated modeling implementation; they are not architectural requirements of RPEG. In particular, architectures with grouped-query attention, gated FFNs, vocabulary-sharded heads, or nonstandard pipeline partitions require architecture- and layout-specific dimensions in the cited work terms and our physical residency estimator (Appendix D-H).
- Automated Hardware Calibration: Rather than substituting advertised GPU FLOP/s or network line rates, RPEG measures effective parameters with an automated suite on the target system. Its calibration campaign, typically on the order of minutes, comprises the following measurements: NCCL AllReduce message-size sweeps; NCCL send/receive sweeps; actual transformer-forward timing; contiguous HBM transfers; GEMM-shape sweeps; and non-GEMM layer timings at a reference batch size. The resulting configuration is stored in a hardware-parameter file and supplied to the optimizer together with the workload, model specifications, and available devices.
The measured quantities have distinct meanings. Transformer-forward benchmarks provide an effective compute ceiling , while memory-copy tests provide an effective BW_{mem}. Shape sweeps fit the saturation constants and ; non-GEMM measurements fit at the reference batch size . Communication measurements fit separate pairs for collective and P2P transfers at each hardware tier; is latency and is inverse effective bandwidth, not bandwidth itself.
The AllReduce benchmark calibrates a collective-family proxy used by the ring-style expressions for AllReduce, ReduceScatter, and AllGather. NCCL may select different algorithms as message sizes, rank counts, and network topology change, so a fitted pair should be understood as an empirical approximation over the measured range. Similarly, P2P and collective parameters are not interchangeable: a high aggregate collective bandwidth does not imply equivalent point-to-point transfer performance.
Note that the model can evaluate new plans cheaply, but its parameters need not transfer accurately across different kernel implementations, model architectures, message-size regimes, or cold versus warmed process states.
- Hierarchical Communication Model: Communication appears in two places: the intra-operator term for TP, PP, and DP transfers embedded in OP nodes, and the explicit transfer costs and for COMM/RESHARD nodes inserted by lowering. Both use the model and the primitive estimates in Table II of the main paper. For those estimates, M is the per-GPU input buffer for AllReduce and ReduceScatter, the final gathered buffer for AllGather, the aggregate per-GPU exchange size for AlltoAll, and the transferred P2P payload. Collective costs vanish when the participant count is one.
The table uses ring-based reduction/gather expressions and a pairwise-exchange upper-bound estimate for AlltoAll. The all-to-all formula counts as an aggregate bandwidth term, including any locally retained share; a perfectly balanced pairwise exchange instead sends remote bytes when M includes the self-share. This and tier selection make the model a cost proxy rather than a packet-exact simulation of the network. Per-message control overhead, dynamic communicator setup, and transport-specific tensor packing are outside this simple expression.
B. Intra-Model Runtime Details
- Operator Work and Effective Throughput: For every OP node v, the five-term operator-time model in Section V-B separates GEMM compute , pipeline bubbles , intra-operator communication , non-GEMM overhead , and Adam update traffic . The role-specific FLOP expressions for generation, teacher-forced inference, and training are adopted from [17]. They distinguish policy, reference, value, reward, and shared-model heads.
The sum defining is an additive prediction. Actual computation, collectives, and pipeline transfers can partially overlap, so it is not an exact critical-path reconstruction of the kernels executed inside a model invocation.
The roofline-limited GEMM throughput depends on the GEMM-shape efficiency and arithmetic intensity , not just nominal work . In particular, increasing reduces the local batch, while increasing narrows local projection matrices. Either can lower achieved per-GPU GEMM throughput enough to offset the benefit of additional devices.
Arithmetic intensity uses estimated HBM bytes read/written per microbatch , whereas peak(d) measures simultaneous GPU-memory occupancy: a resident tensor can be accessed repeatedly. For training, uses forward-equivalent FLOPs and byte traffic for forward, recomputation, and backward. Generation uses separate effective throughputs and in because the two phases have different memory-access patterns. In particular, decode repeatedly loads or accesses parameters and historical KV state while producing relatively little new arithmetic work. The evaluated estimator uses representative lengths rather than tracking time-varying active-sequence counts or per-rank KV-head layouts during decoding.
- Pipeline Bubbles and Intra-Operator Transfers: The 1F1B bubble multiplier applied to models fill and drain under balanced execution. It decreases as the microbatch count grows but ignores unbalanced stage durations and communication contention. The search therefore optimizes microbatch count jointly with the parallel degrees and placement , rather than fixing it solely from . A larger number of microbatches can reduce bubbles while increasing latency-sensitive collective calls.
Tensor-parallel AllReduce contributes to by aggregating partial layer results; TP groups are restricted to one node because the repeated per-layer reductions favor low-latency, high-bandwidth local links. Pipeline P2P operations move activations between consecutive stages and contribute to according to the boundaries crossed by the selected placement. Data-parallel ReduceScatter aggregates and partitions gradients for ZeRO-2, while the associated AllGather restores the updated parameter view across replicas; both contribute to . The latter is a parameter-publication cost and need not be adjacent to gradient reduction in the actual training schedule.
Table XII records the primitive counts used by the simplified estimator. TP assumes two AllReduces per transformer layer and forward pass (attention and FFN), or three forward-equivalent passes for training. PP counts approximate critical-path fill/drain steps: for inference and for 1F1B
training. ZeRO-2 contributes one gradient ReduceScatter and one updated-weight AllGather per update (Appendix D-D). Generation TP is split into prompt prefill and decode; the decode count assumes that the full local DP batch is processed together. A decoder that independently pipelines distinct microbatches needs the corresponding alternate count, as explained in Appendix D-D.
The pipeline-transfer byte count presumes TP-sharded stage-boundary activations; frameworks that send replicated hidden states need a different transfer volume. All PP costs vanish for , and TP/DP collectives vanish for a single participating TP/DP rank.
- Non-GEMM Kernels and Optimizer Updates: The GEMM work formulas define using dominant matrix multiplications and exclude normalization, residual operations, nonlinearities, positional operations, and other non-GEMM kernels, whose residual latency is represented by rather than added to the GEMM FLOP count. At , the full-transformer-calibrated compute ceiling already absorbs part of this overhead. The separate calibrated non-GEMM term therefore adds only a residual correction as tensor parallelism increases. Its batch scaling and four-pass-equivalent training multiplier are heuristics; launch latency or fused-kernel behavior can depend on microbatch count and sequence length in ways not captured by one constant. The baseline sets , which is an approximation rather than an assertion that prefill and decode contain no such operations.
The bandwidth-bound Adam estimate is . Here approximates the optimizer-owned parameters per GPU, and 18 bytes/parameter is an effective coefficient, not the physical read/write total: an uncached update requires 24 bytes for FP32 master/moment reads and writes, 2 for the BF16 gradient read, and 2 for the BF16 weight write (28 bytes per parameter). Replicated boundary embeddings or heads can make the worst-stage count larger (Appendix D-F).
C. Inter-Model Communication and Resharding Details
A COMM node has predicted time for container a between allocations . The estimator divides its payload by the assumed number of concurrent P2P pairs and applies the communication tier's . This assumes balanced transfers and ideal overlap among those pairs.
A RESHARD node redistributes parameters when the same model is invoked with incompatible parallel layouts on an identical GPU allocation. The analytical proxy treats the transformation as a symmetric all-to-all over that allocation. Actual depends on the layout and backend: multiple collectives, nonuniform slices, or host-mediated copies can be much slower than this idealized NCCL all-to-all, even at equal payload.
These costs are especially important for bounded asynchronous and training/serving handoffs. The runtime may hold two parameter versions, reserve both source and
TABLE XII: Simplified intra-operator communication costs per GPU. Here for teacher-forced inference/training; prefill has . PP counts approximate critical-path steps. The generation decode row assumes one decode step over the full local DP batch. All payloads are per participating GPU.
| Role | Parallelism | Primitive | Count | Message bytes |
|---|---|---|---|---|
| Generation prefill | TP | AllReduce | ||
| Generation decode | TP | AllReduce | ||
| Inference | TP | AllReduce | ||
| Training | TP | AllReduce | ||
| Inference | PP | P2P | ||
| Training | PP | P2P | ||
| Training | DP | ReduceScatter + AllGather | One each |
destination worker allocations, and require redistribution before an invocation can begin. Their exact physical constraints must be checked during lowering and execution; the analytical model supplies a plan-ranking approximation, not a guarantee that a transfer follows its idealized route. The formula-level details appear in Appendix D-G.
D. Memory Model Details
- Parameter Shards and Persistent State: The memory model distinguishes the logical model parameter count from the worst-stage per-GPU parameter count . Transformer layers are partitioned across pipeline stages and tensor-parallel ranks, whereas boundary embeddings and task heads may remain replicated in the simplified layout. The worst-stage parameter shard is therefore not obtained by dividing the model's total parameter count uniformly by all GPUs. Tied input/output embeddings may share storage when both are on one stage; separate boundary stages can retain physically separate copies of one logically tied matrix. The full stage-level count is derived in Appendix D-H.
For a training device, the persistent analytical footprint comprises ZeRO-2-sharded FP32 master weights and Adam moments. BF16 working weights are counted when materialized, along with any live gradient buffers. A frozen-model or disjoint asynchronous serving device keeps the appropriate BF16 parameter shard persistently. A synchronous serving allocation that only receives parameters transiently does not, under the simplified lifetime policy, retain a separate full persistent copy between invocations.
Distinct models colocated on one GPU contribute their persistent footprints additively. For a shared actor-critic backbone, shared parameters must be counted once, with separate policy/value heads added according to their actual residence. For partial overlap or multiple versions of one model, residence and copy lifetimes must be determined by exact allocations and version dependencies, not by the number of logical invocation vertices alone.
- Transient Activations, Gradients, and KV Cache: Training activation memory depends on up to live pipeline microbatches, sequence length , activation-checkpoint interval , and intermediate tensor widths. The square-root checkpoint interval is a practical heuristic rather than the exact optimum for arbitrary activation-buffer coefficients. The baseline activation expression conservatively reserves a recomputation buffer for each live warm-up microbatch; a tighter expression is also
derived in Appendix D-I, but was not substituted into the reported baseline calculations.
Teacher-forced inference retains only local forward intermediates , whereas autoregressive generation additionally retains a KV cache whose peak scales with the number of active sequences, their admitted context lengths, and the physical KV-head width on each GPU. Average lengths alone need not bound worst-case cache residence. In grouped-query attention, KV storage cannot generally be estimated by dividing the full hidden width by tensor-parallel degree: ranks may own different numbers of KV heads, including replicated groups. The role-specific head also matters for transient buffers: a critic or reward scalar head does not generally require a vocabulary-wide output allocation.
The transient footprint additionally contains materialized BF16 weights, live gradients and buckets, transfer/re-sharding workspaces, and kernel scratch buffers when they are not already classified as persistent. Double counting must be avoided when BF16 serving weights are already resident. The simple activation/KV expressions are only components of the complete transient bound, not its entirety.
- Co-Residency and Device Feasibility: As described in Section V-D3, the analytical device peak peak() adds all co-resident persistent model state and the largest transient allocation assigned to GPU . The maximum is appropriate when operations assigned to one GPU execute exclusively and their transient buffers have the assumed lifetime. When several worker processes persist on one GPU, allocator reservations, retained model versions, and transfer buffers can overlap beyond that bound.
The device-feasibility predicate MemFeasible() checks every GPU against , with a calibrated safety fraction for fragmentation and other runtime overheads. The nominal 10% reserve used in the analytical setup is a modeling parameter, not a universal physical guarantee; actual allocated and reserved HBM and the effective per-run capacity govern runtime admission. Search may assign a soft penalty to memory-violating proposals, but only feasible final plans are selected for execution.
The five placement cases in Figure 3 of the main paper illustrate the distinction: synchronous disjoint serving uses transient weights; asynchronous disjoint serving maintains shadow copies; partial overlaps mix the two; and fully colocated execution may require layout resharding. The equations for , , per-device peaks, and the memory-feasibility predicate are given in Appendix D-J.
APPENDIX D ANALYTICAL DERIVATIONS
This appendix gives the RPEG-specific performance-model derivations omitted from Section V. We reuse the work–depth-memory foundations of [17] instead of repeating that paper's per-role FLOP and logical-storage derivations. Our focus is the calibrated execution-time estimator and its physical per-GPU memory accounting. We denote node runtime by . For an operator node v, let
and be the invoked model. The model architecture is
where is the number of transformer layers, is the hidden dimension, is the FFN dimension, is the vocabulary size, and is the attention head dimension. The runtime tensor precision uses bytes per scalar. We use B prompts per step, R rollouts per prompt, and representative average prompt and rollout lengths and .
A. Operator-Node Runtime
For an operator node , the runtime model decomposes execution time into five terms:
The terms capture GEMM compute, pipeline bubbles, intra-operator communication, non-GEMM overheads, and optimizer traffic, respectively. The decomposition is necessary because a single peak-throughput estimate
does not capture small-batch GEMM under-utilization, non-GEMM operations that do not shrink with tensor parallelism, or memory-bandwidth-bound optimizer traffic.
a) GEMM time.: Under 3D parallelism, the total GEMM work is distributed over the P devices. Assuming balanced work across the 3D mesh, the raw GEMM time is
where is the achieved per-device throughput. We model it by a roofline-style bound corrected for calibrated GEMM utilization:
Here, is workload-effective peak throughput, is HBM bandwidth, is arithmetic intensity, and is GEMM utilization.
b) Arithmetic intensity.: For inference and training operators processing sequences of length
the per-device arithmetic intensity is
where is per-device work for one microbatch. For inference, ; for training, , representing one forward-equivalent pass. The HBM-traffic terms and count weight and activation bytes, respectively, per device and microbatch:
with local microbatch size .
The factor four above converts training FLOPs to a single forward-equivalent pass. assumes one weight read, and one activation read and write per local layer. For generation, prefill uses and decode uses per token.
c) GEMM utilization and generation.: The calibrated GEMM utilization is
The first factor captures under-utilization from small row dimension ; the second captures under-utilization from tensor-parallel narrowing of the hidden or FFN dimension. The constants are obtained from calibration.
For generation, we evaluate the two phases separately:
B. Role-Specific Work Terms
The work–depth–memory analysis of generation, inference, and training (including the actor, reference, value, reward, and shared-model heads) is already derived in [17]; we do not reproduce it here. We use the corresponding leading-order role-specific FLOP terms , , and to define for each executable invocation, expressed in the workload notation . The following sections instead derive the RPEG-specific translation of this work into predicted GPU time, communication costs, and physical memory feasibility.
C. Pipeline Bubble
When , the pipeline stages process mb microbatches. Under a 1F1B schedule, the fill/drain bubble contributes idle slots out of total slots. Equivalently, the combined GEMM and bubble time is
When , the factor is one and .
D. Intra-Operator Communication
The intra-operator communication term is
The three terms correspond to tensor-parallel AllReduce, pipeline-parallel point-to-point activation transfer, and data-parallel gradient synchronization. For generation and inference, .
a) Tensor-parallel AllReduce: Each transformer layer requires two tensor-parallel AllReduces per forward pass: one after the attention block and one after the FFN block. For inference over length ,
For training, the simplified forward/recompute/backward count uses three forward-equivalent phases, giving collectives per microbatch:
For generation, prefill and decode are evaluated separately:
The above decode term represents one batched decode step over all local DP sequences, while prefill is microbatched. If decode is also executed as mb distinct microbatches, consistency instead requires
The appropriate expression depends on the implementation's decode batching; the two must not be combined.
b) Pipeline-parallel P2P: Pipeline stages exchange TP-sharded activations. Let
be the per-microbatch activation message size at sequence length . The division by assumes that the communicated hidden tensor is physically TP-sharded. Replicated-output pipeline layouts require the corresponding actual message size. A pipeline with stages has stage boundaries. Let and be the number of intra-node and inter-node boundaries, respectively, with
Under nested placement, if a node contains GPUs and each TP group has size , then approximately pipeline stages fit per node, so
For inference,
For training under 1F1B, the number of pipeline communication steps is :
When , we set .
c) Data-parallel synchronization: For training operators, the simplified ZeRO-2 communication estimate comprises a ReduceScatter and an AllGather. More precisely, ReduceScatter aggregates/partitions the gradients; AllGather communicates the subsequently updated parameter partitions so that data-parallel replicas agree. These collectives can occur at different phases and need not form an adjacent back-to-back pair. Let be the total number of scalar parameters of model m. The BF16 shard size per DP group is
Thus,
The collective tier is selected from the full data-parallel allocation. The common payload treats parameters as uniformly PP/TP-sharded. Replicated boundary embeddings or heads and mixed-precision gradient buckets require the appropriate stage-specific byte count in a layout-exact implementation.
E. Non-GEMM Overhead
The work terms count matrix multiplication FLOPs. Transformer layers also execute normalization, residual additions, positional embeddings, FlashAttention score computation, and activation functions. These operations have low arithmetic intensity and are therefore assumed to be memory-bandwidth-bound.
At , their cost is assumed to be absorbed into the calibrated , because calibration uses full transformer operations. At , GEMM work shrinks with tensor parallelism, whereas some non-GEMM operations, especially normalization and residual additions, do not shrink proportionally. We model the residual TP-invariant overhead with a calibrated per-layer constant :
where is the per-device batch size used when calibrating . The expression assumes that the fitted has the same aggregation scope as this operator-level correction. For training, we multiply this term by 4, corresponding to forward, recompute, and backward phases. For generation, we set
because decode processes one token per step and its runtime is assumed to be dominated by weight and KV-cache traffic.
F. Optimizer Step
For training, we approximate the bandwidth-bound Adam update using an effective traffic coefficient of 18 bytes per parameter:
where is the average logical number of parameters per device. For generation and inference operators,
G. Explicit Communication and Reshard Nodes
The executable DAG also contains explicit COMM and RESHARD nodes.
a) Comm nodes: A COMM node is inserted when the source and destination operators are placed on different allocations. If container a has element count and element size , the byte volume is . Since concurrent send/recv pairs are limited by the side with fewer devices, the transfer time is
where are selected at the communication tier spanned by and . This is a balanced, fully parallel transfer approximation. It omits per-pair setup, serialization, packing/repartitioning, and asymmetric source/destination routes; the physical controller may also reserve both endpoint allocations while the analytical scheduler is more optimistic.
b) Reshard nodes: A RESHARD node is inserted when two consecutive invocations of the same model use the same allocation but incompatible parallel layouts. All devices in the allocation participate symmetrically in the layout transformation. We model this as an all-to-all:
where is the full parameter size of model m in Bytes, and is the all-to-all cost for per-GPU message size M over p GPUs.
H. Parameter Accounting and
We now derive , the per-GPU parameter footprint of operator v on its worst pipeline stage. The memory model counts dominant weight matrices: attention projections, FFN projections, embeddings, and task heads. Biases and normalization parameters are omitted.
The logical parameter counts of the policy, reference, critic, reward, and shared actor-critic are derived in [17]. Here we require only the dominant per-layer count to determine physical residency on a particular pipeline stage and GPU:
This leading-order expression assumes standard attention and a two-projection FFN. The remaining calculation is placement-specific: pipeline stages hold different layers and boundary embeddings/heads, which is not captured by a logical per-model parameter total.
Under pipeline parallelism, transformer layers are split across stages, so each stage receives layers (assuming ). However, embeddings and task heads are pinned to boundary stages rather than spread uniformly. Let
be the embedding matrix size. Define two indicators:
Then the non-layer resident component on pipeline stage is
The transformer-layer component on stage p is
Tensor parallelism shards transformer-layer weights across ranks, but embeddings and heads are replicated on each tensor-parallel rank. Hence the per-GPU resident parameter footprint on stage p is
The worst pipeline stage determines the per-GPU parameter footprint:
Equivalently,
If tied input/output embeddings are physically shared on the same pipeline stage, the duplicate embedding term can be stored once. The formula above is the conservative resident-footprint model used for boundary-stage memory pressure.
From , the model-state components follow:
for one BF16 weight copy, for ZeRO-2-sharded FP32 Adam state, and for ZeRO-2-sharded BF16 gradients.
I. Transient Memory
Transient memory is allocated when an operator starts and released when it finishes. We denote the transient peak of operator v by . Let
be the per-device microbatch size.
a) Training activations: Training retains activations for the backward pass. With activation checkpointing, only every c-th layer output is retained, and the missing activations are recomputed during backward. We use
The checkpoint memory stores
hidden states of width . The recomputation buffer must hold the largest single-layer intermediate. We approximate the per-token peak by
Under a 1F1B schedule, the warmup retains activations for microbatches. Thus
The displayed expression conservatively reserves both the checkpoint and recomputation-buffer contributions for up to live microbatches.
b) Inference activations: For inference and generation, only one layer's intermediates are live at a time. The peak is the maximum of the attention intermediate, FFN intermediate, and LM-head intermediate: The baseline uses the LM-head width as a conservative upper bound. For critic/reward-only scalar heads, a role-specific estimator can replace with .
where for teacher-forced inference over the full prompt-response sequence and for generation prefill.
c) KV cache for generation: Autoregressive generation maintains a key-value cache. At the last decode step, the cache covers a representative tokens. Each layer stores one key and one value vector per token, sharded across pipeline and tensor parallelism:
The factor accounts for both key and value caches.
This expression assumes ordinary multi-head attention and an evenly sharded KV dimension. With grouped-query attention, the physical per-TP-rank KV width replaces , giving
Replicated KV groups must be counted as replicated rather than divided again by .
Training additionally includes transient BF16 weights and sharded gradients. Overall, we have:
J. Co-Residency-Aware Device Peaks
The formulas above describe memory for an isolated operator. RLM training pipelines colocate multiple models and roles on the same physical devices, so memory feasibility must account for persistent state that remains resident across the schedule and transient state that appears only during operator execution.
For a model on device , define as the persistent footprint, excluding transient activations and KV cache: For a device holding neither training, shadow, nor frozen state for model , set . A training device stores the modeled sharded master/moment arrays; any BF16 copy not persistently retained must appear in the transient term.
Here, denotes the per-GPU resident parameter shard of model m on device d, derived from the corresponding operator-level .
A training device stores persistent FP32 Adam state; BF16 weights are materialized from the FP32 master weights on demand and released afterward. A shadow device stores a persistent BF16 copy for asynchronous generation or inference. A frozen device stores persistent BF16 weights for a non-trainable model such as the reference or reward model.
The per-device peak memory is persistent co-resident state plus the worst transient operator mapped to that device:
A configuration is memory-feasible iff
where
reserves a safety margin for runtime overhead and fragmentation.