A Pipeline-Parallel System for Depth-Recurrent Models

Media reports Hugging Face Papers Source language: Chinese

This paper presents Loop-PP, the first pipeline-parallel training system for depth-recurrent models, reducing peak memory by up to 32.8% and improving throughput by…

Full text

A Pipeline-Parallel System for Depth-Recurrent Models

Yunjia Xi1 Jiarui Qin1 Di Yin1†1\dagger Xing Sun1 Affiliation: 1Tencent Youtu Lab

Abstract

Depth-recurrent (Looped) models raise effective depth by applying a shared stack of blocks several times. Scaling them usually requires pipeline parallelism, but commonly used interleaved 1F1B is drawn for an acyclic stage graph in which each micro-batch enters each stage once. Once that stack is split across stages, the same stage is visited several times on one micro-batch and later stages feed earlier ones: native 1F1B has no slot for the extra visit, cannot rank a first iteration against a second, and its neighbour-only send/receive order has no back edge to the first stage, so the arrangement stalls or fires out of order. We present Loop-PP, which rebuilds both the timetable and the communication for this cyclic layout. It schedules different iterations of the same stage separately, specializes a 1F1B skeleton into a globally consistent order over those visits, and emits a static instruction stream per rank that separates posting from waiting so communication overlaps local compute. Loop-PP is bit-identical to a single-stage reference. On 8B-60B MoE models, it lowers peak memory by as much as 32.8%, and with compute budget fixed, the best observed throughput rises by 12.7%.

††footnotetext: †\dagger Corresponding author.

1 Introduction

Recent advances in large language models (LLMs) have been driven primarily by scaling model parameters (Kaplan et al., 2020; Brown et al., 2020), data (Hoffmann et al., 2022), and test-time computation (Snell et al., 2024). Looped Transformers or depth-recurrent Transformers offer a different path by recursively applying the same blocks, increasing effective model depth and capacity without adding parameters (Dehghani et al., 2019; Lan et al., 2020; Geiping et al., 2025; Zhu et al., 2025). Recent studies have shown that such models hold promise for reasoning, in-context learning, and test-time scaling (Saunshi et al., 2025; Yang et al., 2024; Alabdulmohsin and Zhai, 2025).

Existing work, however, has focused primarily on model architectures, leaving the systems support for large-scale depth-recurrent training underexplored. As models outgrow single-device memory, their parameters must be distributed across devices. Pipeline parallelism (PP) partitions model layers into stages placed across devices and pipelines micro-batches through them, offering favorable communication volume and arithmetic intensity for large-scale training (Huang et al., 2019; Narayanan et al., 2021a; Shoeybi et al., 2019; Rajbhandari et al., 2020).

However, conventional PP schedules, e.g., Megatron’s interleaved 1F1B (Narayanan et al., 2021b), are designed for linear feed-forward execution, where each layer is used once in a forward pass. Looped Transformers instead revisit shared blocks spanning multiple stages, introducing loop-carried feedback from later to earlier stages that breaks the compute-readiness and communication-order assumptions of native interleaved 1F1B (Figure 1). Without global rescheduling, the direct adaptation of conventional PP is limited to independent stage-local repetition. Consider a recurrent region repeated for 𝒯\mathcal{T} steps and partitioned across PP stages, where ℱp\mathcal{F}_{p} denotes the recurrent computation assigned to stage pp. Such stage-local repetition yields

ℱP−1𝒯∘⋯∘ℱ0𝒯⏟independent stage-local repetition,\underbrace{\mathcal{F}_{P-1}^{\mathcal{T}}\circ\cdots\circ\mathcal{F}_{0}^{\mathcal{T}}}_{\text{independent stage-local repetition}}, (1)

whereas the looped model requires

(ℱP−1∘⋯∘ℱ0)𝒯⏟𝒯 end-to-end recurrent steps.\underbrace{\left(\mathcal{F}_{P-1}\circ\cdots\circ\mathcal{F}_{0}\right)^{\mathcal{T}}}_{\text{$\mathcal{T}$ end-to-end recurrent steps}}. (2)

Here, the superscript 𝒯\mathcal{T} denotes repeated function composition. Thus, simply inserting an independent local loop into each pipeline stage is insufficient.

Figure 1: Pipeline execution of (a) Standard Transformer and (b) Looped Transformer.

A straightforward alternative is to physically unroll the 𝒯\mathcal{T} recurrent visits into separate pipeline chunks and apply conventional PP scheduling. However, using independent parameters changes the model semantics, while tying the expanded copies incurs additional parameter storage and synchronization overhead. The challenge is therefore to preserve exact recurrence semantics and a single physical copy of shared parameters while retaining the concurrency of native pipeline execution.

To this end, we present Loop-PP, the first pipeline-parallel training system for looped Transformers. Its core is a Loop-Aware Pipeline Compiler which translates recurrent model semantics into static pipeline execution plans while preserving a single physical copy of shared parameters. First, Semantic Graph Construction logically unrolls the recurrent computation into distinct visits to shared physical model regions and captures their cross-step dependencies, yielding a scheduling-independent Semantic Graph. Second, Native-Guided Schedule Synthesis uses native interleaved 1F1B as a compute template and constrains it with these semantic dependencies, producing a Global Compute Order. Third, Communication-Aware Stream Compilation turns cross-stage dependencies into ordered communication actions and schedules their initiation and completion around dependency-ready compute to expose communication overlap, producing a static Per-Rank Action Stream for each rank. We further introduce system optimizations to reduce communication and runtime overhead. In summary, our main contributions are:

•

We identify the mismatch between conventional pipeline parallelism and depth-recurrent execution, and, to our knowledge, present the first pipeline-parallel training system designed for looped Transformers.

•

We develop Loop-PP, a loop-aware pipeline compiler that preserves recurrent semantics and parameter sharing while adapting native interleaved 1F1B scheduling and communication to repeated cross-stage execution.

•

Across 8B–60B models, Loop-PP maintains broadly comparable throughput to compute-matched baseline with interleaved 1F1B while reducing peak memory by up to 32.8%. Under an equal resource budget, it improves the best measured throughput by up to 12.7%.

2 Background and Motivation

Looped Transformers

Looped models increase effective depth by repeatedly applying shared blocks (Dehghani et al., 2019; Geiping et al., 2025; Zhu et al., 2025; Saunshi et al., 2025). Existing models vary in recurrence scope, from intermediate regions (Geiping et al., 2025) to nearly the entire Transformer backbone (Zhu et al., 2025). To capture both cases, we decompose the model into a non-recurrent prelude 𝒫\mathcal{P}, a recurrent region ℛ\mathcal{R}, and a non-recurrent coda 𝒞\mathcal{C}. For full-backbone recurrence, 𝒫\mathcal{P} and 𝒞\mathcal{C} contain only boundary computation such as the embedding and output head.

Let a=𝒫⁡(x,θ𝒫)a=\mathcal{P}(x;\theta_{\mathcal{P}}) denote the prelude output with input xx and parameters θ𝒫\theta_{\mathcal{P}}. Starting from h0=ah_{0}=a, the recurrent region is applied for 𝒯\mathcal{T} steps:

ht+1=ℛ(ht,a;θℛ),t=0,…,𝒯−1,h_{t+1}=\mathcal{R}(h_{t},a;\theta_{\mathcal{R}}),\qquad t=0,\ldots,\mathcal{T}-1, (3)

followed by y=𝒞⁡(h𝒯,θ𝒞)y=\mathcal{C}(h_{\mathcal{T}};\theta_{\mathcal{C}}). The parameters θℛ\theta_{\mathcal{R}} are shared across recurrent steps, and the dependence of ht+1h_{t+1} on hth_{t} captures the recurrent state carried across steps. The second argument aa is optional: some models omit it and update from hth_{t} alone, while others (Geiping et al., 2025) inject aa at every step, making the unrolled computation a DAG rather than a linear chain. When these dependencies span pipeline stages, PP must communicate recurrent states and, when present, injected inputs in addition to the hidden activations transferred in conventional feed-forward execution. Conventional PP assumes a single feed-forward visit to each model chunk, whereas a recurrent region spanning stages requires cross-stage feedback and side dependencies. Therefore, we need to design a new pipeline parallel scheduling strategy for looped models.

3 Loop-Aware Pipeline Compiler

The Loop-Aware Pipeline Compiler translates a depth-recurrent model into deterministic computation and communication sequences for pipeline-parallel training. It takes as input the recurrent model structure, the number of micro-batches MM, and PP/VPP placement, and produces static Per-Rank Action Streams for each pipeline rank through the following three stages, as shown in Figure 2.

Figure 2: Overview of the Loop-Aware Pipeline Compiler. SpS_{p} denotes pipeline stage pp, TtT_{t} denotes recurrent step tt, and MmM_{m} denotes micro-batch mm.

3.1 Semantic Graph Construction

A looped model repeatedly invokes the same physical blocks, but each invocation consumes a different intermediate state and therefore has a distinct logical identity. Figure 2 (a) makes this unrolling explicit: T0T_{0} and T1T_{1} on the same pipeline stage SpS_{p} are two logical visits to the same physical module, while different micro-batches MmM_{m} form disjoint graph copies. The compiler unrolls the fixed 𝒯\mathcal{T} recurrent steps into a forward Semantic Graph 𝒢=(𝒱,ℰ)\mathcal{G}=(\mathcal{V},\mathcal{E}). For each micro-batch, the dataflow has the form

𝒫→ℛ(0)→⋯→ℛ(𝒯−1)→𝒞,\mathcal{P}\rightarrow\mathcal{R}^{(0)}\rightarrow\cdots\rightarrow\mathcal{R}^{(\mathcal{T}-1)}\rightarrow\mathcal{C}, (4)

where each ℛ(t)\mathcal{R}^{(t)} is the within-step DAG of the recurrent region.

Concretely, the compiler first partitions the prelude, recurrent region, and coda into segments by PP/VPP placement and creates one semantic node vv for each visit. Each node v∈𝒱v\in\mathcal{V} records its micro-batch MmM_{m}, recurrent step TtT_{t}, computation role, PP stage SpS_{p}, and VPP placement. Prelude and coda are visited once per micro-batch, whereas the recurrent region contributes a new set of logical nodes at every tt. The compiler then connects computations within a step by main edges, connects the exit of step tt to the entry of step t+1t+1 by feedback edges (the cross-stage recurrence in Figure 2), and routes loop-invariant or auxiliary state aa to its consumers by injection edges. An edge e=(u,v,Σe)e=(u,v,\Sigma_{e}) carries an ordered tensor bundle Σe\Sigma_{e} from producer uu to consumer vv that may contain multiple tensors, e.g., auxiliary state aa and main hidden activation.

Unrolling creates a distinct logical visit for each recurrent step, so a feedback edge connects step tt only to step t+1t+1 and the graph is acyclic for finite 𝒯\mathcal{T}. Injection edges may additionally fan out from the prelude to several recurrent nodes, so 𝒢\mathcal{G} need not be a single chain. The graph specifies what to compute, which dependencies to respect, and on which SpS_{p} each node runs, but it does not yet choose an execution order. Backward compute is derived later from the reversed dependencies. Appendix A gives the complete node and edge definitions and the semantic-equivalence argument.

3.2 Native-Guided Schedule Synthesis

The Semantic Graph defines a partial order over model computations, but it does not specify which operation to choose when several are simultaneously ready. Any topological execution preserves model semantics, yet an arbitrary choice can leave pipeline stages idle. Efficient scheduling must satisfy the recurrent dependencies while retaining the compute cadence of established pipeline schedules (Huang et al., 2019; Narayanan et al., 2021a; Qi et al., 2024b). We therefore use native interleaved 1F1B (Narayanan et al., 2021b) as a compute template and constrain it with the Semantic Graph. This section orders forward and backward computation without introducing communication.

Native Compute Template.

For each PP stage, the compiler treats every visit to a layer-bearing segment on SpS_{p} as a logical compute chunk: recurrent visits are distinct chunks but still invoke the same physical parameters. It then applies Megatron’s interleaved 1F1B rule to build a communication-free reference sequence for each stage,

𝒩pnat=[(ϕi,mi,ci)]i=0Jp−1,ϕi∈{F,B},\mathcal{N}^{\mathrm{nat}}_{p}=[(\phi_{i},m_{i},c_{i})]_{i=0}^{J_{p}-1},\qquad\phi_{i}\in\{F,B\}, (5)

where JpJ_{p} is the number of native compute slots on stage pp. Slot ii records the phase ϕi\phi_{i} (forward or backward), the micro-batch mim_{i} assigned to that slot, and the logical compute chunk cic_{i}. Figure 2 (b) illustrates that T0T_{0} and T1T_{1} on the same SpS_{p} are two logical visits, while MmM_{m} indexes the forward/backward slots of different micro-batches. Recurrence therefore expands the number of logical slots, not the number of physical layers.

Semantic-constrained Merge.

The native templates specify the desired interleaved 1F1B cadence, but do not encode recurrent dependencies in the Semantic Graph 𝒢\mathcal{G}. Executing them independently may therefore start a semantic consumer before its input has been produced. To make these dependencies explicit, the compiler expands each native slot into the semantic nodes attached to its logical compute chunk and represents every node vv by two phased semantic operations, forward operation (F,v)(F,v) and backward operation (B,v)(B,v). These semantic operations, rather than the abstract native slots, are the objects ultimately ordered by the scheduler.

The compiler then combines the semantic dependencies in 𝒢\mathcal{G} with the native order 𝒩pnat\mathcal{N}^{\mathrm{nat}}_{p} into a phased constraint graph,

ℋ=({(ϕ,v)∣ϕ∈{F,B},v∈𝒱},ℰnat∪ℰF∪ℰB∪ℰF​B),\mathcal{H}=\left(\{(\phi,v)\mid\phi\in\{F,B\},\,v\in\mathcal{V}\},\mathcal{E}_{\mathrm{nat}}\cup\mathcal{E}_{F}\cup\mathcal{E}_{B}\cup\mathcal{E}_{FB}\right), (6)

For every semantic edge (u,v)∈ℰ(u,v)\in\mathcal{E}, ℰF\mathcal{E}_{F} contains (F,u)≺(F,v)(F,u)\prec(F,v) and ℰB\mathcal{E}_{B} contains the reverse-mode constraint (B,v)≺(B,u)(B,v)\prec(B,u). For every node v∈𝒱v\in\mathcal{V}, ℰF​B\mathcal{E}_{FB} contains (F,v)≺(B,v)(F,v)\prec(B,v). The Semantic Constraints highlighted in Figure 2 illustrate these model-derived dependencies. In particular, the illustrated loop feedback is an edge in ℰF\mathcal{E}_{F} requiring the exit forward of step tt to precede the entry forward of step t+1t+1. On each stage, native 1F1B requires operations to follow their order in 𝒩pnat\mathcal{N}^{\mathrm{nat}}_{p}. After mapping its slots to phased semantic operations, the compiler encodes this order by adding an edge between each consecutive pair, and their union across all stages forms ℰnat\mathcal{E}_{\mathrm{nat}}.

Next, the compiler computes a deterministic linear extension of ℋ\mathcal{H} with a priority-guided Kahn algorithm (Kahn, 1962). All zero-indegree operations form a global ready heap, so an operation becomes eligible only after all of its semantic and stage-local native predecessors have been emitted. Among them, the compiler selects the lexicographically smallest (rnat,rphase,id)(r_{\mathrm{nat}},r_{\mathrm{phase}},\operatorname{id}), where rnatr_{\mathrm{nat}} is its position in the native order of its stage, rphase=0r_{\mathrm{phase}}=0 for forward and 11 for backward, and the semantic-node identity provides deterministic tie breaking. Because ℰnat\mathcal{E}_{\mathrm{nat}} chains the operations on each stage, the algorithm chooses only among the ready frontiers of different stages without changing any stage-local native order. Emitting all operations produces the Global Compute Order

𝒪=[(ϕ0,v0),…,(ϕNop−1,vNop−1)],ϕi∈{F,B},vi∈𝒱,Nop=2​|𝒱|,\mathcal{O}=[(\phi_{0},v_{0}),\ldots,(\phi_{N_{\mathrm{op}}-1},v_{N_{\mathrm{op}}-1})],\qquad\phi_{i}\in\{F,B\},\quad v_{i}\in\mathcal{V},\quad N_{\mathrm{op}}=2|\mathcal{V}|, (7)

which contains every semantic forward and backward operation exactly once. As illustrated by the rank-wise view in Figure 2(b), the Global Compute Order preserves each rank’s native compute order without serializing independent operations across ranks at runtime. Native-rank priority is applied only among zero-indegree operations in ℋ\mathcal{H}, so it never bypasses a semantic dependency.

Under balanced chunk costs, the structural bubble matches that of compute-matched interleaved 1F1B. Note that structural bubbles characterize only the compute schedule. The actual execution time also depends on computation-communication overlap, which we address next.

3.3 Communication-Aware Stream Compilation

The Global Compute Order specifies the computation order, but it does not determine communication actions. This section introduces communication dependencies and compiles the compute and communication actions into a deterministic executable stream for every pipeline rank.

Communication Planning.

The compiler classifies each semantic edge by the PP placements of its endpoints: a local edge whose endpoints share a stage remains an in-memory data dependency, whereas a remote edge spanning stages induces a planned transfer. For a remote edge e=(u,v,Σe)e=(u,v,\Sigma_{e}), a forward transfer moves Σe\Sigma_{e} from the stage owning uu to the stage owning vv, whereas a backward transfer moves ∇Σe\nabla\Sigma_{e} from the stage owning vv to the stage owning uu. A transfer is represented as

γ=(e,ϕ,ssrc,sdst,Σeϕ),ϕ∈{F,B},\gamma=(e,\phi,s_{\mathrm{src}},s_{\mathrm{dst}},\Sigma_{e}^{\phi}),\qquad\phi\in\{F,B\}, (8)

where ϕ\phi denotes the forward or backward direction, ssrcs_{\mathrm{src}} and sdsts_{\mathrm{dst}} identify the communicating stages, and ΣeF=Σe\Sigma_{e}^{F}=\Sigma_{e} and ΣeB=∇Σe\Sigma_{e}^{B}=\nabla\Sigma_{e} denote the corresponding payload schemas. Remote transfers are ordered according to the forward and backward subsequences of 𝒪\mathcal{O}. The resulting Communication Plan specifies what data moves between which stages and in what order.

Cross-Stage Action DAG.

To represent communication–computation overlap, the compiler separates the initiation and completion of every transfer. A POST submits the nonblocking send or receive bundle and returns before the transfer necessarily completes, whereas the corresponding WAIT confirms the transfer’s completion. Thus, it expands 𝒪\mathcal{O} and the Communication Plan into a Cross-Stage Action DAG containing forward/backward Compute, nonblocking POST, WAIT, and EnsureBatch for micro-batch preparation.

For a transfer γ\gamma associated with e=(u,v,Σe)e=(u,v,\Sigma_{e}), let (x,y)=(u,v)(x,y)=(u,v) when ϕ=F\phi=F and (x,y)=(v,u)(x,y)=(v,u) when ϕ=B\phi=B. The Action DAG enforces

Computeϕ⁡(x)\displaystyle\operatorname{Compute}^{\phi}(x) ≺POSTsrc⁡(γ),\displaystyle\prec\operatorname{POST}_{\mathrm{src}}(\gamma), (9)

{POSTsrc⁡(γ),POSTdst⁡(γ)}\displaystyle\left\{\operatorname{POST}_{\mathrm{src}}(\gamma),\operatorname{POST}_{\mathrm{dst}}(\gamma)\right\} ≺{WAITsrc⁡(γ),WAITdst⁡(γ)},\displaystyle\prec\left\{\operatorname{WAIT}_{\mathrm{src}}(\gamma),\operatorname{WAIT}_{\mathrm{dst}}(\gamma)\right\},

WAITdst⁡(γ)\displaystyle\operatorname{WAIT}_{\mathrm{dst}}(\gamma) ≺Computeϕ⁡(y).\displaystyle\prec\operatorname{Compute}^{\phi}(y).

These constraints ensure that a payload is produced before transfer initiation, both endpoints initiate matching communication before completion, and the receiver completes the transfer before consuming the payload. The graph also retains semantic compute dependencies and communication-order and resource-safety constraints required for execution. Crucially, the Cross-Stage Action DAG specifies which action reorderings and overlaps are legal. Actions with no dependency path between them may change relative order during linearization. In particular, independent computation may be placed between POST and WAIT to overlap with in-flight communication. Figure 2(c) illustrates how a remote dependency expands into POST and WAIT actions at its sender and receiver.

Native-Aware Communication Linearization.

Because the Cross-Stage Action DAG defines only a partial order, it generally admits multiple legal executions. Linearization selects deterministic Per-Rank Action Streams from these executions while retaining the native interleaved 1F1B compute cadence and exposing communication overlap.

Ranks cannot make this choice independently: selecting sends and receives in different orders may produce inconsistent communication matching. The compiler therefore first fixes a global matching order for remote transfers. Among ready transfers, it preferentially groups opposite-direction transfers between the same stages into a bidirectional communication epoch, following the P2P structure of interleaved pipeline execution (Narayanan et al., 2021b). A transfer without a legal partner forms a singleton epoch. An epoch represents one globally agreed communication-matching decision, not a runtime barrier. Once their order is fixed, both endpoints initiate matching operations consistently without having to reach an epoch simultaneously.

The compiler then projects the fixed epoch order onto each stage and linearizes its local actions using three rules: (i) post the next dependency-ready and resource-feasible epoch as early as possible; (ii) otherwise, select the earliest ready Compute in that stage’s native compute order; and (iii) emit a WAIT only when a consumer requires the result or an in-flight transfer blocks further progress. Consequently, POSTs open communication windows early, WAITs close them only when necessary, and independent native-preferred computation fills the interval between them. The Action DAG guarantees legality, the epoch order guarantees consistent cross-rank matching, and these rules determine the concrete local order. As illustrated in the lower part of Figure 2(c), the result is

{𝒬s}s=0P−1,\{\mathcal{Q}_{s}\}_{s=0}^{P-1}, (10)

where 𝒬s\mathcal{Q}_{s} is the Per-Rank Action Stream for stage ss. All streams are compiled before execution and the runtime follows them directly. Appendix B proves that the compiled streams preserve the Semantic Graph dependencies and yield PP-transport deadlock freedom under explicit backend-progress assumptions.

Implementation Optimizations

The three compilation stages above produce a correct and executable plan, but steady-state training can still incur avoidable communication and compilation overheads. First, a uniform payload may carry loop auxiliary tensors even when remote consumers do not require those fields. Payload Localization therefore rewrites each payload schema according to its actual consumers and transmits only the fields required by remote computation. Second, the Global Compute Order, Communication Plan, and Per-Rank Action Streams can be reused across training steps. The compiler therefore uses compilation caching to reuse these results, keyed by the Semantic Graph and execution configuration. On a cache hit, steady-state training directly executes the validated local streams.

4 Experiments

4.1 Experimental Setup

Models.

We evaluate three full-loop MoE models based on Megatron-LM (Narayanan et al., 2021b): 8B-A1B, 30B-A3B, and 60B-A5B with 32, 48, and 48 unique layers. For looped models, the complete layer stack is recurrently executed for 𝒯=2\mathcal{T}=2 steps, giving effective depths of 64, 96, and 96 layers. The model names refer to the unique physical parameterization rather than the parameter count of an untied expansion. Unless otherwise specified, experiments use 32 GPUs, sequence length 4,096, and 𝒯=2\mathcal{T}=2. We report end-to-end training throughput in tokens per second and peak GPU memory in GiB. On an 8B MoE model with 𝒯=2\mathcal{T}=2, Loop-PP at PP2 matches a PP1 recurrent oracle bit-exactly in language-model and auxiliary loss over five steps. After 1,000 steps with 𝒯=3\mathcal{T}=3, the losses differ by 5.43×10−45.43\times 10^{-4} (1.813975 vs. 1.814518), with no accumulating drift.

Baselines.

We compare three strategies with Loop-PP. Unrolled materializes the same effective depth with independent parameters and schedules it with Megatron’s interleaved 1F1B. It matches the computation of the looped models but not their parameter-sharing semantics, serving as an optimistic native-schedule reference. Tied uses the same physical expansion but ties the weights across recurrent visits, preserving the looped model’s semantics. After backward, gradients are reduced, only one replica is optimized, and the updated weights are copied to all replicas. This preserves interleaved 1F1B scheduling at the cost of replicated parameters and additional synchronization. Lockstep executes the same Semantic Graph as Loop-PP with a conservative, dependency-respecting 1F1B schedule that bounds the number of live micro-batches. It serves as a correctness-oriented reference without Loop-PP’s optimized scheduling and communication.

4.2 Overall Performance

Comparison under matched configuration.

We evaluate Loop-PP and the baselines on different model sizes and PP degrees, and report throughput and peak memory in Figure 3. For a given model and PP degree, all methods use the same training configuration. The settings may slightly differ across models and PP degrees.

Figure 3: Training throughput and peak memory for three MoE models at PP2, PP4, and PP8.

Loop-PP uses less peak memory than Unrolled and Tied at every plotted point, saving up to 32.8% memory. At 60B PP2, Unrolled, Tied, and Lockstep run out of memory, while Loop-PP completes. Loop-PP’s throughput is competitive with the expanded native schedules and depends on pipeline granularity. At PP2, Loop-PP is 12.4% faster than Unrolled on 30B, but at PP8 it is slower. We will further analyze this reversal in Section 4.3. Tied is close to Unrolled but usually slightly slower, due to the extra gradient/parameter synchronization. Relative to Lockstep, Loop-PP is 1.9×1.9\times faster at PP2 and more than 6×6\times faster at PP8 on 30B. Thus Loop-PP approaches Unrolled in throughput, remains substantially faster than the conservative Lockstep baseline, and retains a large memory advantage.

Loop-PP achieves best performance under an equal resource budget.

Unlike the previous comparison with the configuration fixed for each model and pipeline degree, we keep the model (Dense 14B or 30B MoE), the global batch size (512), and the 32-GPU budget fixed, and let Loop-PP and Unrolled choose different configurations, e.g., PP, VPP, micro-batch size, to saturate the 32 GPUs. Table 1 reports the best measured throughput of each method. On 30B-A3B, Loop-PP improves the best measured throughput by 12.7%, using only slightly more peak memory at that throughput-optimal point. This shows that Loop-PP’s memory saving is usable in practice: the saved memory can be converted into a more efficient operating point, so Loop-PP trains faster than the compute-matched Unrolled baseline under the same budget.

Table 1: Best throughput under an equal 32-GPU resource budget. Memory is peak allocated GiB.

Model Loop-PP Unrolled Speedup Loop mem. Unrolled mem.

Dense 14B 96.6k 87.0k 1.110×\times 113.7 115.7

MoE 30B 170.7k 151.5k 1.127×\times 117.7 112.7

4.3 In-Depth Analysis

Understanding the PP8 Performance Cliff

To understand why Loop-PP falls behind at PP8, we profile matched 30B Loop-PP and Unrolled runs on 16 GPUs. We decompose iteration time TstepT_{\mathrm{step}} into three components. TlocalT_{\mathrm{local}} is the service time of local forward and backward actions, including computation and work internal to MoE actions. TexposedT_{\mathrm{exposed}} is pipeline time not covered by local actions and can be viewed approximately as the exposed pipeline cost. TtailT_{\mathrm{tail}} contains gradient finalization, optimizer work, and other costs outside the pipeline schedule. Figure 4(a–b) presents this decomposition on PP2 and PP8. We additionally compare Loop-PP and Unrolled across VPP1 and VPP2 to study the effect of compute-chunk granularity in Figure 4(c).

Figure 4: Diagnosing the PP8 performance cliff from 30B MoE profiling. (a–b) Iteration decomposition at PP2 and PP8. (c) Throughput under different VPP/PP.

In Figure 4(a–b), Loop-PP trades lower local and tail costs for a higher exposed pipeline cost. Its smaller TlocalT_{\mathrm{local}} and TtailT_{\mathrm{tail}} are consistent with reusing shared parameters, while recurrent cross-stage dependencies increase TexposedT_{\mathrm{exposed}}, the exposed recurrent pipeline cost. At PP2, Loop-PP has a thick compute chunk, so its shorter local computation and tail outweigh the additional exposed time. At PP8, thinner compute chunks expose recurrent dependencies more frequently, increasing communication intensity and leaving less independent computation to hide it. Consequently, the exposed-time penalty overwhelms the local and tail savings, making Loop-PP slower than Unrolled. Figure 4(c) further confirms this, where changing from VPP2 to VPP1 doubles the Loop-PP chunk from three to six unique layers and raises its throughput from 64.7k to 71.3k tokens/s, narrowing the gap to Unrolled. Together with the observation that 99.98% of the measured PP8 receive-wait time is dependency-limited, this result shows that sufficiently thick compute chunks are important for amortizing the recurrent pipeline overhead, and Loop-PP should avoid overly fine pipeline partitions.

Loop-PP across Dense and MoE Workloads.

To study workload sensitivity, we replace the MoE blocks in the 30B model with dense FFNs while otherwise retaining its architecture and activation settings, and evaluate both variants at PP2 and PP4 on 32 GPUs. As shown in Figure 5, Loop-PP reduces local-action and tail times but increases exposed pipeline time across all four settings. The Dense results show that the local savings are not solely due to MoE load balancing and may arise from parameter and runtime-object reuse. The savings are larger on MoE, making Loop-PP 7.2% and 0.9% faster at PP2 and PP4. Phase profiling further shows that Loop-PP reduces all-to-all event duration from 4.195 s to 3.451 s at PP2 and from 4.498 s to 3.779 s at PP4. This association may reflect runtime effects of parameter reuse, such as lower memory pressure and more favorable communication-buffer behavior. Loop-PP therefore benefits MoE workloads more, where larger local savings better amortize the recurrent pipeline overhead.

Figure 5: Comparison of Dense and MoE models. (a) Throughput relative to Unrolled. (b) Step-time difference Δ​Tstep=TstepLoop​-​PP−TstepUnrolled\Delta T_{\mathrm{step}}=T_{\mathrm{step}}^{\mathrm{Loop\text{-}PP}}-T_{\mathrm{step}}^{\mathrm{Unrolled}}. The diamonds denote the total difference.

Impact of Recurrent Structure

Figure 6: Sensitivity to recurrent structure on the 8B workload. (a) Throughput relative to Unrolled as full-loop recurrent depth increases. (b) Throughput relative to Unrolled across recurrent-region fractions at 𝒯=2\mathcal{T}=2. (c) Three prelude–recurrent–coda layouts with the same 64-layer effective depth.

We study recurrent structure on the 8B model by varying the number of recurrent steps, the recurrent fraction, and the recurrent layout. Figure 6(a) compares PP2 and PP4 as the number of full-loop steps increases from two to four. As 𝒯\mathcal{T} grows to four, Loop-PP’s relative throughput weakens at both PP degrees and falls behind Unrolled at PP4, showing that more recurrent traversals incur a larger structural tax. Figure 6(b) fixes 𝒯=2\mathcal{T}=2 and varies the recurrent fraction from 25% to 100% at PP2 and PP4. Performance varies non-monotonically with the recurrent fraction: the 50% and 100% configurations outperform the 25% and 75% configurations. This shows that performance depends on how the recurrent region maps to pipeline stages, rather than on recurrent fraction alone. Figure 6(c) compares three layouts at the same 64-layer effective depth. The full-loop 32×232\times 2 and 8+16×3+88+16\times 3+8 layouts are close at PP4, while 32×232\times 2 leads at PP2. The 12+8×5+1212+8\times 5+12 layout incurs more recurrent traversals and cross-stage feedback, reducing opportunities to hide communication and increasing dependency stalls. Overall, more recurrent traversals and placement-sensitive cross-stage dependencies amplify the structural tax, favoring pipeline layouts with sufficiently thick compute chunks.

5 Related Work

Pipeline Parallelism

Conventional PP partitions layers across devices for feed-forward execution. GPipe (Huang et al., 2019) pipelines micro-batches, while PipeDream-2BW (Narayanan et al., 2021a) and Megatron-LM (Narayanan et al., 2021b) improve utilization through 1F1B scheduling, weight buffering, and interleaved virtual stages. Subsequent work reduces pipeline bubbles through finer-grained or asynchronous scheduling (Qi et al., 2024b; Ajanthan et al., 2025; Jung et al., 2026; Zmushko et al., 2026; Chen et al., 2026a), improves memory efficiency (Kim et al., 2023; Qi et al., 2024a; Wan et al., 2025), or automates partitioning and scheduling (Jhoo et al., 2025). GraphPipe (Jeon et al., 2025) and PULSE (Sun et al., 2026) extend PP to DAG-structured networks and skip-aware diffusion U-Nets, respectively, but do not directly address repeated execution of shared physical chunks with cross-stage recurrent feedback. Other work pipelines computation along token, sequence, or time dimensions (Li et al., 2021; Zhao et al., 2026; Bao et al., 2026), which is orthogonal to our depth-recurrent setting.

Looped Transformers

Looped Transformers increase effective depth by repeatedly applying shared layers. Building on early weight-tied architectures (Dehghani et al., 2019; Lan et al., 2020), recent models reuse intermediate blocks or entire layer stacks (Geiping et al., 2025; Zhu et al., 2025; Saunshi et al., 2025; Kapl et al., 2026), demonstrating benefits for reasoning, in-context learning, and test-time scaling (Geiping et al., 2025; Zhu et al., 2025; Saunshi et al., 2025; Yang et al., 2024; Alabdulmohsin and Zhai, 2025). Subsequent work explores relaxed weight sharing (Bae et al., 2025a), adaptive recursion depth (Bae et al., 2025b; Fu et al., 2025; Chen et al., 2025; Song et al., 2026; Elbayad et al., 2020; Jeddi et al., 2026; Goyal et al., 2026), dynamic skipping or looping (Li et al., 2026), and parallel test-time execution (Wu et al., 2025; Yang et al., 2026). Other studies investigate training stability (Prairie et al., 2026; Fu et al., 2026; Movahedi et al., 2026; Wang et al., 2026a), cross-loop memory and attention costs (Conchello Vendrell et al., 2026; O’Neill and Reid, 2026; Deng et al., 2026), MoE-compatible recurrence (Csordás et al., 2024; Lee et al., 2026; Chen et al., 2026b; Gao et al., 2026; Knupp et al., 2026; Chen et al., 2026c), and compute-matched scaling (Schwethelm et al., 2026; Prairie et al., 2026; Wang et al., 2026b). Despite these advances, pipeline-parallel training under cross-stage depth-recurrent feedback remains underexplored.

6 Conclusion

We identified a fundamental mismatch between conventional PP and looped Transformers: repeated cross-stage traversal introduces recurrent dependencies that independent stage-local repetition cannot preserve. We presented Loop-PP, to our knowledge the first pipeline-parallel training system for looped Transformers. Its loop-aware compiler represents logical recurrent visits independently of physical parameter storage and compiles them into dependency-aware Global Compute Orders and static Per-Rank Action Streams. Across 8B–60B models, Loop-PP reduces peak memory by up to 32.8% and improves the best measured throughput among the evaluated configurations by up to 12.7% under an equal resource budget. Our analysis further shows that its performance depends on recurrent placement and compute-chunk granularity, favoring layouts with sufficient independent local work.

References

[1] T. Ajanthan, S. Ramasinghe, Y. Zuo, G. Avraham, and A. Long (2025) Nesterov method for asynchronous pipeline parallel optimization. In Proceedings of the 42nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 267, pp. 909–924. External Links: Link Cited by: §5.

[2] I. Alabdulmohsin and X. Zhai (2025) Recursive inference scaling: a winning path to scalable inference in language and multimodal systems. In Advances in Neural Information Processing Systems, External Links: 2502.07503 Cited by: §1, §5.

[3] S. Bae, A. Fisch, H. Harutyunyan, Z. Ji, S. Kim, and T. Schuster (2025) Relaxed recursive transformers: effective parameter sharing with layer-wise LoRA. In International Conference on Learning Representations, External Links: Link Cited by: §5.

[4] S. Bae, Y. Kim, R. Bayat, S. Kim, J. Ha, T. Schuster, A. Fisch, H. Harutyunyan, Z. Ji, A. Courville, and S. Yun (2025) Mixture-of-recursions: learning dynamic recursive depths for adaptive token-level computation. In Advances in Neural Information Processing Systems, External Links: Link Cited by: §5.

[5] Y. Bao, Z. Lu, Q. Duan, C. Lv, X. Du, Z. Deng, J. Feng, S. Liu, Y. Chen, and X. Wang (2026) TPipe: efficient spiking transformer training with time parallelism and asynchronous pipeline. In IEEE INFOCOM 2026 - IEEE Conference on Computer Communications, Cited by: §5.

[6] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei (2020) Language models are few-shot learners. In Advances in Neural Information Processing Systems, Vol. 33. External Links: Link Cited by: §1.

[7] L. Chen, H. Wu, and W. Yu (2026) AMDP: asynchronous multi-directional pipeline parallelism for large-scale models training. In Proceedings of the 43rd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 306. External Links: 2605.29664 Cited by: §5.

[8] W. Chen, T. Li, W. Huang, Y. Yin, L. Shang, and C. Qin (2026) LoopMoE: unifying iterative computation with mixture-of-experts for language modeling. arXiv preprint arXiv:2606.04438. External Links: Document Cited by: §5.

[9] Y. Chen, N. Gu, J. Shang, Z. Zhang, Y. Feng, J. Sheng, T. Liu, S. Wang, Y. Sun, H. Wu, and H. Wang (2026) Mixture of universal experts: scaling virtual width via depth-width transformation. arXiv preprint arXiv:2603.04971. External Links: Document Cited by: §5.

[10] Y. Chen, J. Shang, Z. Zhang, Y. Xie, J. Sheng, T. Liu, S. Wang, Y. Sun, H. Wu, and H. Wang (2025) Inner thinking transformer: leveraging dynamic depth scaling to foster adaptive internal thinking. arXiv preprint arXiv:2502.13842. External Links: Document Cited by: §5.

[11] V. Conchello Vendrell, A. Padres Masdemont, N. Grillo, J. Ros-Giralt, A. Behboodi, and F. V. Massoli (2026) Memory-efficient looped transformer: decoupling compute from memory in looped language models. arXiv preprint arXiv:2605.07721. External Links: Document Cited by: §5.

[12] R. Csordás, K. Irie, J. Schmidhuber, C. Potts, and C. D. Manning (2024) MoEUT: mixture-of-experts universal transformers. In Advances in Neural Information Processing Systems, External Links: Link Cited by: §5.

[13] M. Dehghani, S. Gouws, O. Vinyals, J. Uszkoreit, and Ł. Kaiser (2019) Universal transformers. In International Conference on Learning Representations, External Links: Link Cited by: §1, §2, §5.

[14] C. Deng, Y. Zhang, R. Zhu, Y. Xu, J. Liu, T. S. E. Ng, and H. Chen (2026) LT2{}^{2}: linear-time looped transformers. arXiv preprint arXiv:2605.20670. External Links: Document Cited by: §5.

[15] M. Elbayad, J. Gu, E. Grave, and M. Auli (2020) Depth-adaptive transformer. In International Conference on Learning Representations, External Links: Link Cited by: §5.

[16] R. F

Sources

← Back to Daily AI Report