Manuscript Offprint
arXiv:2610.17644DisaggKD: Efficient Knowledge Distillation through Teacher-Student Disaggregation and a Fused Loss
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Abstract
Knowledge distillation (KD) frameworks place teacher and student on the same GPUs, so per-GPU memory limits the teachers that fit. DisaggKD separates them across nodes: teacher replicas stream hidden states to the student, a KD loss over row windows and vocabulary shards equals the full-vocabulary loss in exact arithmetic without forming the full-vocabulary logits, and a prefetch ring paces producer and trainer. Closed-form memory and traffic models locate the memory limits of each layout. On the Qwen3.5-35B-A3B to 9B pair, the disaggregated layout matches the LM loss of the colocated run with the same loss and is faster than that run; our fused loss also lets a colocated run train on as few nodes at faster speed, while the split is memory efficient when the student spans several nodes. On the larger pairs, colocated runs with a fused loss still run OOM where the split trains, because teacher weights and student states fill the budget. Code will be released upon acceptance.
1 Introduction
Knowledge distillation (KD) trains a student on its teacher’s output distribution (Hinton et al., 2015), and at pretraining scale SlimQwen uses it to recover the quality of compressed students (Tang et al., 2026).
The 3 open frameworks we ran place the teacher on the student’s GPUs, keeping its weights beside the student’s weights, gradients, and optimizer state (NVIDIA, 2025a, 2024–2026) or offloading it between phases (NeMo RL, 2025; Zhang et al., 2026), as KDFlow optionally does. Colocated, the 2 models share 1 per-GPU memory budget, and the KD loss adds a logits tensor over the full vocabulary for every token the student processes. That budget is the limit: with ModelOpt’s loss the colocated stack on the Qwen3.5 pair at 3 nodes runs out of memory (OOM) where the separated one fits (Figure 1), and our fused loss moves it but not the weights of larger teachers (Table 3).
We separate the 2 roles: the teacher runs forward-only on its own nodes, so no GPU holds the layers of both models. The teacher sends its final hidden states, which are narrower than its vocabulary-wide logits, and the student recovers the logits with a copy of the teacher's output head. A fused kernel then evaluates the KD loss over vocabulary shards from per-row statistics that combine across tensor-parallel (TP) ranks, without forming a full-vocabulary tensor, so trainer memory stays low.
Whether the split pays depends on per-GPU memory and on NVLink and InfiniBand traffic, so we derive closed-form estimates of both.
Our contributions are:
• Estimation models ( ) of per-GPU memory ( ) and of traffic inside the student, inside the teacher, and between them ( ), for both layouts ( ); the memory model is fitted on measured peaks and OOM events, the traffic model checked against node counters (Appendices A.1, A.2).
• A disaggregated KD algorithm, DisaggKD ( ): teacher replicas stream hidden states over NVIDIA Collective Communications Library (NCCL) point-to-point (P2P) links ( ), the student evaluates a fused loss over row windows and vocabulary shards, equal to the full-vocabulary loss in exact arithmetic ( , Appendix B.3), and a prefetch ring paces both ( ).
• A measured evaluation ( ). On the Qwen3.5 pair the language-modeling (LM) losses of the 2 layouts match, the disaggregated run is faster than the colocated runs with ModelOpt’s loss balancer and with the same loss, and a colocated run with our fused loss is as fast or faster on
*Work was done during the internship at SB Intuitions Corp.

Figure 1: Per-GPU memory of the Qwen3.5-35B-A3B to 9B pair on 3 nodes: bars stack student states S, activations and buffers A, teacher weights, logits buffers (colocated) or the memory retained by the streamed loss (trainer), and other memory; diamonds are measured peaks (ModelOpt bar: allocated plus requested bytes at the OOM error). The first colocated bar (ModelOpt's loss) is the model's demand; the fused-W bar (Table 3; fused loss, model cross-entropy fusion off) splits a measured peak, with the remainder. Trainer and producer nodes hold separate stacks and exchange hidden-state slots over NCCL P2P.
as few nodes but holds more memory per GPU when the student spans several nodes ( ); on 3 larger pairs the disaggregated layout trains where the colocated stack runs OOM, also with a fused loss, and is faster on Llama.
KD frameworks. Table 2 compares the open frameworks we ran against DisaggKD; all 3 keep teacher and student on the same GPUs in the modes we ran: Megatron-Bridge ModelOpt (NVIDIA, 2025a, 2024–2026), KDFlow (Zhang et al., 2026), and NeMo-RL (NeMo RL, 2025). Like KDFlow and Maestro (Yuan et al., 2026), we send hidden states instead of logits, but stream the states from teacher replicas by NCCL P2P to every tensor-parallel rank of the student under a prefetch ring, with a vocabulary-sharded loss and memory and traffic models for both placements ( , ).
Disaggregation and fused losses. Separating phases that contend for one device has paid off in LLM serving, with prefill and decode on separate pools (Zhong et al., 2024; Patel et al., 2024; Qin et al., 2025). RLHF systems place the actor, reference, and reward models flexibly (Sheng et al., 2025) and search plans with a cost estimator (Mei et al., 2025); we separate the teacher of KD. On the student side, chunked and fused losses avoid materializing the full logits tensor in cross-entropy (Wijmans et al., 2025; Hsu et al., 2025) and in offline KD (Ryskulov et al., 2026).
3 Estimation Models
Whether a teacher–student pair can be distilled on a given set of nodes depends on 3 per-GPU quantities: peak memory, bytes moved over the intra-node fabric (NVLink), and bytes moved over the inter-node fabric (InfiniBand). We model these quantities for each layout at its optimal setting.
Notation. The teacher has dense and routed-expert parameters ( ), layers, and hidden width . The student has , , , and . Both share the vocabulary size . A layout assigns the student tensor (TP), pipeline (PP), context (CP), data (DP), and expert (EP) parallel degrees (tp, pp, cp, dp, ep) on nodes of 8 GPUs, each with budget GiB. A sequence has tokens and an iteration processes gbs sequences, so , each GPU handles tokens, and each DP replica runs microbatches of one sequence. Activations take bytes per element, so elements occupy b bytes, and is the vocabulary shard of one TP rank (Appendix F).
Optimal setting. For a layout, let G be its legal parallelism grids (degrees divide layer, head, expert, and sequence counts and the world size). The optimal setting is the node-minimal grid whose memory constraint holds, ties broken toward the smaller per-GPU peak. In the colocated layout the constraint couples both models to the student grid; in the disaggregated layout it splits into trainer and producer inequalities, and R follows from the rate constraint.
3.1 Memory
A student rank stores bf16 weights, fp32 gradients, and a distributed AdamW state, which is sharded over the DP×CP group of dp · cp ranks for dense parameters and over the expert data-parallel group of edp = dp cp tp/ep ranks for routed experts:
where counts the parameters of one rank (for the trainer, of the last pipeline stage, which holds the loss; the formula gives the stage average and Appendix A.1 adds the output layer ) and routed experts are sharded over pp · ep only; coefficients are green when fixed by the code, red when fitted to measurements, and black when set as an allowance (Table 5).
Colocated. The colocated teacher is built at the student’s grid in bf16, so its shard is bytes per rank. The ModelOpt logits-KL loss runs eagerly at the last pipeline stage. At its high-water mark the loss holds 7 fp32-equivalent logits-sized buffers (enumerated in Appendix A.1), 1 for the loss-averaging all-reduce, and 1.5 for the backward pass:
The peak at the last pipeline rank is
where b bytes holds the stored layer inputs of the 1 microbatch in flight under full activation recomputation (mixture-of-experts (MoE) students add the dispatch term of Table 5), and GiB is the device peak minus the torch-allocated peak, the mean of the 2 cp4 runs (Table 5). The peak is the larger of this loss point and the teacher's forward-pass point. For the Qwen3.5 pair the logits buffers decide the grid: at tp 2 the loss alone needs 144 GiB at cp=1, so cp > 1 is required. The Bal-L+K recipe (ModelOpt's balancer) holds 1 more.
Disaggregated. The 2 roles have separate budgets. The trainer's peak is on the loss stage, which holds the student stack (1), the streamed-loss retention of §4.2, and backward-pass memory:
with of (12), which holds no full-row logits, the activation and temporary memory (reference-cycle garbage, loss-backward and recompute buffers, and an expert-layer block), and the fitted remainder , the mean of 8 trainers (Table 5). The producer holds the teacher's checkpoint as a shard (routed experts in fp8 or bf16, the rest bf16 but Nemotron's shared experts; Appendix B.2), a fitted remainder (forward-pass workspace, CUDA context, allocator), and NCCL buffers :
where is 1 for fp8 routed experts and 2 for bf16 and is calibrated (Table 5). The producers keep pace with the trainer when ( : replica forward rate, : iteration time).
3.2 Data movement
A GPU moves bytes for 3 reasons: the parallelism of the student, that of the teacher's forward pass (on the student's grid when colocated, on the producer's span when disaggregated), and the teacher-to-student transfer. For a model with hidden width , TP all-reduces (Shoeybi et al., 2020), pipeline activation transfers, and the student's gradient and parameter collectives send per GPU and iteration
where and are 2 all-reduces per layer times the teacher's 1 forward pass and the student's 3 passes (forward, recompute, backward), and is per stage boundary and direction. CP exchanges and EP all-to-all are in Table 13. Megatron's rank order (tp, cp, ep, dp, pp) with 8 GPUs per node decides the link: a dimension of degree whose ranks are apart spans ranks, so the dimension stays on NVLink if (one node) and otherwise uses InfiniBand at its node boundaries,
| Colocated (4 nodes, tp2/pp4/cp4/dp1) | Disaggregated (3 nodes: 2 trainer + 1 producer) | |
|---|---|---|
| Memory per GPU (GiB) | 11.5 + 15.8 + 36.0 + 0.25 + 12.3 ≈ predicted 75.8 (fit), measured 76.1 | trainer : predicted 55.8 (fit), measured 57.1producer : predicted 41.8 (fit), measured 39.4 |
| GB per GPU (s at the limit) | Expression | Colocated | Disaggregated |
|---|---|---|---|
| Student, NVLink | 701.7 (1.56 s) | 1179.5 (2.62 s) | |
| Teacher, NVLink | 191.0 (0.42 s) | 2405 (5.34 s), producer | |
| Student, InfiniBand | per direction | 4.29 (0.09 s) | 4.29 (0.09 s) |
| Teacher, InfiniBand | per direction | 2.15 (0.04 s) | 0 |
| Transfer, InfiniBand | per last-stage rank | 0 | 4.29 (0.09 s), 34.4 in total |
| NVLink, measured | all dimensions | 932.1 (2.07 s) | 1360 (3.02 s), trainer; 2485 (5.52 s), producer |
| Last-stage node, Gbps received | 4.56 calculated, 4.61 measured | 7.23 calculated, 7.35 measured |
Table 1: Estimation models per layout at its optimal setting for the Qwen3.5-35B-A3B to 9B pair (L=32768, gbs=128; other dimensions in Appendix A.2). Memory rows: predictions against measured device peaks (GiB). Traffic rows ((6), (7)): GB sent by a GPU per iteration and, in parentheses, the time at the nominal limits (NVLink 450 GB/s per GPU and direction; InfiniBand 400 Gb/s per GPU); measured NVLink: counter bytes per GPU, iterations 3 to 12 (colocated) and 3 to 10 (disaggregated).
so each dimension that spans nodes adds inter-node traffic. The transfer sends each slot once to every last-stage rank of the receiving group,
per last-stage rank, or gbs·tp·L b bytes in total; the lm_head ( V b bytes) is written once to a file.
3.3 Predictions at the optimal settings
Table 1 evaluates the models for the Qwen3.5-35B-A3B to 9B pair. At 4 nodes 2 grids with tp≤2 fit the budget and the colocated optimum has the lowest predicted peak; at 3 nodes no tp≤2 grid is predicted under the budget for ModelOpt's loss. The disaggregated configuration uses the (2+1) split of Table 17, the most GPU-efficient split we ran (Table 23), and both roles fit.
With ModelOpt's loss the colocated layout is capacity-bound: its logits buffers force cp ≥ 4 and hence dp=1 on 4 nodes at tp≤2. On the Qwen3.5 pair neither layout is bandwidth-bound: at the link limits the busiest GPU needs under 6 seconds of NVLink and 0.2 seconds of InfiniBand per iteration, and a hidden-state row carries bytes where a logits row carries 2V, fewer for the Llama pair and fewer for the Qwen3.5 pair.
Validation. Table 9 compares the models with measurements on the Qwen3.5 pair; Table 6 summarizes the memory accuracy on all 5 pairs and the traffic accuracy on the Qwen3.5 pair (Appendix A.1). The colocated model classifies 17 of the 18 configurations outside its fit and 5 of the 6 that set constants correctly, and predicts the peaks of 9 runs outside its fit within 3.0 GiB; the 2 errors are the Qwen3.5 Bal-L+K fit row, at the budget, and the Nemotron run on 4 nodes (OOM in the teacher's forward pass). The trainer estimate is within 4.0 GiB on 13 runs of the fitted families and the producer estimate within 8.4 GiB on its 8 fitting runs. Inter-node traffic is within 2% of the counters (Table 14), NVLink within 15% (Table 6).
4 The Disaggregated KD Algorithm
4.1 Roles and hidden-state transfer
DisaggKD is built on Megatron-Bridge (NVIDIA, 2025a) and splits the 2 models across nodes: no GPU or node hosts both models' layers (Figure 2). The trainer is a standard training run on nodes with grid (tp, pp, cp, dp, ep). The producer runs replicas of the teacher on nodes, forward only, each spanning GPUs (times an EP degree ) chosen by (5) independently of the trainer.
For every microbatch the producer emits the teacher's final hidden states instead of its logits. CP divides a sequence's rows, one per token, over the cp ranks of the student. The slot of cp rank is the matrix of its rows, so a sequence has rows. The GPUs of the student's last pipeline stage in one DP replica,

(a) Window k
(b) Row i of cell

Figure 2: The disaggregated algorithm (symbols as in §4.1 and §4.2; : omitted ranks). Top: the producer sends slot to every tp rank of its cp rank; cell of the receiver group (bold) holds the logits block , and its prefetch ring holds up to 4 slots of windows. (a) Window : gives ; row (white) is what the kernel scans. (b) The kernel walks the row in tiles with a running maximum (red); tp ranks combine the statistics by all-reduce.
the last-stage ranks, form a receiver group, and the producer sends to every tp rank of cp rank q. We call the last-stage rank with cp rank q and tp rank j the cell (Figure 2, top).
The teacher’s lm_head is not part of the producer’s forward path. The producer writes this matrix once to a file that the trainers read. The vocabulary is sharded over the tp ranks: tp rank keeps the column shards and of the teacher’s and the student’s lm_head, with , identical on every cp rank. With the student’s own final hidden states of the same rows, cell therefore evaluates the logits block for (teacher, student): the logits are partitioned over the receiver group, cp ranks owning different rows and tp ranks different columns. Statistics are reduced over the tp ranks of one cp rank only; cp ranks exchange no row statistics inside the loss. Appendix B.1 gives the row layout, protocol, and schedule.
4.2 Windowed, fused loss over vocabulary shards
The KD objective is a sum over rows, and within a row the coupling along the vocabulary axis is the reductions of (10). The trainer therefore evaluates a slot in windows of consecutive rows each (Algorithm 2, Appendix B.1), so ( does not change the loss in exact arithmetic). Let be window of . Cell computes
the window-k rows of its block . Fix a row of the window; we leave implicit in , , and , which all refer to row . Its logits are , where is the th row of with entries (Figure 2a), and no rank forms . With over the
| ModelOpt | ModelOpt fused-W | KDFlow | NeMo-RL | DisaggKD (ours) | |
|---|---|---|---|---|---|
| Teacher and student on Idle teacher weights | same GPUs kept | same GPUs kept | same GPUs kept (optional offload) | same GPUs offloaded | separate nodes lm_head only |
| Teacher forward | in the student's step | in the student's step | phases | 1 phase per step | concurrent, ahead |
| Teacher output | logits, columns | logits, columns | hidden states | logits, columns | hidden states |
| KL taken over | all columns | all columns | all columns | top 8192 columns | all columns |
| Largest logits tensor | tokens , chunks optional | step tokens | |||
| Qwen3.5 pair, 4 nodes (ModelOpt: Bal-L+K / KD-only) | |||||
| Tokens per step () | 4194 | 4194 | 4183 | 1047 | 4129 |
| Tokens/s per GPU | 741 / 1450 | 390 | 645 | 1846 | |
| Qwen3.5 pair, 3 nodes | |||||
| Tokens per step () | OOM | 4129 | – | – | 4194 |
| Tokens/s per GPU | OOM | 2389 | – | – | 2352 |
| Qwen3-32B pair, 1 node (2 for DisaggKD); ModelOpt: Bal-L+K / KD-only | |||||
| Tokens per step () | 524 | – | 515 | 524 | 524 |
| Tokens/s per GPU | 3500 / 3570 | – | 6570 | 1780 | 2426 |
Table 2: DisaggKD against ModelOpt (NVIDIA, 2025a, 2024–2026), ModelOpt with the fused-W loss of DisaggKD (Appendix C.2), KDFlow (Zhang et al., 2026), and NeMo-RL (NeMo RL, 2025). Measured rows are our runs (Table 19); NeMo-RL on Qwen3.5 ran OOM at 4.19M tokens per step; : fused, cross-entropy fusion on; –: not run. Bold: best tokens/s per GPU in each pair and node count.
| Nodes | DisaggKD (ours) | ModelOpt | ModelOpt fused-W |
|---|---|---|---|
| Qwen3.5: 35B/3B to 9B | |||
| 2 | 284 | – | 147 |
| 3 | 74 | OOM | 72 |
| 4 | 70 | 91 to 177 | |
| Qwen3-235B: 235B/22B to 30B/3B | |||
| 3 | 393 | OOM | OOM |
| 8 | 109 | 75 | – |
| Nemotron: 560B/55B to 30B/3B | |||
| 4 | 630 | OOM | OOM |
| 8 | 316 | OOM | – |
| Llama: 405B to 70B, dense | |||
| 6 | 818 | – | OOM |
| 8 | – | 484 | – |
| 16 | 186 | 301 | – |
Table 3: Outcome of each layout by node count: median s/it or OOM; –: not run. ModelOpt fused-W (Appendix C.2): the fused loss of DisaggKD with the model's cross-entropy fusion off (: on); DisaggKD forms no model cross-entropy. Entries pool the grids and losses run (Tables 18, 17, and 30a).
columns and label , the trainer minimizes
with KD weight . is the soft cross-entropy, which has the gradient of .
TP rank holds only , so the rank cannot normalize a softmax alone, and gathering would undo the sharding. The rank need not gather. Define, for the full row,
Then , and the row losses are
with , so 5 numbers replace the 2 rows of logits. Each is a maximum or a sum over columns, so tp rank computes its local versions , , , that is, (10) over the entries of only. A fused kernel evaluates the statistics with 1 thread block per row, walking the entries in tiles with the online-softmax recurrence (Milakov and Gimelshein, 2018); the tp ranks then combine the results by a MAX all-reduce followed, after each rank rescales its sums to the global maximum, by a SUM all-reduce (Appendix B.3, (15), (16)).
The local statistics are taken relative to a maximum because overflows for large logits while . The maximum of a row is unknown until all entries have been read, and a separate pass to find the maximum would read the logits 2 times, so the fused kernel (Figure 2b) reads the entries of and once and after entry keeps the running maximum and the sums and taken relative to the maximum; when the maximum rises, the sums are rescaled to the new one by a factor of at most 1. In the forward scan a rank holds at most 1 matrix per distribution, never one , and the loss equals the full-vocabulary loss in exact arithmetic (Theorem 1).
Theorem 1 (Exactness). For every window size dividing , every grouping of the entries read per step, every tp dividing , and every cp with 2 cp dividing , the losses obtained from the scanned statistics and their combination over the tp ranks through (11) are the and of (9), and the backward pass returns the gradient of the full-vocabulary softmax. Hence, in exact arithmetic, and its gradients do not depend on these choices.
The proof is in Appendix B.3.
With microbatches in flight, the trainer retains
(hidden-state rows and the teacher's lm_head shard, with a 1-byte fp8 copy when the teacher-logit product runs in fp8, ), where a colocated loss holds 9.5 fp32-equivalent buffers of logits (Eq. 2).
4.3 Prefetch and pacing
Slots are received into a ring of up to 4 slots ahead within the iteration (Appendix B.1). Iteration time is the larger of the trainer's compute time and , so a trainer that outruns its replicas is producer-bound (Table 15).
5 Experiments
5.1 Setup
Pairs. We use 5 open-weight, same-tokenizer pairs (Tables 2 and 3) from the Qwen3.5 (Qwen Team, 2026), Qwen3 (Qwen Team, 2025), Nemotron 3 (NVIDIA, 2025b, 2026), and Llama 3.1 (Llama Team, 2024) families. The Qwen3.5 pair (35B-A3B teacher, 9B student) is primary: every colocated loss and disaggregated split runs on it, at several node counts; the Qwen3-32B pair fits 1 node and serves the comparison with other stacks.
| Loss (nodes) | s/it, seed | Peak | MMLU, seed | ||
|---|---|---|---|---|---|
| 42 | 43 | 42 | 43 | ||
| Colocated (ModelOpt) | |||||
| KD-only (4) | 90.5 | 97.7 | 63.4 | 67.97 | 69.22 |
| Bal-L+K (4) | 176.8 | 172.1 | 67.2 | 67.51 | 69.78 |
| SQ-L+K (4) | 96.3 | - | 59.9 | - | - |
| SQ-L+K fused (4) | - | 40.7 | - | - | |
| SQ-L+K fused-W (3) | - | 64.1 | - | - | |
| Disaggregated (ours) | |||||
| SQ-L+K (3) | 74.3 | - | 39.2 | 70.14 | - |
| SQ-L+K (4) | 33.0 | 68.52 | 70.09 | ||
Table 4: Primary pair at iteration 200, 1 run per cell; -: not run; : 15 iterations (SQ-L+K: 110.3); : 30 iterations without cache release (Appendix D.1; 99.4 with it); W: cross-entropy fusion off, batch 126; peak: torch GiB; best bold.
Loss and its position. Offline distillation stores teacher outputs as generated sequences (Kim and Rush, 2016) or truncated top-K logits (Ryskulov et al., 2026). On-policy distillation (OPD) trains the student on its own samples and matches the teacher's token-level distributions on them (Agarwal et al., 2024; Gu et al., 2024; Qwen Team, 2025). Our objective (9) is neither. Its loss and schedule follow SlimQwen (Tang et al., 2026) without its multi-token-prediction (MTP) terms (SQ-L+K, SlimQwen's LM+KD mixture): the full-vocabulary forward Kullback–Leibler (KL) divergence between the teacher's and the student's next-token distributions, in its soft cross-entropy form, mixed with the LM loss as and decaying from 1 to 0.75, where gives the KD-only variant. ModelOpt and KDFlow minimize the same full-vocabulary forward KL, and NeMo-RL takes the KL over the top 8192 columns. ModelOpt's loss balancer (Bal-L+K, its LM+KD balancer) rescales the KD term to the LM loss instead of weighting by , which gives the KD term a gradient weight of 0.89 (Table 21).
Recipe and colocated stacks. All runs use nodes of 8 80 GB H100 GPUs (79.11 GiB usable), connected by NVLink and InfiniBand, and train on FineWeb-Edu (Penedo et al., 2024). The ModelOpt runs are Megatron-Bridge runs with the KD-only (native), Bal-L+K, and SQ-L+K losses; the stacks differ in loss weighting, learning-rate floor, teacher precision, and, at 4 nodes, global batch. KDFlow disagg. Bal-L+K SQ-L+K KD-only fused fused-W


Figure 3: Loss parity and throughput on the Qwen3.5 pair. Colocated runs are ModelOpt with the loss in the legend; fused and fused-W use the fused loss of DisaggKD (hatched: fused-W). (a) LM loss of the 4-node runs (thin: per iteration, thick: 17-iteration mean). (b) KD loss minus its first-3-iteration mean. (c) Median total throughput by node count (2-node, fused, and fused-W bars: 15 iterations).
and NeMo-RL were run on the primary pair and on Qwen3-32B to Qwen3-4B, on the corpus packed to one sample length (Table 19). In most DisaggKD runs the trainer computes the teacher's logits with an fp8 matrix product (Appendix B.2). MMLU (Hendrycks et al., 2021) is scored with FlexEval (SB Intuitions, 2026) (Appendix C.1).
5.2 Results on the Qwen3.5 pair
Loss parity. Figure 3a compares the LM loss of the 4-node disaggregated run with the 4-node colocated runs: their 17-iteration moving averages differ by 0.008 nats on average from the SQ-L+K run and 0.012 from the Bal-L+K run (Table 20); the runs read different document orders (Table 25). The disaggregated runs and the colocated SQ-L+K run log soft cross-entropy and the other ModelOpt runs KL, which differ by the teacher's entropy, 2.00 nats in the logs, so Figure 3b subtracts the initial level.
Speedup. At 4 nodes and 32768 tokens the disaggregated run is faster than the colocated Bal-L+K, SQ-L+K, and KD-only runs at seed 42 (Tables 4 and 15); it uses an fp8 teacher and the colocated runs bf16 (Table 16). Bal-L+K adds 86 s per iteration to the KD-only run, 81% of the gap, and the traced loss stage gains about 50 s of event time in collectives, copy operators, and stream synchronizations (Table 24a); SQ-L+K adds 6 s. The colocated stack runs the teacher forward pass (16 s, estimated) and the student step in sequence; the disaggregated stack runs them concurrently (§4.3). A colocated run with the fused loss of DisaggKD (SQ-L+K fused) peaks lower and, with the model's cross-entropy fusion off (fused-W), trains at a similar speed at 3 nodes and faster at 2 nodes, where DisaggKD splits 1+1 (Table 3); DisaggKD holds less memory per GPU at 3 nodes.
Quality. With seed 42 the 4-node disaggregated student is 1.0 point above the colocated Bal-L+K student and 0.6 above KD-only, and the 3-node student is 1.6 above the 4-node one; with seed 43 each student with a run gains 1.3 to 2.3 points, so layout differences are of the size of run-to-run differences (Table 26).
5.3 Other pairs
Qwen3-32B. Splitting a pair that fits 1 node colocated doubles the GPU count, which halves the rate per GPU at equal step time. The rest of KDFlow's lead, , is the step: our trainer-limited 13.5 s (Table 15) against its 9.8 s and ModelOpt's 18.4 s (Table 19).
Qwen3-235B. Of the colocated grids, the 3 colocated runs of Table 18 that fit memory use ep 16 or more, where the all-to-all dispatcher corrupts the student's forward pass, so training gives not-a-number (NaN) values or diverges (Table 28). With the all-gather dispatcher the colocated stack trains the pair on 8 nodes faster than DisaggKD (75 s with Bal-L+K, against 109 s; Table 3): the disaggregated pace is the forward time of its 4 producer replicas (duty 1.0, Table 15).
Nemotron. Memory and 2 NaN sources keep the colocated stack from training Nemotron: the teacher runs OOM at 4 nodes, and the 2 8-node grids that fit memory (ep 16) give NaN, in the forward loss with the all-to-all dispatcher and in the gradient norm with either. A Nano-teacher probe gives NaN at ep 16, not at ep 4 (Table 29).
Llama. The model predicts every colocated tp≤8 grid over the budget, so the colocated runs use tp 32; 6 nodes have no grid at a global batch of 128 (Table 18). At 16 nodes disaggregated (tp 8) is faster than colocated (tp 32; Table 30a).
6 Conclusion
Memory and traffic models predict the colocated memory limits. On Qwen3.5 DisaggKD matches the colocated LM loss and is faster than colocated runs with the same loss, and the fused loss of DisaggKD lets a colocated run train on as few nodes at a similar or faster speed; DisaggKD is memory efficient when the student spans several nodes. On the larger pairs colocated runs with a fused loss still run OOM where DisaggKD trains.
Limitations
DisaggKD needs separate teacher nodes, so where a colocated layout already fits the pair it uses more GPUs. Each framework runs under its own recipe; aligning hyperparameters across frameworks, isolating the cause of the NaN in the colocated Nemotron student, and fully sharded data parallelism (FSDP) at pp 1 are outside this paper. The estimation models are fitted to the parallelism ranges and sequence lengths we ran, and some of their terms rest on few runs. We study where the teacher runs and how its loss is computed, not how to raise downstream quality; the runs are short, with 2 seeds on 1 pair, on 1 node type and 1 English corpus.
References
Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos Garea, Matthieu Geist, and Olivier Bachem. 2024. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations, volume 2024, pages 21246–21263.
Akhiad Bercovich, Tomer Ronen, Talor Abramovich, Nir Ailon, Nave Assaf, Mohammed Dabbah, Ido Galil, Amnon Geifman, Yonatan Geifman, Izhak Golan, Netanel Haber, Ehud Dov Karpas, Roi Koren, Itay Levy, Pavlo Molchanov, Shahar Mor, Zach Moshe, Najeeb Nabwani, Omri Puny, and 7 others. 2025. Puzzle: Distillation-based NAS for inference-optimized LLMs. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 3806–3830. PMLR.
Dan Busbridge, Amitis Shidani, Floris Weers, Jason Ramapuram, Etai Littwin, and Russell Webb. 2025.
Distillation scaling laws. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 5977–6045. PMLR.
Gemma Team. 2024. Gemma 2: Improving open language models at a practical size. Preprint, arXiv:2408.00118.
Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. 2024. MiniLLM: Knowledge distillation of large language models. In International Conference on Learning Representations, volume 2024, pages 32694–32717.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2021. Measuring massive multitask language understanding. In International Conference on Learning Representations.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. Preprint, arXiv:1503.02531.
Pin-Lun Hsu, Yun Dai, Vignesh Kothapalli, Qingquan Song, Shao Tang, Siyu Zhu, Steven Shimizu, Shivam Sahni, Haowen Ning, and Yanning Chen. 2025. Liger Kernel: Efficient Triton kernels for LLM training. Preprint, arXiv:2410.10989.
Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1317–1327, Austin, Texas. Association for Computational Linguistics.
Vijay Anand Korthikanti, Jared Casper, Sangkug Lym, Lawrence McAfee, Michael Andersch, Mohammad Shoeybi, and Bryan Catanzaro. 2023. Reducing activation recomputation in large transformer models. In Proceedings of Machine Learning and Systems, volume 5, pages 341–353. Curan.
Hao Liu, Matei Zaharia, and Pieter Abbeel. 2024. RingAttention with blockwise transformers for near-infinite context. In International Conference on Learning Representations, volume 2024, pages 3992–4008.
Llama Team. 2024. The Llama 3 herd of models. Preprint, arXiv:2407.21783.
Taiming Lu and Zhuang Liu. 2026. Strong teacher not needed? On distillation in LLM pretraining. Preprint, arXiv:2605.23857.
Zhiyu Mei, Wei Fu, Kaiwei Li, Guangju Wang, Huanchen Zhang, and Yi Wu. 2025. ReaL: Efficient RLHF training of large language models with parameter reallocation. In Proceedings of Machine Learning and Systems, volume 7. MLSys.
Maxim Milakov and Natalia Gimelshein. 2018. Online normalizer calculation for softmax. Preprint, arXiv:1805.02867.
Mistral Team. 2026. Ministral 3. Preprint, arXiv:2601.08584.
Saurav Muralidharan, Sharath Turuvekere Sreenivas, Raviraj Joshi, Marcin Chochowski, Mostofa Patwary, Mohammad Shoeybi, Bryan Catanzaro, Jan Kautz, and Pavlo Molchanov. 2024. Compact language models via pruning and knowledge distillation. In Advances in Neural Information Processing Systems, volume 37, pages 41076–41102. Curran Associates, Inc.
NeMo RL. 2025. NeMo RL: A scalable and efficient post-training library. https://github.com/NVIDIA-NeMo/RL. GitHub repository.
NVIDIA. 2024–2026. NVIDIA Model Optimizer. https://github.com/NVIDIA/Model-Optimizer. GitHub repository.
NVIDIA. 2025a. NeMo Megatron Bridge. https://github.com/NVIDIA-NeMo/Megatron-Bridge.GitHub repository.
NVIDIA. 2025b. NVIDIA Nemotron 3: Efficient and open intelligence. Preprint, arXiv:2512.20856.
NVIDIA. 2025c. NVIDIA Nemotron Nano 2: An accurate and efficient hybrid Mamba-Transformer reasoning model. Preprint, arXiv:2508.14444.
NVIDIA. 2026. Nemotron 3 Ultra: Open, efficient Mixture-of-Experts hybrid Mamba-Transformer model for agentic reasoning. Preprint, arXiv:2606.15007.
Pratyush Patel, Esha Choukse, Chaojie Zhang, Aashaka Shah, Íñigo Goiri, Saeed Maleki, and Ricardo Bianchini. 2024. Splitwise: Efficient generative LLM inference using phase splitting. In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA), pages 118–132.
Guilherme Penedo, Hynek Kydlíček, Loubna Ben allal, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von Werra, and Thomas Wolf. 2024. The FineWeb datasets: Decanting the web for the finest text data at scale. In Advances in Neural Information Processing Systems, volume 37, pages 30811–30849. Curran Associates, Inc.
Hao Peng, Xin Lv, Yushi Bai, Zijun Yao, Jiajie Zhang, Lei Hou, and Juanzi Li. 2025. Pre-training distillation for large language models: A design space exploration. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3603–3618, Vienna, Austria. Association for Computational Linguistics.
Ruoyu Qin, Zheming Li, Weiran He, Jialei Cui, Feng Ren, Mingxing Zhang, Yongwei Wu, Weimin Zheng, and Xinran Xu. 2025. Mooncake: Trading more storage for less computation — a KVCache-centric architecture for serving LLM chatbot. In 23rd USENIX Conference on File and Storage Technologies (FAST 25), pages 155–170, Santa Clara, CA. USENIX Association.
Qwen Team. 2025. Qwen3 technical report. Preprint, arXiv:2505.09388.
Qwen Team. 2026. Qwen3.5: Towards native multimodal agents.
Bakbergen Ryskulov, Iker García-Ferrero, David Montero, David Jansen, Ali Hashemi, Jezabel R. Garcia, Antonio Tiene, and Román Orús. 2026. Efficient knowledge distillation for LLMs: Offline Top-K logits and a fused chunked KL loss. Preprint, arXiv:2608.03796.
SB Intuitions. 2026. FlexEval: Flexible evaluation tool for language models. https://github.com/sbintuitions/flexeval. Version 0.17.3, commit 8a07c3c, 23 July 2026.
Guangming Sheng, Chi Zhang, Zilingfeng Ye, Xibin Wu, Wang Zhang, Ru Zhang, Yanghua Peng, Haibin Lin, and Chuan Wu. 2025. HybridFlow: A flexible and efficient RLHF framework. In Proceedings of the Twentieth European Conference on Computer Systems, EuroSys '25, page 1279–1297, New York, NY, USA. Association for Computing Machinery.
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. 2020. Megatron-LM: Training multi-billion parameter language models using model parallelism. Preprint, arXiv:1909.08053.
Shengkun Tang, Zekun Wang, Bo Zheng, Liangyu Wang, Rui Men, Siqi Zhang, Xiulong Yuan, Zihan Qiu, Zhiqiang Shen, and Dayiheng Liu. 2026. SlimQwen: Exploring the pruning and distillation in large MoE model pre-training. In Third Conference on Language Modeling.
Erik Wijmans, Brody Huval, Alexander Hertzberg, Vladlen Koltun, and Philipp Krähenbühl. 2025. Cut your losses in large-vocabulary language models. In International Conference on Learning Representations, volume 2025, pages 68174–68193.
Xiulong Yuan, Hongqing Chen, Jiaxuan Peng, Fan Zhou, Zhixiang Ruan, Zekun Wang, Bo Zheng, Rui Men, Haiquan Wang, Zhipeng Zhang, Langshi Chen, Man Yuan, Jiaqi Gao, Zhengping Qian, Junyang Lin, Yong Li, Wei Lin, Junhua Wang, and Jingren Zhou. 2026. Accelerating compound LLM training workloads with Maestro. Preprint, arXiv:2605.10501.
Songming Zhang, Xue Zhang, Tong Zhang, Bojie Hu, Yufeng Chen, and Jinan Xu. 2026. KDFlow: A user-friendly and efficient knowledge distillation framework for large language models. Preprint, arXiv:2603.01875.
Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanzhe Liu, Xin Jin, and Hao Zhang. 2024. DistServe: Disaggregating prefill and decoding for goodput-optimized large language model serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24), pages 193–210, Santa Clara, CA. USENIX Association.
A Estimation Models in Detail
A.1 Memory Model
Per-module accounting. Table 5 lists the terms of (1), (3), (4), and (5) per module. The red constants were fitted to measured OOM events and peak readings (Tables 18, 8, and 7), the green ones follow from the code, and the black ones are allowances.
The colocated loss buffers. ModelOpt’s logits-KL loss materializes, at the last pipeline stage, 7 fp32-equivalent logits buffers, each : the bf16 student and teacher logits (together 1 fp32-equivalent buffer), their 2 fp32 upcasts, the exponentials of the student logits that autograd retains for the backward pass, the student and teacher log-probabilities, and the elementwise KL tensor that is summed over the vocabulary. We fitted the count from the 2 colocated OOM events of the Qwen3.5 pair on 4 nodes (Table 18), whose OOM events fail at the 4th and the 7th buffer. The cp1 event failed on the fourth buffer, as did the 3-node event outside the fit, and the cp2 event on the seventh with 5 to 6 live, which gives the 7 live buffers under the allocation order listed. An eighth buffer stages the loss-averaging all-reduce, set from the Qwen3-235B 8-node cp2 OOM at its first call (Table 18). A run that reaches the backward pass also holds the gradient of the fp32 student logits and its bf16 copy, 1.5 buffers: fitting that count to the peak of each cp4 run gives 1.46 for both runs, and the cp8 run, outside the fit, is predicted within 0.7 GiB (Table 18). Together they are the 9.5 buffers of (2). The LM loss adds 1 more buffer, since the torch-allocated peak of the Bal-L+K run is 3.8 GiB above the KD-only run’s and 1 buffer is 3.8 GiB. The fused loss peaks 19.2 GiB below the SQ-L+K run at cp4, 5.1 buffers, and is outside the count (Table 4). The streamed loss retains of (12) instead, which per microbatch holds hidden elements where the colocated loss holds logit elements (teacher and student), a reduction of : for the Qwen3.5 pair and for the dense Llama pair at tp=8.
Units and parameter counts. Every memory term is in GiB ( bytes): a parameter term is the count in billions times the bytes per parameter times . A measured peak is quoted as the quantity that was logged (Megatron’s decimal-GB readings converted to GiB): torch-allocated (the maximum allocated by PyTorch on the loss-stage ranks), device (the peak device memory in use, which adds the non-PyTorch memory), or, at an OOM error, the bytes allocated plus the bytes requested. The trainer’s loss-stage parameter count sums the blocks of the stage, with the layers split evenly over the pipeline stages, the output layer ( ) on the last stage (a copy of the embedding when the embeddings are tied and pp > 1), and the Gated-DeltaNet, gated-attention, router, and Mamba parameters of each layer type; it reproduces the logged per-rank count of each of 7 trainers within 0.1%. Totals and taken from the configuration alone undercount the Qwen3.5 student by 9% (8.2 against 9.0 billion parameters, because a Gated-DeltaNet layer and the gated attention output count as plain attention) and the Qwen3-4B student by 1.1 GiB, because its tied embedding is held on both end stages, so the counts come from the checkpoint tensor index and the block sums. The optimizer term shards over the combined DP×CP group, as Megatron-Core’s distributed optimizer does, so at (dp, cp) = (1, 4) the optimizer state per rank is 4 times smaller than a DP-only form gives. The Adam moments are allocated at the first optimizer step, so a run that stops in its first iteration holds S without them, and its non-PyTorch memory is 3.1 GiB (the mean of 4 OOM events, 2.5, 2.7, 3.2, and 4.0, at the failing rank with the most memory in use; the 4.0 is the Nemotron 4-node run with tp8/pp1/cp4/ep32), against 12.27 GiB at steady state (the device peak minus the torch-allocated peak of the 2 cp4 runs, 12.65 and 11.88 GiB). The student’s routed experts are sharded over pp · ep only because the bridge pins their expert TP to 1, and the Qwen3.5 teacher’s 2 key-value heads limit TP to 2 without head replication.
Producer-side terms. The producer holds the teacher’s whole checkpoint, the vision tower and the multi-token-prediction block where the teacher has them. The shard term of (5) counts dense tensors at 2 bytes and routed experts at 1 byte when fp8 and 2 bytes when bf16, and reproduces the per-rank parameter count in the producer log to 0.15% for the Qwen3.5, Qwen3-235B, Llama, and Qwen3-32B teachers and to 4.2% for the Nemotron teacher, whose Mamba mixers are not fully tensor-parallel. The device peak lies 17.7 to 32.1 GiB above the shard for the MoE teachers and 5.9 to 18.2 GiB for the dense ones (Table 7). The forward-pass term is the mean of these remainders after
| Module | Term |
|---|---|
| Student weights, gradients, optimizer | bytes + bytes, experts on pp · ep, their optimizer state on edp ranks |
| Student activations, colocated | b bytes stored layer inputs of the 1 microbatch in flight at the loss stage (full recomputation) |
| Student attention scores | b bytes when attention is not fused (zero for the students of this paper) |
| Student MoE dispatch | b/tp bytes |
| Colocated teacher shard | bytes (bf16) |
| Colocated logits buffers | 4 bytes (7 buffers, 1 for the loss-averaging all-reduce, and 1.5 for the backward pass; 1 more with the LM loss) |
| Teacher forward-pass memory, colocated (the peak is the maximum with this term) | MoE expert-MLP tile (8 fp32 copies of the dispatched token pairs, divided by tp · cp; 0.705 of it for a distributed-checkpoint teacher), Mamba activations (4.99 bf16 copies of each Mamba layer's inner states, divided by tp · cp), and 10.9 GiB of staging when the teacher is loaded from a Hugging Face checkpoint |
| Non-PyTorch memory, colocated | 12.27 GiB, the mean of the 2 cp4 runs; 3.1 GiB in the first iteration, the mean of 4 OOM events (3 Qwen3.5, 1 Nemotron) |
| Trainer stack, disaggregated (loss stage) | , with ; is (12) (1.1 GiB for the Qwen3.5 (2+1) trainer) |
| Trainer reference-cycle garbage | b bytes (12.0 GiB at 64 microbatches) |
| Trainer loss-backward and recompute temporary memory | bytes (8.6 GiB); : layers recomputed at once |
| Trainer expert-layer block (MoE students) | b bytes, the expert layers of the loss stage (3.75 GiB for Qwen3-30B-A3B) |
| Trainer remainder | 15.32 GiB, the mean remainder of 8 trainers |
| Producer shard | bytes of the whole checkpoint, (fp8 experts) or 2 (bf16) |
| Producer remainder (forward-pass workspace and other memory) | 22.70 GiB (MoE: the mean residual of 6 producers), 4.4 GiB plus 12.8 bf16 buffers of (dense: through the 2 dense producers) |
| Producer NCCL buffers | 1 GiB, a flat allowance |
Table 5: Per-module terms of the memory model (: routed experts per token, : attention heads). Green coefficients follow from the code or the framework; red coefficients are fitted to measurements; black numbers are allowances. Parameter terms are in exact GiB (Appendix A.1).
the 1 GiB of NCCL buffers : 22.70 GiB for the 6 MoE producers, and for the 2 dense producers the line through them, 4.4 GiB plus 12.8 bf16 buffers of ( for Llama, 4096 for Qwen3-32B). The line predicts the Qwen3-32B producers at and 16384 (peaks 37.56 and 39.84 GiB) to -0.6 and -1.9 GiB; a single buffer count fitted on Llama underestimates all 3 Qwen3-32B runs by 4.3 to 5.6 GiB. The 2 runs of each MoE family differ by at most 1.1 GiB, and the remainder differs between families (21.4 for Qwen3.5, 18.1 for Qwen3-235B, and 31.6 for Nemotron), which a constant does not follow, so the estimate is too high for the Qwen3-235B producers and too low for the Nemotron producers.
Fitted and held-out configurations. The colocated constants are set on 4 peak readings and 4 OOM points (Table 18). The readings are the device and torch-allocated peaks of the Qwen3.5 cp4 runs with the KD-only and Bal-L+K losses; they set the non-PyTorch memory . The OOM points are the 2 Qwen3.5 4-node events, which fix the 7-buffer count, and the 2 Nemotron 8-node events, which set the teacher's forward-pass terms and the 10.9 GiB staging of the Hugging Face load. The trainer remainder is the mean remainder of the device peaks (the maximum over a run's trainer GPUs) of the 8 trainers with CR – after the other terms of (4) are subtracted, and the producer's is the mean remainder of the 6 MoE producer peaks, with the 2 dense producers setting the intercept and the buffer count (Table 7). Table 9 compares prediction and measurement on the Qwen3.5 pair under both layouts, with the use of each row (fit or held out), and Table 8 lists the terms, prediction, and measurement of each trainer. Outside the trainer fit are the 2 Qwen3-235B trainers with CR all, whose device readings are allocator ceilings, 7 Qwen3.5 trainers on other layouts (Appendix D.1), the Qwen3-4B student at 3 further sequence lengths, and the Qwen3-30B student with the garbage collected after every microbatch,
| Model | In the fit | Outside the fit |
|---|---|---|
| Trainer device peak | 8 runs: RMS 1.2, largest 2.5 | 13 runs: RMS 1.7, largest 4.0 |
| Producer device peak | 8 runs: RMS 5.0, largest 8.4 | leave one MoE family out (6 runs): RMS 8.6, largest 12.3 |
| Colocated verdict | 6 configurations: 5 correct | 18 configurations: 17 correct |
| Colocated peak | 4 peaks, 4 OOM points: RMS 0.5, largest 1.2 | 9 peaks: RMS 1.5, largest 3.0; 2 OOM points, largest -15.8 |
| Inter-node traffic (Qwen3.5) | - | within 2% (3 and 4 nodes) |
| NVLink traffic (Qwen3.5) | - | 4.4% (colocated), 15% (trainer), 3% (producer) |
Table 6: Accuracy of the estimation models: root-mean-square (RMS) and largest error (predicted minus measured, GiB) of the trainer and producer device peaks (Tables 8 and 7), where the producer's constants are fitted on all 8 runs and the second column predicts each MoE family from the others (the 2 dense runs fix their own constants); the colocated rows are verdicts (fits or OOM) and peaks or OOM points (Table 18), where the fit rows are those that set a constant; traffic is the deviation of the counters from the calculation (Tables 14 and 1). The trainer's 13 runs outside the fit include the 2 runs with all 3 parts of the cache release (CR all; Appendix D.1), of which the reading, 79.6 GiB, is at the device limit.
whose prediction was recorded before its run (Table 8).
Colocated verdicts and peaks. The model classifies 17 of the 18 colocated configurations outside its fit correctly and 5 of the 6 that set constants (OOM or fits; Table 18). The 2 exceptions are the Qwen3.5 Bal-L+K run, a fit row that peaks at 79.1 GiB and is predicted 79.6, and the Nemotron run on 4 nodes at tp8/pp1/cp4, which ran OOM in the teacher's first forward pass although the model predicts a device peak of 63.0 GiB. The measured demand at the failing allocation is 75.7 GiB against 59.9 predicted, and the model has no second tp 8 teacher run to calibrate the teacher's forward-pass terms. Outside the fit, the model predicts the peaks of 9 runs to within 3.0 GiB (Table 18); the largest errors, -3.0 and -2.8 GiB, are the Qwen3-235B runs on 2 and 4 nodes, which ended with a NaN gradient in their first iteration, before the optimizer step: the model evaluates them without Adam moments and with the 3.1 GiB non-PyTorch memory of that iteration.
The Llama colocated bound. For the 405B-to-70B pair the model evaluates every colocated grid from 8 to 32 nodes with TP at most 8, the student's number of key-value (KV) heads, and PP dividing 2 (the layer counts are 80 and 126). The lowest-peak grid at 8, 16, 24, 28, and 32 nodes is predicted at 89 to 102 GiB, over the budget, and the other node counts have higher minima or no legal grid, so none was run (Table 18). Megatron-Core also allows TP above the KV head count by replicating the heads, as the producer does at 16. With tp=32 the colocated layout fits on 16 nodes and on 8, and the model predicts both within 1.2 GiB of the torch-allocated peak without any Llama measurement in the colocated fit (the Llama trainer and producer are in their fits); node counts below 8 were not run.
Cache-release ceilings. The Qwen3-235B (2+1) trainer with CR all reserves 68.1 GiB and holds 11.5 GiB outside the allocator, with a device peak of 79.6 (Table 11), so its device reading is a ceiling; the (4+4) reading with CR all, 67.8, is a feasibility check for the same reason.
Trainer terms. 3 terms account for most of the spread of the trainer's remainder, the device peak after and (Table 10); Table 11 gives the measured memory of each trainer and Table 12 the probes of the terms. (1) Reference-cycle garbage. The trainer collects Python garbage at the iteration boundary only, so the allocation of the loss stage grows with every microbatch (Ramp in Table 11). The growth per microbatch is 0.70 to 0.97 of 3 sequence-parallel shards of the bf16 hidden states, bytes, on the 6 trainers where it was logged. On the Qwen3.5 (2+1) trainer, collecting after every microbatch lowers the end-of-iteration allocation by 11.8 GiB, as the model gives, and each iteration takes 57% longer (Table 12). (2) Temporary memory of the loss backward and of the recomputed layers. The fp32 head gradient has bytes, and the fused backward holds it in 2 to 3 copies (the accumulator, the matmul temporary, and the bf16 cast) next to 5 to 8 fp32 window tensors (the forward scan holds 1 per distribution), depending on the order of operations; we use 2.5 and 6, and over that range the standard deviation (SD) of the remainder is 1.1 to 1.6 GiB. The temporary memory measured on the Qwen3-4B student at TP 8 agrees with the terms (Table 12). Recomputing layers at once holds bytes per layer (Korthikanti et al., 2023), the count of a dense trans-
| Run (T+P nodes) | Replica | Shard | Pred. | Meas. | Err. | Resid. | Err., family left out |
|---|---|---|---|---|---|---|---|
| Qwen3.5 (2+1) | TP2, fp8 | 18.1 | 41.8 | 39.4 | +2.4 | 21.3 | +3.5 |
| Qwen3.5 (3+1) | TP2×EP2, fp8 | 10.4 | 34.1 | 32.0 | +2.1 | 21.6 | +3.2 |
| Qwen3-235B (2+1) | TP8, bf16 | 54.7 | 78.4 | 72.4 | +6.1 | 17.7 | +8.9 |
| Qwen3-235B (4+4) | TP8, bf16 | 54.7 | 78.4 | 73.3 | +5.2 | 18.6 | +8.0 |
| Nemotron (2+2) | TP8×EP2, fp8 | 38.6 | 62.3 | 69.6 | -7.3 | 31.0 | -11.2 |
| Nemotron (4+4) | TP8×EP2, fp8 | 38.6 | 62.3 | 70.7 | -8.4 | 32.1 | -12.3 |
| Llama (8+8) | TP16, bf16 | 47.3 | 65.4 | 65.4 | 0.0 | 18.2 | - |
| Qwen3-32B (1+1) | TP2, bf16 | 30.5 | 36.4 | 36.4 | 0.0 | 5.9 | - |
Table 7: Producer memory per GPU (GiB) of 8 of the 10 runs of Table 17. Shard: the whole checkpoint's per-rank weights, dense tensors in bf16 and routed experts in fp8 or bf16 as listed (Appendix A.1); Pred.: shard plus the forward-pass term (22.70 for MoE teachers; 4.4 plus 12.8 bf16 buffers of for dense ones, at the sequence length of the run: 32768, and 4096 for Qwen3-32B) plus the 1 for NCCL buffers; Meas.: device peak; Err.: predicted minus measured; Resid.: measured minus shard; Err., family left out: the error when the forward-pass term is fitted on the other families (not defined for the 2 dense teachers, whose 2 parameters the 2 dense runs fix). The Qwen3-235B (2+1) row uses the 72.4 of an earlier run of that configuration; the run of Table 17 reads 72.9.
| Trainer | Grid | S | Pred. | Meas. | Err. | Use | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3.5 (2+1) | 2/2/2/2 | 64 | 18.8 | 1.1 | 12.0 | 8.6 | 0.0 | 55.8 | 57.1 | -1.3 | fit |
| Qwen3.5 (3+1) | 2/2/2/3 | 42 | 16.7 | 1.1 | 7.9 | 8.6 | 0.0 | 49.6 | 50.3 | -0.7 | fit |
| Qwen3.5 (2+1), tp4 | 4/2/2/1 | 128 | 12.5 | 0.7 | 12.0 | 4.3 | 0.0 | 44.9 | 45.1 | -0.2 | fit |
| Qwen3-32B (1+1), seq 4096 | 2/2/1/2 | 64 | 12.3 | 1.2 | 1.9 | 10.1 | 0.0 | 40.8 | 40.3 | +0.5 | fit |
| Llama (8+8) | 8/2/2/2 | 64 | 37.0 | 2.0 | 6.0 | 3.2 | 0.0 | 63.5 | 61.0 | +2.5 | fit |
| Nemotron (2+2) | 2/2/1/4/4 | 32 | 47.4 | 2.8 | 7.9 | 4.5 | 2.5 | 80.4 | 79.6 | +0.8 | fit |
| Nemotron (4+4) | 2/2/1/8/4 | 16 | 35.9 | 2.8 | 3.9 | 4.5 | 2.5 | 65.0 | 65.4 | -0.4 | fit |
| Qwen3-235B (4+4), ep8 | 2/2/1/8/8 | 16 | 23.0 | 1.6 | 3.0 | 9.5 | 3.8 | 56.1 | 57.4 | -1.3 | fit |
| Qwen3-235B (2+1) | 2/2/1/4/4 | 32 | 43.8 | 1.3 | 6.0 | 9.5 | 3.8 | 79.6 | 79.6 | 0.0 | ceiling |
| Qwen3-235B (4+4) | 2/2/1/8/4 | 16 | 33.1 | 1.3 | 3.0 | 9.5 | 3.8 | 66.0 | 67.8 | -1.8 | ceiling |
| Qwen3.5 (4+2) | 2/2/2/4 | 32 | 15.6 | 1.1 | 6.0 | 8.6 | 0.0 | 46.7 | 47.5 | -0.8 | held out |
| Qwen3.5 (4+2), pp4 | 2/4/2/2 | 64 | 11.5 | 1.1 | 12.0 | 8.6 | 0.0 | 48.6 | 49.5 | -0.9 | held out |
| Qwen3.5 (4+2), cp4 | 2/2/4/2 | 64 | 15.6 | 0.9 | 6.0 | 8.1 | 0.0 | 46.0 | 48.3 | -2.4 | held out |
| Qwen3.5 (3+1), seq 8192 | 2/2/2/3 | 168 | 16.7 | 0.8 | 7.9 | 7.8 | 0.0 | 48.5 | 48.3 | +0.2 | held out |
| Qwen3.5 (4+2), pp4/cp4, seq 8192 | 2/4/4/1 | 512 | 11.5 | 0.8 | 12.0 | 7.7 | 0.0 | 47.3 | 49.1 | -1.8 | held out |
| Qwen3.5 (2+1), collected | 2/2/2/2 | 64 | 18.8 | 1.1 | 0.2 | 8.6 | 0.0 | 44.0 | 44.8 | -0.8 | held out |
| Qwen3.5 (4+1), pp4/cp4 | 2/4/4/1 | 128 | 11.5 | 0.9 | 12.0 | 8.1 | 0.0 | 47.8 | 51.8 | -4.0 | held out |
| Qwen3-32B (1+1), seq 8192 | 2/2/1/2 | 32 | 12.3 | 1.3 | 1.9 | 11.4 | 0.0 | 42.3 | 42.6 | -0.4 | held out |
| Qwen3-32B (1+1), seq 16384 | 2/2/1/2 | 16 | 12.3 | 1.6 | 1.9 | 14.1 | 0.0 | 45.2 | 45.2 | 0.0 | held out |
| Qwen3-32B (1+1), seq 32768 | 2/2/1/2 | 8 | 12.3 | 2.0 | 1.9 | 19.4 | 0.0 | 50.9 | 49.0 | +2.0 | held out |
| Qwen3-235B (2+1), collected | 2/2/1/4/4 | 32 | 43.8 | 1.6 | 0.2 | 9.5 | 3.8 | 74.1 | 75.3 | -1.2 | held out |
Table 8: Terms of the trainer memory model (4) and the measured device peak of the trainer runs the model uses (GiB). Grid: tp/pp/cp/dp, with ep appended for MoE students; sequence length 32768 unless stated; : microbatches per DP replica. Pred.: the 5 terms shown plus ; Meas.: device peak, the maximum over the trainer GPUs; Err.: predicted minus measured. Use: fit (the 8 runs whose mean remainder is ), held out (outside that mean; the term forms were chosen with their residuals visible), or ceiling (CR all, Table 27: the device reading is an allocator ceiling). Collected: Python's garbage collected after every microbatch. The Qwen3-235B pair rows are the 30B student; the Qwen3-235B (2+1), collected row was predicted at 73.8 before its run, 0.3 below this value, which adds the fp8 head copy of its configuration. Teacher precision: the Qwen3-235B (4+4), ep8 and (2+1), collected rows are fp8-teacher runs outside Table 17; the 2 ceiling rows are bf16.
former, used for every student ( except in the 4 Qwen3-32B-pair trainer runs, where ). (3) The expert-layer block of MoE students. Across the optimizer step their first pipeline stage holds more than its statics (Stage 1 in Table 11). An allocation dump of the Qwen3-30B trainer (1 run) attributes this to tensors that stay live across the boundary: the retained autograd graph, the bias-dropout activations, and the dispatch row maps and workspaces (Table 12), about 2.5 bf16 copies of per expert layer. The model applies 2.5 such copies to the expert layers of the loss stage (); the 2.5 is calibrated on 1 Qwen3-30B dump, at tp 2 and cp 1. The remaining is memory outside PyTorch and unallocated memory that the caching allocator holds reserved (Table 11), and it contains the layer inputs saved for the recomputation, which no other term counts (1.0 GiB on the loss stage
| Configuration | Pred. | Measured | Use |
|---|---|---|---|
| Coloc., 3 nodes, cp1 | 86.8 | OOM, 72.9+15.2 | held out |
| Coloc., 4 nodes, cp1 | 86.4 | OOM, 72.4+15.2 | fit |
| Coloc., 4 nodes, cp2 | 78.3 | OOM, 71.4+7.6 | fit |
| Coloc., 4 nodes, cp4 | 75.8 | 76.1 | fit |
| Coloc., 4 nodes, cp4, Bal-L+K | 79.6 | 79.1 | fit |
| Coloc., 4 nodes, cp8 | 77.3 | 77.0 | held out |
| Coloc., 4 nodes, cp4, SQ-L+K | - | 76.8 | outside |
| Coloc., 4 nodes, cp4, SQ-L+K fused | - | 58.7 | outside |
| Coloc., 3 nodes, cp1, SQ-L+K fused | - | OOM, 57.7+15.2 | outside |
| Coloc., 3 nodes, cp1, SQ-L+K fused-W | - | 78.9 | outside |
| Coloc., 2 nodes, cp2, SQ-L+K fused-W | - | 65.8 | outside |
| Coloc., 2 nodes, cp1, SQ-L+K fused-W | - | OOM, 64.9+0.5 | outside |
| Disagg. (2+1), trainer | 55.8 | 57.1 | fit |
| Disagg. (3+1), trainer | 49.6 | 50.3 | fit |
| Disagg. (tp4), trainer | 44.9 | 45.1 | fit |
| Disagg. (4+1, pp4, cp4), trainer | 47.8 | 51.8 | held out |
| Disagg. (2+1, collected), trainer | 44.0 | 44.8 | held out |
| Disagg. Qwen3-30B (2+1, collected), trainer | 74.1 | 75.3 | held out |
| Disagg. (2+1), producer | 41.8 | 39.4 | fit |
| Disagg. (3+1), producer | 34.1 | 32.0 | fit |
Table 9: Predicted (Pred.) memory demand and measured peak per GPU (GiB) on the Qwen3.5 pair (and 1 Qwen3-30B trainer); Use: whether the row set a constant of the model (fit), not (held out), or is outside the model because its loss is not ModelOpt's (outside). OOM rows compare the predicted demand at the failing allocation with the measured bytes allocated plus requested; all other rows are device peaks (torch-allocated trainer peak 39.2). The colocated cp4 rows fix the non-PyTorch memory and the logits-buffer count, the trainer rows the trainer remainder , and the producer rows the forward-pass term (Appendix A.1); “collected” is the (2+1) trainer with Python’s garbage collected after every microbatch. Tables 18, 8, and 7 list all calibration points.
at (2+1)). On the Qwen3.5 tp-4 trainer, turning NVLink SHARP (NVLS) multicast off changes the device peak by -0.3 GiB and loading kernels eagerly by +1.7 (Table 12); neither probe was run on another family. Memory outside PyTorch differs between families by more than the residuals do; the 8 trainers come from 4 student families, which do not separate family from model dimensions. At cp 4 the held-out Qwen3.5 trainers hold more memory outside PyTorch than at cp 2 (Table 11) and are the
| Remainder after subtracting | Mean | SD | LOO | LOFO |
|---|---|---|---|---|
| 29.91 | 4.7 | 5.1 | 5.7 | |
| and | 23.09 | 4.1 | 4.4 | 4.5 |
| and | 16.41 | 2.3 | 2.4 | 2.4 |
| and | 15.32 | 1.3 | 1.4 | 1.4 |
Table 10: Remainder of the device peaks (GiB) of the 8 fitted trainers after the terms listed are subtracted cumulatively: its mean, SD, and the RMS error of predicting each trainer by the mean of the others (LOO) or of the other model families (LOFO). The last row is and its spread.
3 most under-predicted of the 7 (Table 8).
A.2 Traffic Model
Data-movement derivations. Table 13 lists the volume of each parallelism dimension with its Qwen3.5 values (, , , , , ), and Table 1 sums them with the transfer. The tables hide 3 points: (1) in the Qwen3.5 architecture every 4th layer is full attention: CP exchanges the keys and values of those layers around a ring (Liu et al., 2024), and the remaining linear-attention layers redistribute their input projection from sequence to head sharding, and their output back, by all-to-all, as Megatron-Bridge implements it; (2) gradients are reduced over the DP×CP group, so the student's gradient traffic is nonzero at dp=1 when cp > 1; (3) a ring over a group that spans several nodes sends of its bytes over InfiniBand at each node boundary of the ring, and the transfer multiplies the hidden-state volume by tp because the sender transmits the rows of each cp rank to its tp last-stage ranks.
Traffic validation. Table 14 compares the calculated inter-node bytes of every node with its measured InfiniBand traffic (for the disaggregated runs the node's total rate over its adapters, averaged over the 5 s samples from iteration 3, checkpoint iterations excluded, times the mean iteration time; for the colocated run the byte counts of the 8 adapters that carry the traffic, read at the ends of iterations 2 and 12; Table 1 divides the bytes by 90.5 s for colocated KD-only, the median iteration time of its 200-iteration run, and by 76.0 s, iterations 3 to 400, for the 400-iteration run of the (2+1) split that carried the counters (not a row of Table 17), whose measured rate is the mean received rate from iteration 3), placing ranks in Megatron's order (tp, cp, dp, pp) on 8-GPU nodes. On the colocated run each node is 1 pipeline stage, only the pipeline
| Trainer | Device | Torch | Reserved | Non-PyTorch | Unallocated | End of iter. | Stage 1 | Ramp | |
|---|---|---|---|---|---|---|---|---|---|
| Qwen3.5 (2+1) | 57.1 | 39.2 | 43.1 | 13.9 | 3.8 | 31.8 | +0.3 | 11.6 | 12.0 |
| Qwen3.5 (3+1) | 50.3 | 33.0 | 36.6 | 13.4 | 3.6 | 25.6 | - | - | 7.9 |
| Qwen3.5 (2+1), tp4 | 45.1 | 29.0 | 31.1 | 14.0 | 2.1 | 25.1 | - | 11.7 | 12.0 |
| Qwen3-32B (1+1) | 40.3 | 25.1 | 28.8 | 11.5 | 3.7 | 15.6 | +0.2 | 1.7 | 1.9 |
| Llama (8+8) | 61.0 | 50.3 | 52.7 | 7.8 | 2.4 | 43.8 | +0.2 | - | 6.0 |
| Nemotron (2+2) | 79.6 | 67.5 | 69.8 | 9.7 | 3.6 | 59.3 | +2.2 | - | 7.9 |
| Nemotron (4+4) | 65.4 | 52.5 | 54.2 | 9.5 | 4.2 | 43.8 | +2.2 | - | 3.9 |
| Qwen3-235B (4+4), ep8 | 57.4 | 40.7 | 46.0 | 11.3 | 5.3 | 30.5 | - | 2.6 | 3.0 |
| Qwen3-235B (2+1), CR all | 79.6 | 64.3 | 68.1 | 11.5 | 3.8 | 54.1 | +3.7 | 5.1 | 6.0 |
| Qwen3-235B (4+4), CR all | 67.8 | 50.7 | 56.1 | 11.2 | 5.5 | 40.4 | +3.7 | 2.1 | 3.0 |
| Qwen3.5 (4+2) | 47.5 | 30.1 | 33.6 | 13.9 | 3.5 | 22.7 | - | - | 6.0 |
| Qwen3.5 (4+2), pp4 | 49.5 | 31.5 | 35.2 | 14.3 | 3.7 | 24.6 | - | - | 12.0 |
| Qwen3.5 (4+2), cp4 | 48.3 | 29.5 | 32.4 | 15.9 | 2.9 | 22.7 | - | - | 6.0 |
| Qwen3.5 (3+1), seq 8192 | 48.3 | 32.1 | 34.9 | 13.4 | 2.8 | 25.6 | - | - | 7.9 |
| Qwen3.5 (4+2), pp4/cp4, seq 8192 | 49.1 | 30.8 | 33.2 | 15.8 | 2.4 | 24.6 | - | - | 12.0 |
| Qwen3.5 (2+1), collected | 44.8 | 27.7 | 30.8 | 13.9 | 3.1 | 20.0 | - | - | 0.2 |
| Qwen3.5 (4+1), pp4/cp4 | 51.8 | 31.1 | 36.7 | 15.2 | 5.6 | 24.6 | - | - | 12.0 |
Table 11: Measured memory of the 8 fitted trainers, the 2 runs with CR all, and the 7 Qwen3.5 trainers outside the fit (below the rule; GiB), on the last pipeline stage. Device: peak device memory, the maximum over the trainer GPUs; Torch: peak allocated (the maximum over the trainer GPUs for the 2 Nemotron rows); Reserved: peak reserved; Non-PyTorch: device memory minus reserved on the last-stage rank; Unallocated: reserved minus peak allocated (Device is a maximum over the trainer GPUs and the other columns are logged on 1 last-stage rank, so a row need not add up); End of iter.: allocation after the iteration; Stage 1: steady allocation of the first pipeline stage minus its statics (not logged for 3 runs and the held-out trainers); Ramp: growth of the allocation over the microbatches of an iteration, from the per-microbatch memory log (not logged for 4 runs and the held-out trainers); : the model's garbage term.
| Probe | Trainer grid | s/it | Torch | Device | NCCL | Comms | Measured; model |
|---|---|---|---|---|---|---|---|
| Qwen3.5 (2+1), garbage kept | tp2/pp2/cp2/dp2 | 74.3 | 39.2 | 57.1 | - | - | end of iter. 31.8 |
| Qwen3.5 (2+1), collected | tp2/pp2/cp2/dp2 | 116.9 | 27.7 | 44.8 | - | - | end of iter. 20.0; -11.8 |
| Qwen3.5 (2+1), tp4, reference | tp4/pp2/cp2/dp1 | 97.0 | 29.0 | 45.1 | 59.6 (3.73) | 17 | - |
| NVLS multicast off | tp4/pp2/cp2/dp1 | 98.2 | 29.0 | 44.8 | 59.6 (3.72) | 17 | - |
| eager kernel loading | tp4/pp2/cp2/dp1 | 100.2 | 29.0 | 46.8 | 59.6 (3.72) | 17 | - |
| Qwen3-32B (1+1), tp2 | tp2/pp2/cp1/dp2 | - | 25.1 | - | 38.2 (4.78) | 19 | - |
| Qwen3-32B (1+1), tp8 | tp8/pp1/cp1/dp1 | 34.7 | 11.8 | 23.2 | 23.2 (2.90) | 19 | temporary memory 2.56; 2.52 |
| Qwen3-235B (2+1), collected | tp2/pp2/cp1/dp4, ep4 | 402-405 | 59.6 | 75.3 | - | - | retained set 3.57; 3.75; statics 43.75; 43.76 |
Table 12: Probes of the trainer memory terms (GiB; -: not measured), all with CR – (Table 27). Torch: peak allocated; Device: peak device memory; NCCL: all communicator buffers over the trainer ranks, per rank in parentheses; Comms: communicators per rank. Collected: Python's garbage collected after every microbatch, which lowers the end-of-iteration allocation by 11.8 GiB against the garbage-kept run, equal to of the same grid (calibrated on its ramp). Temporary memory: peak minus end-of-iteration allocation against the term (Qwen3-4B student); retained set: tensors alive across the optimizer step (autograd graph 1.50, bias-dropout activations 1.44, dispatch maps and workspaces 0.63) against (the family that calibrates its 2.5 copies); statics: the allocation dump against S. Qwen3-235B (2+1), collected is the 30B student with the 235B teacher.
crosses InfiniBand, and every counter is within 1.4% of the calculation; ModelOpt concatenates the teacher's hidden width to the student's in the pipeline tensor, so the teacher's activation-sized bytes cross each boundary in both directions. At 3 nodes the tensor, context, and data groups stay inside the nodes, so only the pipeline activation transfers and the transfer cross InfiniBand, and every counter is within 2% of the calculation. At 4 nodes the ring of each DP×CP group also spans
| Dimension | Teacher (forward) | Student (training) | Qwen3.5 (GB; student; teacher) | |
|---|---|---|---|---|
| colocated | disaggregated | |||
| Tensor | 412.3; 85.9 | 824.6; 343.6 | ||
| Pipeline, per boundary and direction | 4.29; 2.15 | 4.29; 0 | ||
| Context, attention | 51.5; 8.1 | 34.4; 0 | ||
| Context, linear attention | 232.8; 97.0 | 310.5; 0 | ||
| Data and context | none | 5.0; 0 | 10.1; 0 | |
| Expert | 0; 0 | 0; 2061.6 | ||
Table 13: Bytes sent per GPU and iteration by parallelism dimension, with the values on the Qwen3.5 pair (4 nodes colocated, 3 disaggregated; the disaggregated teacher is the producer). A dimension of degree and rank stride spans ranks and uses NVLink if (the GPUs of a node) and InfiniBand at its node boundaries otherwise; the strides are 1 (tensor), tp (context, and data at ep=1), tp cp (expert), and tp cp ep dp (pipeline). The factors 2 and 6 are 2 all-reduces per layer times the teacher's 1 forward pass or the student's 3 passes (forward, recompute, backward); 3 and 4 count passes (the ring attention (Liu et al., 2024) backward exchanges keys and values and their gradients, hence 4). , , and count full-attention, linear-attention, and MoE layers, the KV heads, the head width, and the per-token width of the linear-attention exchange of the Qwen3.5 layers (12,352 for the input projection of , , , gate, and 2 scalars per head, 4,096 for the output). The expert term counts every routed copy of a token: the all-to-all over the EP group and, at etp > 1, the dispatch all-gather in bf16 and the combine reduce-scatter in fp32 over the expert tensor-parallel group; it is 0 at ep=1 and etp=1. Gradients are reduced in fp32 (4 bytes) and parameters gathered in bf16 (2 bytes).
nodes, and its gradient and parameter traffic is 1.0 to 2.0 times the pipeline's; the calculation stays within 2% and below every counter. NVLink counters (bytes sent per GPU over iterations 3 to 12, and 3 to 10 for the disaggregated trainer and producer) lie above the calculation on the colocated run (4.4%, with the 4 pipeline stages within 3% of each other; the counter snapshots lie within 1 iteration of the stated boundaries), the disaggregated trainer, and the producer (Table 1; Table 6 gives the deviations). The producer's tensor term, 344 GB, is within 1.4% of the volume of its small all-gather and reduce-scatter pairs (339 GB); the other 86% of the calculated bytes are the expert term, the dispatch all-gather and the fp32 combine reduce-scatter over the expert tensor-parallel group, which move the top-8-replicated tokens of every MoE layer, and the combine reduce-scatter alone carries 57% of the calculated collective bytes. The NVLink counter reproduced a 2-GPU all-reduce, a 4-GPU all-to-all, and a send/receive of known size within 0.4% on 1 node; the InfiniBand counters were not calibrated this way.
| Node | Sent calc. meas. | Received calc. meas. | Sent: pipe.+ring | ||
|---|---|---|---|---|---|
| 3 nodes (dp2) | |||||
| Stage 0 | 34.4 | 34.8 | 34.4 | 34.8 | 34.4+0 |
| Last stage | 34.4 | 34.9 | 68.7 | 69.6 | 34.4+0 |
| Producer | 34.4 | 34.8 | 0 | 0.1 | |
| 4 nodes (dp3) | |||||
| Node 0 | 44.9 | 45.5 | 44.9 | 45.4 | 22.5+22.4 |
| Node 1 | 67.3 | 68.0 | 78.6 | 79.4 | 22.5+44.8 |
| Node 2 | 44.9 | 45.1 | 67.5 | 67.9 | 22.5+22.4 |
| Producer | 33.8 | 34.2 | 0 | 0.1 | |
| 4 nodes colocated (pp4, dp1) | |||||
| Stage 0 | 51.5 | 52.1 | 51.5 | 52.2 | 51.5+0 |
| Stage 1 | 103.1 | 104.3 | 103.1 | 104.2 | 103.1+0 |
| Stage 2 | 103.1 | 104.2 | 103.1 | 104.2 | 103.1+0 |
| Last stage | 51.5 | 52.1 | 51.5 | 52.1 | 51.5+0 |
Table 14: Inter-node traffic per node and iteration (GB): calculated and measured, and the calculated split of the sent bytes into pipeline activation transfers and DP×CP rings. Received bytes at the trainer's last-stage nodes include the transfer. Colocated: 1 pipeline stage per node, iterations 3 to 12.
B Method Details
B.1 Streaming Pipeline
Receiver groups and replication. A receiver group is the tp × cp last-stage ranks of one DP replica, so a trainer has dp receiver groups. Rows are divided over the cp ranks in Megatron’s load-balanced layout for causal attention (Llama Team, 2024): cp rank q owns pieces q and 2 cp - 1 - q of 2 cp equal pieces of the sequence (the layout that ring-attention implementations call zigzag), and slots are sent in bf16. The producer serves receiver groups in 2 layouts. In the dedicated layout (replicas ≥ groups, a multiple of dp) each replica serves exactly 1 group and each group is served by R/dp replicas; in the shared layout (replicas < groups) every replica joins every group and sends 1 message per slot per destination rank. Slot η goes to group η mod n_groups from replica η mod R at microbatch size 1. The Qwen3.5 3-node run is dedicated and its 4-node run shared.
Communication protocol. Each receiver group has its own NCCL communicator containing the group’s last-stage ranks and the producer ranks mapped to it, so each communicator contains only the ranks of 1 receiver group and its producer ranks. A slot is an int64 header carrying the slot id followed by the bf16 payload , already sliced to the cp rank’s share of the rows; per-pair FIFO order and the header check make ordering structural, and the trainer raises on any slot-id mismatch. The producer runs at most iterations ahead of the trainer’s consumption counter, receive buffers are posted at request creation, and the prefetch ring holds up to 4 slots per last-stage rank by default. Only a 128-byte communicator id per receiver group crosses the rendezvous store, and every hidden-state byte flows over InfiniBand P2P. The lm_head weights are written once to a file in the stream directory, and V must be divisible by tp. The trainer’s step for 1 microbatch is Algorithm 2, and the producer loop is Algorithm 1.
Resume. The producer takes a start slot so that it neither recomputes nor re-sends the prefix the trainer has consumed, and logs the start slot; unit tests check the slot arithmetic of a resume. The window width C does not change the loss in exact arithmetic; it sets the size of the per-window buffers, which scale with .
Pace-limiting side. Each producer replica logs its cumulative token count; the mean rate between the 5th and the last report is the consumed rate. Because a windowed pipeline equalizes the mean rates of producer and trainer, the consumed rate agrees with within 4% in Input: teacher replica, corpus order, look-ahead iterations, start slot
1 load the teacher shard (routed experts in fp8 for the Qwen3.5 and Nemotron teachers, bf16 otherwise); write the lm_head shards once
2 for do
3 if my replica then
continue
4 forward of microbatch (final hidden states)
5 wait until
6 slice rows per last-stage rank; send header and payload to the receiver
group
7 end for
Algorithm 1: Producer loop of one replica.
all runs and does not show which side limits. We therefore also measure the forward-only rate of one replica and compare the producer-only time with the measured iteration time (Table 15). For the Qwen3.5 runs we measured with the producer writing to a sink on idle nodes with a warm page cache (the steady rate of slots after the first); for the Qwen3-235B runs we took the steady forward time per slot that each replica logs, and for the other pairs the mean forward time of the first slots of the run. The duty, the ratio of the 2 times, is 1 when the producers limit and below 1 when the trainer does, because the transfer of the Qwen3.5 pair takes 0.09 s per iteration at the link limits (Table 1). The producers limit the Qwen3-235B and Nemotron runs and the Llama (8+8) training run; for Nemotron and Llama is the first-slot forward rate, so their duty of 1 is an upper bound, and the Llama training run's was read on a shared network (the pace check's 6.1 gives it a duty of 0.92). At constant the iteration time falls with the replica count R. The trainer limits every run with a duty below 1, among them the Qwen3.5 (2+1) run, the first (3+1) run (duty 0.90), the Qwen3-32B run, the Llama (4+2) run, and the Llama (8+8) pace check, whose replicas consumed less than their forward-only rate; the (3+1) rerun has duty 0.97 and the seed-43 run with CR – duty 1, so the (3+1) split is balanced within 10%. The forward-only rate of the TP2×EP2 fp8 replica of the Qwen3.5 producers is the same on all 8 nodes measured (32.6 to 32.9k tokens/s). The seed-43 run with CR all is limited by the trainer, and with CR – by the producers (Table 15).
| Pair (T+P nodes) | R | Consumed | Meas. | Duty | Limit | CR | ||
|---|---|---|---|---|---|---|---|---|
| Qwen3.5 (1+1), 15 it. | 4 | 3.7 | 28.1 | 37 | 283.7 | 0.13 | trainer | - |
| Qwen3.5 (2+1) | 4 | 13.8 | 28.1 | 37 | 74.3 | 0.50 | trainer | - |
| Qwen3.5 (3+1) | 2 | 29.5 | 32.8 | 63 | 69.9 | 0.90 | trainer | - |
| Qwen3.5 (3+1), rerun | 2 | 31.4 | 32.8 | 63 | 65.0 | 0.97 | trainer | - |
| Qwen3.5 (3+1), seed 43 | 2 | 20.1 | 32.8 | 63 | 99.4 | 0.63 | trainer | all |
| Qwen3.5 (3+1), seed 43, 30 it. | 2 | 33.2 | 32.8 | 63 | 61.9 | 1.0 | producer | - |
| Qwen3.5 (3+1), seed 43, 30 it. | 2 | - | 32.8 | 63 | 94.4 | 0.67 | trainer | all |
| Qwen3.5 (2+1), bf16 teacher | 2 | 13.6 | 34.7 | 60 | 153.0 | 0.40 | trainer | all |
| Qwen3-235B (2+1) | 1 | 10.6 | 10.7 | 393 | 392.9 | 1.0 | producer | all |
| Qwen3-235B (4+4) | 4 | 9.3 | 9.6 | 109 | 108.5 | 1.0 | producer | all |
| Nemotron (2+2) | 1 | 6.7 | 6.6 | 631 | 630.0 | 1.0 | producer | - |
| Nemotron (4+4) | 2 | 6.6 | 6.6 | 316 | 315.9 | 1.0 | producer | - |
| Llama (8+8), training run | 4 | 5.6 | 5.6 | 188 | 186.1 | 1.0 | producer | - |
| Llama (8+8), pace check | 4 | 4.5 | 6.1 | 173 | 234.8 | 0.74 | trainer | all |
| Llama (4+2) | 1 | 5.1 | 6.7 | 627 | 818 | 0.77 | trainer | all |
| Qwen3-32B (1+1) | 4 | 9.6 | 10.4 | 13 | 13.5 | 0.93 | trainer | - |
Table 15: Which side limits the iteration time (T+P: trainer and producer nodes; R: producer replicas). Consumed: mean per-replica rate between the 5th and the last report of the producer logs; : forward-only rate of one replica, both in tokens/s; : the iteration time if the trainer were instantaneous; Meas.: measured median iteration time, both in seconds; Duty: over Meas., capped at 1; CR: the parts of the cache release that were on (Table 27). The producers limit a run when the duty is 1 (the trainer is then at least as fast) and the trainer limits it when the duty is below 1. Rerun: the 3+1 run of Table 4 repeated for 12 iterations (65.0 s against 69.9 s, 7%). Each row is 1 run.
Input: student hidden states , prefetch ring, shards , , labels y, window size C
1 pop the next slot from the ring; post receives for up to 4 following slots of the same iteration
2 for do
3 for
4 kernel: for each row, one pass over the entries in tiles gives and
5 MAX all-reduce of ; rescale; SUM all-reduce of over the tp ranks; the label logit of comes from a separate vocabulary-parallel pass
6 over the rows of window ; free
7 end for
8 backward: recompute each window; accumulate and
Algorithm 2: Streamed KD step for one microbatch at cell (§4.2).
B.2 Teacher Precision
In the producer. The producer runs the teacher forward only, without gradients, optimizer state, or backward activations, so its weights and a fitted remainder (forward-pass workspace, CUDA context, allocator) fill its memory. It holds the routed experts of the Qwen3.5 and Nemotron teachers in fp8 and every other module (attention, mamba mixers, latent projections, norms, embeddings) in bf16; the shared experts are bf16 on GPT-path teachers and fp8 on the hybrid Nemotron teacher. The routed experts are most of an MoE teacher's parameters (546.7B of 560.4B for the Nemotron teacher), so the shard is 51% of its bf16 size. For the 560B teacher the model predicts that bf16 everywhere does not fit a 16-GPU replica: about 65 GiB per GPU for weights alone, plus the 31 to 32 GiB remainder measured with fp8 (no bf16 run of this teacher exists). The experts are stored as fp8 primary weights (e4m3 with tensor-wise scales), their grouped GEMMs run under Transformer Engine's current-scaling fp8 autocast, and activations, including the hidden states sent to the trainer, stay bf16. The Qwen3-235B producers and those of the dense Llama and Qwen3-32B teachers are bf16 throughout, which is why the shard term of (5) counts 1 byte per routed-expert parameter of an fp8 teacher and 2 otherwise. On the trainer, the teacher-logit matrix product can also run in fp8 (e4m3 inputs with per-tensor scales), which leaves the hidden states sent to the trainer in bf16; it was on in the Qwen3.5 runs with an fp8 teacher, the Nemotron and Qwen3-32B runs, and the 2 Qwen3-235B trainers of Table 8 with of 1.6, and off in the Qwen3.5 run with a bf16 teacher, the other Qwen3-235B runs, and the Llama runs.
The fp8 build changes the stock provider in 4 ways: (1) the quantization recipe is set on the teacher's model provider and matched to the expert modules by name; (2) the mixed-precision wrapper is skipped, because it casts the fp8 parameters back
| Experts | s/it | Torch | KD loss, it. 1, 2, 3 | Grad norm, it. 1, 2, 3 |
|---|---|---|---|---|
| bf16 | 100.3 | 61.7 | 0.215, 0.207, 0.207 | 0.70, 0.70, 1.04 |
| fp8 | 119.1 | 55.9 | 0.215, 0.207, 0.795 | 0.70, 0.70, 14.5 |
Table 16: Colocated KD-only runs of the Qwen3.5 pair on 4 nodes (tp2/pp4/cp4/dp1, 32768 tokens, 12 iterations) with the teacher's routed experts in bf16 or fp8 (Appendix B.2). s/it: median over iterations 3 to 12; Torch: peak allocated in GiB after iteration 1. From iteration 4 to 12 the KD loss is 0.505 to 0.665 with fp8 against 0.249 to 0.290 with bf16, so the 2 s/it values do not compare precisions.
to bf16; (3) the expert modules of GPT-path models are given module names, because the recipe matches modules by name and an unnamed build constructs every expert in bf16; (4) the checkpoint is cast into the fp8 parameters on load, with the scale tensors of a native-fp8 release applied first, and the CPU copies of the initial values that the fp8 parameters keep are released after the load. No run isolates a single change.
In the colocated stack. The colocated runs use none of this engineering. Megatron-Bridge's distillation provider builds their teacher in bf16, and loading a native-fp8 release through it drops the scale tensors in the families we ran. Giving the colocated stack an fp8 teacher means doing the same on the teacher's provider: setting the recipe and skipping the wrapper, naming the experts, and casting the pre-converted bf16 checkpoint into fp8 parameters on load. We implemented it for the routed experts: the build engages and the peak allocated memory falls by 5.8 GiB, but the colocated run's KD loss leaves the bf16 run's at iteration 3 (Table 16). The recipe covers routed experts only, so the dense Llama and Qwen3-32B teachers stay in bf16.
B.3 Proof of Exactness
We prove Theorem 1 for dividing , 2 cp dividing , and tp dividing . A row has logits (§4.2). For a set of its columns define the statistics
with for the empty set. Then (10) is the case of all columns, , and for nonempty .
Lemma 1 (Merge). Let be disjoint sets of columns with union , and let index the parts. Then
Proof. The maximum of a union is the largest of the maxima. Splitting the sum by part and inserting gives
and the inner sum is . The same computation with the weight and the teacher's maximum gives .
Lemma 2 (Scan). Let the columns of be read in consecutive tiles , and let the state after tile be the merge (14) of the state after tile with the statistics (13) of , starting from . Then the state after tile equals the statistics of . For tiles of 1 entry, write for , , and let , and be the state after entries , starting from , and ; this update is the recurrence
Whenever the maximum rises, the exponential factor on the previous sum rescales it to the new maximum, and this factor is at most 1.
Proof. We use induction on . The empty prefix has statistics . If the state after tile is the statistics of , Lemma 1 with shows that merging it with gives the statistics of . A column has statistics , and inserting them into (14) with gives (15).
Proof of Theorem 1. Statistics. Tp rank j scans the columns of its shard in any tiling, so by Lemma 2 its final state is the statistics of the shard. Lemma 1 applied to the tp shards yields the combination
(16)
so the all-reduced are the statistics of all V columns, that is, (10).
Loss values. With we have , and , so
These are (11) and the definitions in (9). Exactly 1 tp rank holds and the others contribute 0. (The implementation evaluates the LM term in a separate vocabulary-parallel log-softmax pass over the same window, which yields the same normalizer.)
Gradients. For a row, and , hence
This depends on the row only through the statistics and , which the backward pass regenerates (a MAX and a SUM all-reduce per distribution and window), so it obtains and from recomputed logits and the same values as a full-row evaluation. For window , tp rank holds the block of this gradient, and the chain rule through (8) gives
the latter being an all-reduce over the tp ranks.
Windows and cp ranks. L is a sum of per-row terms (9). Partitioning the rows first over the cp ranks and then into windows only regroups a finite sum, so the loss as a function of the hidden states and head weights, and its gradients, depend on neither C nor the sharding; the student’s forward pass, the loss mask, and the normalization lie outside the identity.
Remark. Theorem 1 is an identity in exact arithmetic. It does not cover the floating-point summation order, the trainer's fp8 teacher-logit product, the producer's fp8 expert weights, or the bf16 hidden-state transfer. ModelOpt and KDFlow minimize the full-vocabulary forward KL, which equals up to the teacher's entropy, under different loss weights, and NeMo-RL takes it over 8192 columns ( ), so the identity equates per-row loss functions and not recipes.
C Experimental Setup
Search space. Both layouts are searched as the optimal setting of §3 defines, over the same axes: tp over the sizes that the heads, key-value heads, hidden size, and Mamba groups admit and that we ran, pp over the divisors of the layer count, cp over 1 to 16 in powers of 2, ep over the divisors of the expert count, and dp the remaining factor, which divides the global batch (128, or 126 where dp is 3 or 7: the 3-, 6-, 24-, and 28-node colocated cells and the 4-node disaggregated run). A colocated cell (a pair on a number of nodes) uses 1 grid for both models, because ModelOpt requires the teacher at the student's tp, pp, and cp and has no interleaved pipeline; the search also gives both models one ep, the largest common divisor of the expert counts, with ep-pp dividing the GPUs. tp and pp are common to the 2 models (Qwen3.5 tp 1 to 2, Qwen3-235B 1 to 4, Nemotron 1 to 8, Llama 1 to 32). Across the 12 searched colocated cells of Table 18, a cell has 12 (Qwen3.5 on 3 nodes) to 305 (Nemotron on 8 nodes) grids. A disaggregated cell has a trainer grid over the student alone, replicas of the teacher spanning GPUs ( over the divisors of its heads and Mamba groups, up to 16, and 8 for Nemotron), and a split of the nodes between the 2 roles. The wire requires the number of replicas R to be a multiple of dp, or below dp at microbatch 1; the trainer and producer inequalities of §3.1 bound each role, and bounds R below. The Megatron-Bridge runs use microbatch 1, full activation recomputation, and 32768-token sequences unless the text or a table states otherwise.
Sharded data parallelism. The search of both layouts excludes fully sharded data parallelism (FSDP). In the Megatron-Bridge release we use, the
Megatron-FSDP device mesh reshapes the world as (dp-cp, ep, tp) with no pipeline axis, and setup raised an error at pp 2 and 4 on MoE students. Every trainer grid of Table 17 has pp 2, and the only colocated grids of the primary pair on 4 nodes that the model predicts under the budget (2 of 31) have pp 4 and pp 2 (Table 18); these counts come from the memory model without a sharded-state term, and FSDP at pp 1 was not run. The producer holds weights alone, split over ranks. KDFlow trains the student with FSDP2 and NeMo-RL with its DTensor policy, which wraps it with FSDP2, and on the primary pair KDFlow's device reading is at the limit and NeMo-RL's 2.1 GiB below it (79.1 and 77.0 GiB, sampled device memory; Table 19): KDFlow with the idle teacher offloaded and the loss chunked, NeMo-RL at a quarter of the batch, because its full-vocabulary logits buffer, 121 GiB at the full batch, does not fit. At cp 1 the logits buffers are 144 of the 186 GiB of the colocated peak on 3 nodes (Figure 1), memory that sharding the states does not reduce (the buffers shrink with cp).
C.1 Disaggregated Runs
Training recipe. Model sizes in Table 3 are config-derived (the Nemotron release name reads 550B). Each GPU reports 79.65 GiB to the driver, of which 79.11 GiB is allocatable by CUDA (the capacity PyTorch reports, the budget M); in-run device readings include the remainder, so a full card reads 79.6 GiB and the readings of 79.6 are at the limit. All runs train on FineWeb-Edu at sequence length 32,768 (4096 for the Qwen3-32B pair unless a table states otherwise) with full activation recomputation, disaggregated teachers with fp8 routed-expert weights and bf16 elsewhere (the Qwen3-235B, Llama, and Qwen3-32B teachers are bf16 throughout), and bf16 students with fp32 master weights, at global batch 128 (4.19M tokens per iteration, 0.52M for the Qwen3-32B pair; 126 for the 4-node Qwen3.5 run so that dp=3 divides it). The recipe is AdamW at learning rate ( for the Llama pair) with cosine decay, 32 warmup iterations, and, in the SQ-L+K runs, KD weight decaying from 1.0 to 0.75 ( in the KD-only runs). On the Qwen3.5, Qwen3-235B, Nemotron, and Qwen3-32B pairs the colocated runs decay the learning rate to where the disaggregated runs decay to (both layouts decay to on Llama), and in the Bal-L+K runs ModelOpt's rescaling makes its total loss its LM loss at every iteration. The colocated runs hold the teacher in bf16; one disaggregated run matches the learning-rate floor and the teacher precision and multiplies its total loss by 2 in the same way (below). MMLU is scored 4-shot by generative exact match with FlexEval over 14,042 items. The window width is C=1024 to 4096, and DisaggKD is built on Megatron-Bridge.
Runs. Table 17 lists the disaggregated runs of the main configurations with their node allocation and grid, and Figure 4 plots their KD loss; Appendices D.1 and D.2 give the primary-pair and other-pair measurements. For each run of Table 17 the trainer's token rate is within 4% of the producers' mean rate in the steady state (Table 15). Median iteration times are over iterations 3 to the last, except 8 to the last for the Qwen3.5 (2+1) run and 6 to the last for the seed-43 colocated runs; the captions of Tables 27, 24, 30, and 16 state the windows of their runs.
MMLU evaluation. MMLU (Hendrycks et al., 2021) is scored with the public FlexEval release (SB Intuitions, 2026) on the public test set: a fixed 4-shot prompt for each of the 57 subjects, greedy decoding of at most 256 new tokens that stops at a newline, and exact match after NFKC normalization, lowercasing, and stripping.
C.2 Compared Stacks
Colocated configurations. Table 18 lists the colocated configurations behind Table 3. The rows that ended with NaN in their first iteration (Qwen3-235B on 2 and 4 nodes, Nemotron with cp8 and with tp4) stopped before the first optimizer step and are evaluated without Adam moments and with the 3.1 GiB non-PyTorch memory of that iteration. The rows that set constants of the model are the 2 Qwen3.5 cp4 rows, the OOM points of the 2 Qwen3.5 4-node rows, and those of the 2 Nemotron 8-node rows with cp4 (Appendix A.1); the other rows are outside the fit, except that the 3.1 GiB first-iteration constant is the mean of the 3 Qwen3.5 OOM points (including the 3-node one) and the Nemotron 4-node OOM point.
Fused and fused-W losses. All colocated SQ-L+K runs of the primary pair evaluate of (19) on the logits that ModelOpt's forward pass materializes; they differ in how and are computed. The fused and fused-W runs install the loss module of DisaggKD in ModelOpt, the kernel of Section 4.2 and the label pick of the trainer, so
| Run (T+P nodes) | Trainer grid | Producer replicas | Iter. | s/it | tok/s | KD loss | Peak | CR |
|---|---|---|---|---|---|---|---|---|
| Qwen3.5 (1+1) | tp2/pp2/cp2/dp1 | 4×TP2 | 15 | 283.7 | 14.8 | 2.228 → 2.488 | 57.5; 39.4 | - |
| Qwen3.5 (2+1) | tp2/pp2/cp2/dp2 | 4×TP2 | 200 | 74.3 | 56.4 | 2.228 → 2.227 | 39.2; 39.4 | - |
| Qwen3.5 (3+1) | tp2/pp2/cp2/dp3 | 2×TP2×EP2 | 200 | 69.9 | 59.1 | 2.226 → 2.225 | 33.0; 32.0 | - |
| Qwen3-235B (2+1) | tp2/pp2/ep4 | 1×TP8 (bf16) | 200 | 392.9 | 10.7 | 2.020 → 1.962 | 64.3; 72.9 | all |
| Qwen3-235B (4+4) | tp2/pp2/ep4, dp8 | 4×TP8 (bf16) | 200 | 108.5 | 38.7 | 2.020 → 1.962 | 50.7; 73.3 | all |
| Qwen3-235B (4+4), KD-only | tp2/pp2/ep4, dp8 | 4×TP8 | 60 | 105.0 | 40.0 | 2.066 → 2.029 | 51.0; 72.9 | all |
| Nemotron (2+2) | tp2/pp2/ep4 | 1×TP8×EP2 | 200 | 630.0 | 6.7 | 2.19 → 1.87 | 67.7; 69.6 | - |
| Nemotron (4+4) | tp2/pp2/ep4, dp8 | 2×TP8×EP2 | 200 | 315.9 | 13.3 | 2.19 → 1.87 | 52.5; 70.7 | - |
| Llama (8+8) | tp8/pp2/cp2/dp2 | 4×TP16 (bf16) | 400 | 186.1 | 22.5 | 1.91 → 1.81 | 50.3; 65.4 | - |
| Qwen3-32B (1+1) | tp2/pp2/dp2 | 4×TP2 | 400 | 13.5 | 38.8 | 2.139 → 2.099 | 25.1; 36.4 | - |
Table 17: Disaggregated runs (T+P: trainer and producer nodes): trainer grid, producer replicas (fp8 experts; the Qwen3-235B, Llama, and Qwen3-32B teachers are bf16), iterations completed (Iter.), median iteration time (s/it), throughput ( tokens/s), KD loss at the first and last iteration, and peak memory in GiB (trainer torch-allocated on the last pipeline stage; producers' device). CR: the parts of the cache release that were on (Table 27).
— smaller node set --- equal node count

Figure 4: KD-loss trajectories of the disaggregated runs on the 4 pairs of Table 3 (per-iteration values, thin; 17-iteration moving averages, thick). Students start from released checkpoints, so levels differ across pairs. Blue: the smallest disaggregated run of the pair; orange: the run on the node count of the colocated cell (4 nodes for Qwen3.5, 8 for Qwen3-235B and Nemotron); the Llama panel shows its 16-node run (blue). The labels give the number of iterations of each run, in the color of its curve.
their results are a contribution of this work and not a competing baseline: the module removes the loss-side memory limit of the colocated stack, and the layout comparison is between 2 stacks that share it. (1) SQ-L+K: the criterion forms the fp32 log-probabilities of the whole vocabulary and accumulates in tiles of 16384 columns, and the model forward computes with Mega-
| Pair | Configuration | Device | Torch | OOM point | ||||
|---|---|---|---|---|---|---|---|---|
| Pred. | Meas. | Pred. | Meas. | Pred. | Meas. | Outcome | ||
| Qwen3.5 | 3 nodes, tp2/dp3, best grid | 133.1 | - | 120.8 | - | - | - | not run |
| tp2/pp2/cp2, global batch 126 | ||||||||
| 3 nodes, tp2/pp4/cp1/dp3 | 185.9 | - | 173.6 | - | 86.8 | 88.0 | OOM at the 4th buffer (student divide) | |
| 4 nodes, cp1 | 184.6 | - | 172.3 | - | 86.4 | 87.6 | OOM at the 4th buffer | |
| 4 nodes, cp2 | 112.1 | - | 99.8 | - | 78.3 | 79.0 | OOM at the 7th buffer | |
| 4 nodes, cp4/dp1 | 75.8 | 76.1 | 63.6 | 63.4 | - | - | trains 200 iterations | |
| 4 nodes, cp4/dp1, Bal-L+K | 79.6 | 79.1 | 67.4 | 67.2 | - | - | trains 200 iterations | |
| 4 nodes, cp4/dp1, SQ-L+K | - | 76.8 | - | 59.9 | - | - | trains 200 iterations | |
| 4 nodes, cp4/dp1, SQ-L+K fused | - | 58.7 | - | 40.7 | - | - | trains 15 iterations | |
| 3 nodes, tp2/pp4/cp1/dp3, SQ-L+K fused | - | - | - | - | - | 72.9 | OOM in the first forward | |
| 3 nodes, tp2/pp4/cp1/dp3, SQ-L+K fused-W | - | 78.9 | - | 64.1 | - | - | trains 15 iterations, batch 126 | |
| 2 nodes, tp2/pp4/cp2/dp1, SQ-L+K fused-W | - | 65.8 | - | 50.3 | - | - | trains 15 iterations | |
| 2 nodes, tp2/pp4/cp1/dp2, SQ-L+K fused-W | - | - | - | - | - | 65.4 | OOM after iteration 1 (windowed pick) | |
| 4 nodes, tp2/pp2/cp8/dp1 | 77.3 | 77.0 | 65.0 | 65.7 | - | - | fits, trains 3 iterations | |
| 4 nodes, cp4/dp1, 8192 tokens | 48.7 | - | 36.4 | 37.4 | - | - | fits, 12 iterations | |
| 4 nodes, tp2/pp2/cp2/dp4, 8192 tokens | 77.3 | - | 65.0 | 65.7 | - | - | fits, 12 iterations | |
| Qwen3-235B | 3 nodes | 210.4 | - | 198.1 | - | - | - | OOM in model construction |
| 3 nodes, ep4, SQ-L+K fused-W | - | - | - | - | - | 85.8 | OOM in model construction | |
| 6 nodes, cp2 | 107.2 | - | 94.9 | - | - | - | OOM in the loss computation | |
| 6 nodes, tp4/pp1/cp4/ep16/dp3 | 73.5 | - | 61.2 | - | - | - | not run | |
| 2 nodes, tp4/pp1/cp4/ep16 | 64.3 | 67.3 | 61.2 | - | - | - | NaN in the gradient norm of the first backward pass | |
| 4 nodes, tp4/pp1/cp8/ep32 | 36.7 | 39.5 | 33.6 | - | - | - | NaN in the gradient norm of the first backward pass | |
| 8 nodes, cp2 | 87.1 | - | 74.8 | - | - | - | OOM in the loss computation (74.4 in use, 4.6 requested) | |
| 8 nodes, cp4 | 64.5 | - | 52.2 | - | - | - | fits; diverges with the all-to-all dispatcher | |
| 8 nodes, cp4, all-gather dispatcher, Bal-L+K | 64.5 | 66.3 | 52.2 | 54.4 | - | - | trains 60 iterations, 75 s/it | |
| Nemotron | 4 nodes, tp2/pp4/cp1 | 334.8 | - | 322.5 | - | - | - | OOM during model construction (78.7 in use, 7.1 requested) |
| 4 nodes, ep4, SQ-L+K fused-W | - | - | - | - | - | 77.0 | OOM in model construction | |
| 4 nodes, tp8/pp1/cp4/ep32 | 63.0 | - | 59.9 | - | 59.9 | 75.7 | OOM in the teacher forward | |
| 8 nodes, cp4, Hugging Face teacher | - | - | - | - | 96.7 | 96.6 | OOM in the teacher forward | |
| 8 nodes, cp4, distributed-checkpoint teacher | 93.8 | - | 81.5 | - | 77.6 | 77.7 | OOM in the teacher forward | |
| 8 nodes, tp2/pp4/cp8 | 71.0 | - | 67.9 | - | - | - | memory fits; NaN in the gradient norm of the first backward pass | |
| 8 nodes, tp4/pp4/cp4 | 52.0 | - | 48.9 | - | - | - | memory fits; NaN in the forward loss of the first iteration | |
| 8 nodes, tp4/pp4/cp4, all-gather dispatcher | 52.0 | 72.4 | 48.9 | - | - | - | NaN in the gradient norm of the first backward pass | |
| Qwen3-32B | 1 node, tp2/pp2/dp2, 4096 tokens | 51.0 | - | 38.8 | 38.9 | - | - | trains 12 iterations |
| Llama | 1 node, same grid, Bal-L+K | 52.2 | - | 39.9 | 40.0 | - | - | trains 12 iterations |
| 6 nodes, tp16/pp1/cp1/dp3, global batch 126 | 112.4 | - | 100.1 | - | - | - | not run with Bal-L+K | |
| 6 nodes, tp16/dp3, SQ-L+K fused-W | - | - | - | - | - | 80.1 | OOM in model construction | |
| 8, 16, 24, 28, 32 nodes, tp≤8 (lowest-peak grid) | 89 to 102 | 76 to 90 | - | - | not run | |||
| 8 nodes, tp32/pp2/cp1/dp1 | 47.8 | - | 35.6 | 36.7 | - | - | trains 5 iterations | |
| 16 nodes, tp32/pp2/cp2/dp1 | 39.0 | - | 26.8 | 27.5 | - | - | trains 200 iterations | |
Table 18: Colocated configurations for each pair (Megatron-Bridge ModelOpt; KD-only unless a row says Bal-L+K, SQ-L+K, SQ-L+K fused, or all-gather; W: the model's cross-entropy fusion off), 32768-token sequences unless stated. Pred. and Meas. compare the model with the measurement of the same quantity in GiB: the device peak, the peak allocated by PyTorch (torch), or, at an OOM error, the bytes allocated plus the bytes requested (OOM point); -: not predicted or not measured. The model's MoE dispatch term is that of the all-to-all dispatcher, and the all-gather rows and the SQ-L+K rows, whose loss is not the modeled one, are not counted in Table 6.
tron’s fused vocabulary-parallel cross-entropy. (2) SQ-L+K fused: one criterion computes both terms per token and returns . It evaluates with the one-pass kernel of DisaggKD (an online running maximum and sum of exponentials over tiles, and the gradient of (18) re-derived from the saved per-token statistics, so no fp32 tensor of size tokens is saved for the backward pass; the kernel saves the logits that ModelOpt already holds and per-token statistics), and by the vocabulary-parallel label pick, in windows of 1024 rows under activation checkpointing. The cross-entropy of the model forward is still computed and logged, with zero gradient weight. Unlike DisaggKD, which forms the logits window by window from hidden states, this criterion reads the full materialized logits. (3) SQ-L+K fused-W (W: the model’s cross-entropy fusion off): (2) with that fusion turned off, so that the logged-only cross-entropy takes the unfused vocabulary-parallel path, which normalizes in place on its single fp32 copy of the logits. The 3-node fused run ran OOM allocating an fp32 tile of tokens values (15.16 GiB at cp1 with 32768 rows per rank) inside the fused cross-entropy (Appendix D.1). DisaggKD evaluates no model cross-entropy: its forward step returns the pre-head hidden states, and the loss module computes the LM and KD terms on windows of 1024 to 4096 rows (Appendix C.1), so the fusion option does not apply to it.
Colocated-side enablers. Keeping the colocated runs on Megatron-Bridge used 3 enablers: a text-extracted copy of the Qwen3.5 teacher (the release’s vision wrapper cannot ride PP), a pre-converted sharded checkpoint for the Qwen3-235B teacher, and communicator pre-warming at training start; the converted and extracted teachers were not compared with the originals.
Token accounting. Our first KDFlow and NeMo-RL inputs held 1 document per sample, and FineWeb-Edu documents average 840 to 900 tokens, so a global batch of 128 would hold 0.11M tokens against 4.19M (Qwen3.5) or 0.52M (Qwen3-32B) for ModelOpt and DisaggKD, which concatenate documents into full-length sequences. We therefore ran KDFlow and NeMo-RL on the corpus packed into samples of the same length (documents concatenated, the remainder dropped; 32,768 tokens for Qwen3.5 and 4096 for Qwen3-32B, except NeMo-RL on Qwen3.5, which ran 4096-token samples), and counted tokens by re-tokenizing the packed samples. KDFlow receives the packed text as a response to a fixed prompt without a chat template, because its 2 chat-template paths disagreed by 2 tokens per sample; its samples render to 32,682 tokens on average on Qwen3.5 (at most 32,723, under its limit of 32,768) and 4026 on Qwen3-32B. NeMo-RL's samples average 4091 tokens. The tokens per step are in Table 19.
NeMo-RL’s x-token recipe (its off-policy distillation) exports the teacher’s full-vocabulary logits into a persistent per-rank buffer whose size is proportional to the tokens per step on the Qwen3.5 pair: 30 GiB at 1.05M tokens and 121 GiB at 4.19M, which does not fit an 80 GiB GPU beside the models, as 2 failed 4.19M-token runs showed. The step of 1.05M tokens in Table 19 was the largest that ran on Qwen3.5; 4.19M tokens ran OOM and 2.1M was not attempted. KDFlow at 4.18M tokens ran OOM without sleep mode (the student’s forward, with the teacher’s weights resident) and without the chunked loss (a teacher-head chunk wanted 15 GiB with 8 GiB free); with sleep mode and a chunk of 4096 tokens its device reading is at the limit (Table 19).
Systems comparison. Table 19 lists the measured runs behind Table 2. The global batch is 128 for every stack, except the 4-node DisaggKD run and the 3-node fused-W run on Qwen3.5, whose global batch is 126 so that dp=3 divides it, and NeMo-RL on Qwen3.5, whose batch is 256 sequences of 4096 tokens. DisaggKD trains on Qwen3-32B with SQ-L+K on 1 trainer node and 1 producer node of 4 TP2 replicas, so 2 nodes against 1. KDFlow and NeMo-RL are summarized by the median step (NeMo-RL on Qwen3-32B in 2 runs with medians 36.9 and 36.7 s), except KDFlow on Qwen3-32B, whose 1 s step log gives the mean of its 9 steady steps (1 step of 36 s excluded). KDFlow's optional sleep mode, which offloads the idle model, was off on Qwen3-32B, as in its example script, so its teacher's weights stay in GPU memory beside the student's, whereas NeMo-RL offloads the teacher after its forward pass. On Qwen3.5, NeMo-RL's expert layers ran without the grouped-GEMM kernel. In the rows on the teacher's output and the loss in Table 2, columns are vocabulary entries held per TP rank, tokens are the microbatch's tokens on a GPU, and the KL is the forward KL between teacher and student next-token distributions;
| Stack | Pair | Nodes | Steps | Tokens (103) | s/step | Tok/s/GPU | Peak | Setting |
|---|---|---|---|---|---|---|---|---|
| ModelOpt, KD-only | Qwen3.5 | 4 | 200 | 4194 | 90.5 | 1450 | 63.4 | tp2/pp4/cp4/dp1 |
| ModelOpt, Bal-L+K | Qwen3.5 | 4 | 200 | 4194 | 176.8 | 741 | 67.2 | tp2/pp4/cp4/dp1 |
| ModelOpt, SQ-L+K | Qwen3.5 | 4 | 200 | 4194 | 96.3 | 1361 | 59.9 | tp2/pp4/cp4/dp1 |
| ModelOpt, SQ-L+K | Qwen3.5 | 4 | 15 | 4194 | 100.6 | 1303 | 40.7 | tp2/pp4/cp4/dp1 |
| ModelOpt, SQ-L+K fused | Qwen3.5 | 3 | 15 | 4129 | 72.0 | 2389 | 64.1 | tp2/pp4/cp1/dp3 |
| ModelOpt, SQ-L+K fused-W | Qwen3.5 | 2 | 15 | 4194 | 146.8 | 1786 | 50.3 | tp2/pp4/cp2/dp1 |
| ModelOpt, SQ-L+K fused-W | Qwen3.5 | 2 | 15 | 4194 | 283.7 | 924 | 57.5 | 1+1 nodes, tp2/pp2/cp2/dp1 |
| DisaggKD (ours) | Qwen3.5 | 4 | 12 | 4183 | 335 | 390 | 79.1 | sleep mode, chunked loss |
| KDFlow | Qwen3.5 | 4 | 12 | 1047 | 50.7 | 645 | 77.0 | batch 256 × 4096 |
| NeMo-RL | Qwen3.5 | 3 | 200 | 4194 | 74.3 | 2352 | 39.2 | 2+1 nodes, tp2/pp2/cp2/dp2, CR - |
| DisaggKD (ours) | Qwen3.5 | 4 | 200 | 4129 | 69.9 | 1846 | 33.0 | 3+1 nodes, tp2/pp2/cp2/dp3, CR - |
| ModelOpt, KD-only | Qwen3-32B | 1 | 12 | 524 | 18.4 | 3570 | 38.9 | tp2/pp2/dp2 |
| ModelOpt, Bal-L+K | Qwen3-32B | 1 | 12 | 524 | 18.7 | 3500 | 40.0 | tp2/pp2/dp2 |
| KDFlow | Qwen3-32B | 1 | 12 | 515 | 9.8 | 6570 | 78.9 | sleep mode off |
| NeMo-RL | Qwen3-32B | 1 | 11 | 524 | 36.8 | 1780 | 77.5 | batch 128 × 4096 |
| DisaggKD (ours) | Qwen3-32B | 2 | 400 | 524 | 13.5 | 2426 | 25.1 | 1+1 nodes, tp2/pp2/dp2, CR - |
Table 19: Measured runs of the compared stacks: nodes of 8 GPUs, steps run, tokens per step as counted, median step time (a 9-step mean for KDFlow on Qwen3-32B; steps 3 to 15 for the 15-step run), tokens/s per GPU, and peak memory per GPU in GiB (torch-allocated for ModelOpt and DisaggKD, device memory for KDFlow and NeMo-RL, whose torch peaks were not logged; the producers' device peaks of DisaggKD are in Table 17). KDFlow on Qwen3.5 used sleep mode, and its step includes the teacher offload cycle; NeMo-RL on Qwen3.5 ran at a quarter of the batch without the grouped-GEMM kernel. CR (in the Setting column): the parts of the cache release that were on (Table 27). Bold: highest tokens/s per GPU in each pair and node count; the runs differ in loss, sequence length, steps, tokens per step, and teacher precision.
NeMo-RL adds a CE term (scale 0.1) and KD-Flow weights KL and CE 0.5 each at learning rate . NeMo-RL's same-tokenizer path takes it over the 8192 teacher columns with the largest logits in the microbatch (its default, of for Qwen3-32B and 248,000 for Qwen3.5), renormalized within that subset, whereas the other 3 use all columns.
D Additional Results
D.1 Primary Pair
The SQ-L+K and Bal-L+K losses. For row with label and one-hot vector , the label loss, the soft cross-entropy, and the KL divergence sat- isfy
with . The teacher entropy has no student parameters, so , and the gradients with respect to the student logits of row are
With the completed fraction of the iterations, the losses of the primary-pair runs are
is our objective (9) (SQ-L+K): the disaggregated runs, except the rescaled run, and the colocated run of Table 4 that installs it in ModelOpt with the cross-entropy form of the KD term. is ModelOpt's loss balancer (Bal-L+K) of the colocated runs, and is the rescaled disaggregated run of Table 20, which applies the rescaling to our cross-entropy value; and are held constant in the backward pass. The rescaled losses are constant in value, , so their totals carry no KD value, and the KD term acts through the gradient. By (18), the gradients with respect to of row are
Each gradient moves toward the target with KD weight , and , at scale 1, , and . Per token, is 0.2 to 0.35 against of 2.1 to 2.2, so is 6.5 to 9.6 at the iterations of Table 21, the weight of Bal-L+K averages 0.887 over the run against 0.875 for , and the logged gradient norm at iteration 100 is 6.2 for Bal-L+K against 0.29 for the colocated SQ-L+K run and 0.63 for the disaggregated run. The logged KD values differ by , about 2 nats. For the rescaled run (2.2 to 2.3 against 2.2), a constant weight of 0.49 (Table 21); its mixture is not ModelOpt's. At the KD-only losses and have the same gradient.
Loss parity. Table 20a gives the gap between the LM loss of a disaggregated run and that of the colocated Bal-L+K run, over moving averages of iterations. We smooth over 17 iterations () because the loss changes by 0.014 to 0.018 nats between consecutive iterations, the size of the gap at ; the mean absolute gap shrinks with the window, and the signed mean stays at for the 4-node run and rises from to for the rescaled run. Against the colocated SQ-L+K run the 4-node gap at is 0.008 (signed , largest 0.028). The rescaled run applies the colocated teacher precision (bf16), learning-rate floor , and global batch (128), and rescales the KD term to the LM loss so that its total loss is the LM loss, as in ModelOpt. It runs on 3 nodes against 4 for the colocated run, at 153.0 s per iteration against 176.8 (Tables 15 and 4), and differs from the colocated run in the grid, the kernels, the KD share (Table 21), the document order, and CR all. Table 20b gives the KD losses: the logged values differ by 2.00 nats on average (SD 0.02) from the ModelOpt runs and by 0.02 from the SQ-L+K run, and after subtracting each run's first 3 iterations they rise by 0.14 to 0.16 and end within 0.01 of their start.
| (a) LM loss gap to the colocated run | ||||||
|---|---|---|---|---|---|---|
| Bal-L+K | SQ-L+K | |||||
| w | Disagg., 4 nodes | Disagg., rescaled | Disagg., 4 nodes | |||
| |gap| | signed | |gap| | signed | |gap| | signed | |
| 1 | 0.020 | +0.001 | 0.021 | +0.005 | 0.017 | +0.005 |
| 5 | 0.014 | +0.001 | 0.014 | +0.005 | 0.010 | +0.005 |
| 9 | 0.012 | +0.001 | 0.012 | +0.006 | 0.009 | +0.005 |
| 17 | 0.012 | +0.001 | 0.010 | +0.007 | 0.008 | +0.005 |
| 33 | 0.011 | +0.001 | 0.009 | +0.008 | 0.006 | +0.006 |
| Max | 0.056 | 0.043 | 0.028 | |||
| (b) KD loss, first 3 iterations subtracted | ||||
|---|---|---|---|---|
| Run | Rise | End | |gap| | signed |
| Disagg., 4 nodes | 0.16 | 0.00 | - | - |
| Coloc., KD-only | 0.15 | +0.01 | 0.011 | -0.010 |
| Coloc., Bal-L+K | 0.14 | +0.01 | 0.019 | -0.015 |
| Coloc., SQ-L+K | 0.16 | +0.01 | 0.011 | -0.010 |
Table 20: Loss parity on the primary pair. (a) Mean absolute and mean signed gap between the LM loss of a disaggregated run and a colocated run (Bal-L+K or SQ-L+K), over moving averages of iterations, at the iterations at which both have a full window (183 at for the 4-node run, 184 for the rescaled run against the Bal-L+K run). (b) Largest rise of each run's KD loss, its value at the last full window (iteration 192), and the gap to the disaggregated curve (disaggregated minus colocated; mean absolute and mean signed over iterations 9 to 192). Max: the maximum absolute gap at .
Fused loss in the colocated stack. The colocated runs SQ-L+K fused and fused-W (Appendix C.2; 15 iterations each, otherwise the SQ-L+K recipe) differ from DisaggKD in reading the materialized logits. Its torch peak is 40.7 GiB and its sampled device peak 58.7 GiB, against 59.9 and 76.8 for SQ-L+K, and its median iteration takes 100.6 s over iterations 3 to 15, against 110.3 s for SQ-L+K
| Iteration | 20 | 50 | 100 | 200 |
|---|---|---|---|---|
| Colocated Bal-L+K | 0.88 | 0.87 | 0.89 | 0.91 |
| SQ-L+K (disagg. and coloc.) | 0.98 | 0.94 | 0.88 | 0.75 |
| Disaggregated, rescaled | 0.49 | 0.49 | 0.49 | 0.49 |
| Colocated KD-only | 1 | 1 | 1 | 1 |
Table 21: Weight of the KD term in the loss of the primary-pair runs: for the mixture, with for Bal-L+K and for the rescaled run.
over the same iterations (96.3 s over iterations 3 to 200). At iteration 1, with the same weights and data, the total loss of a rank is 18207.279 against 18207.285 (sums over the rank's tokens), and the model-forward LM sum agrees with the fused label pick to (the printed precision). The 15-iteration runs differ from the 200-iteration ones in and in the learning rate, whose warmup covers iterations 1 to 14 of the 15, so only iteration 1 is compared, and the 15-iteration KD losses of different layouts are not comparable. At 3 nodes (tp2/pp4/cp1/dp3, global batch 126) the fused run runs OOM in the first forward, with 66.23 GiB in use and a request of 15.16 GiB: the fp32 tile that the model's own fused cross-entropy forms at 32768 rows per rank, to which the fused criterion gives no gradient weight. With that fusion off (fused-W) the 3-node run trains 15 iterations with the iteration-1 values of the 4-node runs (LM 2.0945, KD 2.1907), at 72.0 s per iteration (4.13M tokens, 2389 tokens/s per GPU, against 74.3 s and 2352 for DisaggKD on 3 nodes), with a torch peak of 64.1 GiB and a sampled device peak of 78.9 GiB against the 79.11 GiB limit. At 2 nodes the fused-W run (tp2/pp4/cp2/dp1, global batch 128) trains 15 iterations at 146.8 s per iteration, with a torch peak of 50.3 GiB and a sampled device peak of 65.8 GiB; with cp1 and dp2 it ran OOM after the first iteration, with 78.9 GiB in use and a request of 0.5 GiB at the windowed label pick. DisaggKD on 2 nodes (1 trainer node with tp2/pp2/cp2/dp1, 1 producer node with 4 TP2 replicas) trains 15 iterations at 283.7 s per iteration with a trainer torch peak of 57.5 GiB; the student is the bottleneck at dp1 and the producers are idle most of the time (duty 0.13, Table 15). At 2 nodes the colocated fused-W run is therefore faster and holds less memory per GPU than DisaggKD, at 3 nodes the 2 runs have a similar speed and DisaggKD holds less memory per GPU, and DisaggKD is faster than the colocated runs with ModelOpt's loss. On the 3 larger pairs the fused-W cells at the node counts and student grids of DisaggKD run OOM during model construction, before the first forward pass: Qwen3-235B on 3 nodes (tp2/pp2/cp1/ep4, global batch 126; 74.9 GiB in use and a request of 13.5 GiB), Nemotron on 4 nodes (tp2/pp2/cp1/ep4; 79.09 GiB in use while the teacher's expert layers are built), and Llama on 6 nodes (tp16/pp1/cp1/dp3, global batch 126; 66.0 GiB in use and a request of 16.4 GiB for the gradient buffer of the student). The colocated memory model of Appendix A.1 describes ModelOpt's loss and does not predict these runs.
Fused-W on 2 nodes. 2 fp32 buffers with tokens values each decide the peak of a colocated run of the primary pair, 15.16 GiB each at 32768 rows per rank (V/tp=124160) and 7.58 GiB at cp2. (1) The intermediates of ModelOpt's logits-KL loss, on the KD side: the stock criterion computes fp32 log-probabilities of this size and saves the student-side tensors for the backward pass. The fused criterion removes them: the kernel of DisaggKD saves no fp32 tensor of this size (only the logits that ModelOpt already holds and per-token scalars), and the label pick materializes 1 window of 1024 rows at a time. (2) The model's own cross-entropy, on the student side: Megatron's fused vocabulary-parallel cross-entropy in the model forward forms 1 such tensor, although the fused criterion gives that loss zero gradient weight. Turning the fusion off (W) routes it through the unfused path, which normalizes in place on its single fp32 copy of the logits. Table 22 lists the 3-node cells, which are 3 different runs (the KD-only run has no LM term, hence no buffer (2)): the failing allocation moves from the loss to the model forward, and with the fusion off the fused run fits. At 2 nodes the same student grid with cp1 and dp2 holds 32768 rows per rank and ran OOM after the first iteration at a request of 0.5 GiB (64.9 GiB allocated, 78.9 GiB in use), whereas cp2 and dp1 halves every buffer of this size, fits at 50.3 GiB allocated (65.8 GiB sampled device peak), and trains at 146.8 s per iteration. DisaggKD on the same 2 nodes trains the student on 8 GPUs while the producer node waits for the trainer, and takes 283.7 s (Table 15).
Loss parity under the offset. Figure 3a plots the LM loss, the student's next-token cross-entropy, which every run defines in the same way whatever
| Loss | Alloc. | Req. | In use | Failed in |
|---|---|---|---|---|
| KD-only, ModelOpt | 72.9 | 15.2 | 75.5 | the loss |
| SQ-L+K fused | 57.7 | 15.2 | 66.2 | model forward |
| SQ-L+K fused-W | 64.1 | - | 78.9 | trains |
Table 22: Colocated 3-node cell of the primary pair (tp2/pp4/cp1/dp3) at its first failing allocation or, for the run that trains, at its peak (GiB): PyTorch-allocated bytes (Alloc.), bytes requested by the failing allocation (Req.), and device memory in use (device peak for fused-W).
| Run | Nodes | s/it | GPU-s | Peak |
|---|---|---|---|---|
| Colocated, cp4/dp1 | 4 | 96.3 | 3082 | 59.9 |
| Colocated fused, cp4/dp1 | 4 | 3219 | 40.7 | |
| Colocated fused-W, cp1/dp3 | 3 | 1728 | 64.1 | |
| Colocated fused-W, cp2/dp1 | 2 | 2349 | 50.3 | |
| Disaggregated, cp2/dp1 | 1+1 | 4539 | 57.5 | |
| Disaggregated, cp2/dp3 | 3+1 | 69.9 | 2237 | 33.0 |
| Disaggregated, cp2/dp2 | 2+1 | 74.3 | 1783 | 39.2 |
Table 23: SQ-L+K runs of the primary pair at 32768 tokens (tp2; pp4 colocated, pp2 disaggregated): median s/it, GPU-seconds per iteration over all nodes (producers included), and torch-allocated peak in GiB (the trainer's for the disaggregated runs). : 15 iterations; fused-W: the model's cross-entropy fusion off, global batch 126 at 3 nodes and 128 at 2 nodes.
its training weights, so the curves measure one quantity. The weights change the trajectory, not the definition, so we measured how much: the 4-node disaggregated run (mean KD weight 0.875) and the rescaled 2+1 run (0.49, which differs from the 4-node disaggregated run in node split, global batch, learning-rate floor, teacher precision, and CR) lie 0.012 and 0.010 nats from the colocated run. Figure 3b plots KD losses that are defined differently, cross-entropy against KL; their offset is the teacher's entropy (the logged difference is 2.00 nats; no run logged the entropy), which we remove by subtracting each run's first-3-iteration mean. The plotted disaggregated run is the mixture, whose weight is the closer to ModelOpt's. A comparison at equal share would apply the balancer to the KL value, which needs the teacher's entropy per token and is not part of these runs. The runs also differ in their data order: the colocated runs hold out 0.01% of the documents for validation (a 9999:1:0 split) before shuffling the document order, and the disaggregated runs read the whole corpus with the same shuffle seed, so a reconstruction of both data pipelines from the corpus index gives different document sequences from the first iteration (Table 25, seed-42 runs). The parity statistic therefore compares runs on the same corpus, not on the same samples.
Source of the speedup. On the 4-node Qwen3.5 pair the colocated Bal-L+K, colocated SQ-L+K, colocated KD-only, and disaggregated runs cost 5656, 3082, 2894, and 2237 GPU-seconds per iteration (median iteration time times the 8 GPUs of each of 4 nodes, producer node included; the colocated SQ-L+K fused run costs 3219 and the 3-node fused-W run 1728, Table 23). At seed 42 the 3419 GPU-second gap to the colocated Bal-L+K run is the colocated LM term, 2762 GPU-seconds (81%; 68% with the seed-43 colocated runs and the 61.9 s pace), plus the 657 (19%) by which the colocated KD-only run still exceeds the disaggregated run, which also computes the LM term. With SQ-L+K the colocated LM term costs 188 GPU-seconds, and the gap to the disaggregated run is 845, of which 657 is the KD-only excess. Table 24a locates the added events: on the last pipeline stage, which evaluates the loss, the LM term adds NCCL collective events and a chain of small copy and conversion operators with their stream synchronizations, and the GPU-kernel share of traced time falls (85.9% to 77.6%), while stage 1 is unchanged (98.0% and 98.5%). The KD-only gap has a different source. The colocated stack executes the teacher forward pass and the student training step sequentially on the same 4 nodes, so the iteration time is their sum. The streamed SQ-L+K trainer, which executes only the student step on the same grid, takes 70.9 s against the colocated 90.5 s (seed 42) and 97.7 s (seed 43, different nodes), 19.6 and 26.8 s less, against a teacher-forward estimate of 16 s from the producer rate (Table 24d); at 8192 tokens on the same grid the gap is 59.7 s (Table 24c). In the 3+1 layout the producer node executes the teacher forward pass while the trainer nodes execute the student step. The producers' forward time is within 10% of the iteration time (Table 15), so the iteration time is the longer of the producers' forward time and the trainers' step time, not their sum.
Grid. With ModelOpt's loss, 3 trainer nodes cannot host the colocated grid, which needs 4 nodes per replica; with the fused-W loss the colocated stack runs the narrow grid tp2/pp4/cp1/dp3 on 3
| (a) Profile of the colocated runs | (b) Streamed trainer on other grids | |||||||
|---|---|---|---|---|---|---|---|---|
| KD-only | Bal-L+K | Trainer grid | Nodes | s/it | GPU-s | Relative | CR | |
| Loss stage, GPU-kernel share (%) | 85.9 | 77.6 | tp2/pp2/cp2/dp4 | 4+2 | 39.3 | 1886 | 1.00 | - |
| Loss stage, NCCL collectives (s) | 2.3 | 18.3 | tp2/pp4/cp2/dp2 | 4+2 | 50.8 | 2438 | 1.29 | - |
| Loss stage, copy operators (s) | 7.1 | 23.4 | tp2/pp2/cp4/dp2 | 4+2 | 50.0 | 2400 | 1.27 | - |
| Loss stage, stream syncs (s) | 13.2 | 30.4 | tp2/pp4/cp4/dp1 | 4+2 | 70.9 | 3403 | 1.80 | - |
| Stage 1, GPU-kernel share (%) | 98.0 | 98.5 | tp2/pp2/cp2/dp3 | 3+1 | 65.0 | 2080 | - | - |
(c) KD-only at 8192-token sequences
| Stack | Grid | Nodes | s/it | GPU-s | Peak |
|---|---|---|---|---|---|
| Colocated | tp2/pp4/cp4/dp1 | 4 | 137.2 | 4389 | 37.4 |
| Colocated | tp2/pp2/cp2/dp4 | 4 | 67.5 | 2161 | 65.7 |
| Streamed | tp2/pp2/cp2/dp3 | 3+1 | 114.7 | 3672 | 32.1 |
| Streamed | tp2/pp4/cp4/dp1 | 4+2 | 77.5 | 3720 | 30.8 |
(d) Colocated KD-only iteration at 32768 tokens (tp2/pp4/cp4/dp1)
| Run | Part of the iteration | s/it | GPU-s |
|---|---|---|---|
| Colocated, seed 42 | all | 90.5 | 2894 |
| Colocated, seed 43 | all | 97.7 | 3126 |
| forward-only | both forward passes and the loss | 77.9 | - |
| difference | training step minus evaluation step | 19.8 | - |
| Streamed trainer, 4+2 nodes | all | 70.9 | 3403 |
| Producers, estimated | teacher forward | 16 | - |
Table 24: (a) Profiles of iteration 3 of the colocated KD-only and Bal-L+K runs (tp2/pp4/cp4/dp1), on 1 rank per pipeline stage. Times are seconds of traced time in the iteration, whose wall time on the loss stage is 111.3 s (KD-only) and 120.0 s (Bal-L+K); iteration 3 is not steady (the median iterations take 90.5 s and 176.8 s, Table 4); the rows are overlapping event times, so differences and shares, not absolute times, are the result. (b) Streamed trainer (SQ-L+K) on the Qwen3.5 pair at 4.19M tokens per iteration (4.13M in the 3+1 row), on 4 trainer and 2 producer nodes (Nodes), 12 iterations each; GPU-s: GPU-seconds per iteration over all nodes, producers included; Relative: s/it over the first row's; no row of the 4+2 nodes is limited by its producers, and the last row is a rerun of the 3+1 run of Table 4 (12 iterations). (c) KD-only runs at 8192-token sequences and 4.19M tokens per iteration (4.13M for the streamed 3+1 run), 12 iterations each, of the colocated stack (ModelOpt) and the streamed trainer with CR –; GPU-s: GPU-seconds per iteration over all nodes, producers included; Peak: torch-allocated GiB. The trainers of the streamed runs wait at most 0.004 s per iteration for hidden states. (d) Forward-only: an evaluation-mode run of the seed-42 configuration (median of steps 3 to 14), on different nodes, subtracted from the seed-43 training run; the teacher forward is estimated from the forward-only rate of one producer replica of the 3+1 run (32.8k tokens/s, Table 15) over 8 replicas, the 4 nodes. CR: the parts of the cache release that were on (Table 27).
| Runs | Documents read | Shared |
|---|---|---|
| Colocated | 99.99% of the corpus (9999:1:0), shuffled | 0 of 128 |
| Disaggregated | the whole corpus, same shuffle seed | - |
Table 25: Document order of the primary-pair runs. Shared: sequences of iteration 1 whose documents are the same in the colocated and the disaggregated run, reconstructed from the corpus index (seed-42 runs).
nodes (Table 23). The grid with the smaller cp is faster for the streamed trainer at fixed student GPUs (Table 24b) and keeps the trainers' step time within of the producers' forward time in the runs with CR - (Table 15). At 8192 tokens the colocated stack fits the 4-node grids of Table 24c and needs fewer GPU-seconds than the split. This does not extend to 32768 tokens, where the model predicts ModelOpt's loss over the budget on the narrow grid (the measured cp2 OOM of Table 18 is on pp 4), and the same 3+1 layout takes 65.0 to 69.9 s for 4.13M tokens at 32768 tokens per sequence against 114.7 s at 8192 (Tables 24c and 15). The colocated runs hold the teacher in bf16 (Appendix B.2). Holding the routed experts in fp8 lowers the colocated stack's torch peak at its cp4 grid, but the KD loss and gradient norm of that run leave those of the bf16 run at iteration 3 (Table 16), and the model predicts the cp2 grid over the budget with fp8 experts as well (no fp8 run at cp2).
Seeds. Table 26 gives the primary-pair runs with seed 43 for the data order and random state. The
| Seed 42 | Seed 43 | Change | p | |
|---|---|---|---|---|
| Disagg. (ours), 4 nodes | 68.52 | 70.09 | +1.57 | |
| Disagg. (ours), 3 nodes | 70.14 | - | - | - |
| Coloc., Bal-L+K | 67.51 | 69.78 | +2.26 | |
| Coloc., KD-only | 67.97 | 69.22 | +1.25 | |
| Between layouts, seed 42 | ||||
| 4 nodes - coloc. Bal-L+K | - | - | +1.01 | 0.001 |
| 4 nodes - coloc. KD-only | - | - | +0.56 | 0.09 |
| 3 nodes - 4 nodes | - | - | +1.62 | |
Table 26: MMLU (%) of the primary-pair students at iteration 200 for 2 seeds (the 3-node run only for seed 42), with the change over all 14,042 questions and its exact 2-sided McNemar ; the last block gives the differences between layouts at seed 42.
| CR | s/it | Effect | KD loss |
|---|---|---|---|
| - | 13.5 | - | 2.42 |
| mb | 68.1 | +54.6 | 2.42 |
| iter | 14.9 | +1.4 | 2.41 |
| mb+iter | 69.3 | +55.8 | 2.42 |
| producer | 13.5 | +0.0 | 2.40 |
| all | 68.8 | +55.3 | 2.41 |
Table 27: Parts of the cache release on Qwen3-32B to 4B (1+1 nodes, 4096-token sequences, 64 microbatches per DP rank), 30 iterations per row; s/it: median of iterations 8 to 30; Effect: s/it minus that of the row with no part on; KD loss: mean over iterations 8 to 30 (2.139 at iteration 1 in every row). CR: the parts of the cache release that were on: mb (the last pipeline stage releases after every microbatch), iter (once at each iteration boundary), producer (each producer replica after each of its first 400 slots), all for the 3, and – for none; the release changes the pace, and the KD loss agrees within 0.02 nats (Appendix D.1, Cache release).
seed-43 runs score 1.25 to 2.26 points above the seed-42 runs, more than the seed-42 lead of the 4-node disaggregated student (+1.01, +0.56); the 3- and 4-node students, which differ in node split, global batch, and trainer grid, differ by 1.62 points, and 2 seeds do not establish a ranking of the layouts. The seed-43 colocated runs take 97.7 s (KD-only) and 172.1 s (Bal-L+K) per iteration, on different nodes.
Cache release. The allocator's cached blocks can be returned to the driver (the cache release). The release has 3 parts, each with its own switch: mb, where the last pipeline stage of the trainer, which evaluates the loss, releases after every microbatch; iter, once at each iteration boundary; and producer, where each producer replica releases after each of its first 400 slots. 6 of the 8 cells over the 3 parts on the Qwen3-32B pair at 4096 tokens (Table 27, 1 run each) put 54.6 of the 55.3 s on the per-microbatch part, 0.85 s per microbatch; the iteration part adds 1.4 s, and the producer part, active only in the first 12 iterations, adds 0.0 s over iterations 8 to 30. The CR column of the run tables records which parts were on: – for none, mb, iter, producer, combinations such as mb+iter, and all for the 3. It changes the pace; the mean KD loss over iterations 8 to 30 differs by at most 0.02 nats across the rows of Table 27. On the seed-43 configuration the release costs at least 0.77 s per microbatch (42 per DP rank; the CR – run is producer-limited; Table 15). The 200-iteration seed-43 run has it on (Table 15), and the seed-43 pace in Table 4 is the run with CR –.
D.2 Other Pairs
Divergence control on Qwen3-235B. The 3 preserved colocated Qwen3-235B runs on 8 nodes (cp 4, ep 16, all-to-all) ended in Inf or NaN after 18, 44, and 58 completed iterations (Table 28). The table compares them with runs of the same student on other grids, with the dense Qwen3-4B teacher at 4096 tokens in the 4B cells. The student's LM loss at the second iteration is within 0.03 of the Hugging Face loss at ep 4 with tp 2 and at ep 8 with tp 1 and tp 2, and above it at ep 16 with tp 1 and tp 2; the gradient norm of the first iteration rises from 29 to and . Replacing only the all-to-all token dispatcher by the all-gather dispatcher at the tp2/pp1/ep16 grid gives the loss (2.178) and gradient norm (29) of the ep-4 cell, whereas sequential experts and an fp32 router do not; on the 235B pair it gives a second-iteration loss of 2.11 and a first-iteration gradient norm of 12, against 1.0 to with all-to-all. The checked weights match the Hugging Face tensors, and the output of the first layer is above that of the healthy run at ep 16 in the tp2 run (6% below at tp 1; layer 0 was not measured in the all-gather cell). At ep 16 the all-to-all dispatcher gives a wrong forward pass and the all-gather dispatcher on the same grid does not, and the tp1/pp2 (edp 1) and tp2/pp1 (edp 2) grids are both above the reference, as is the cp-4 grid with the 235B teacher. With the all-gather dispatcher the colocated 8-node run differs from the learning-rate- run that diverged after 18 iterations in the dispatcher and the learning-rate
| Run (30B student) | tp/pp/cp/ep | edp | Dispatcher | LM, it. 2 | Grad norm, it. 1 | Layer 0 | Outcome |
|---|---|---|---|---|---|---|---|
| Torch forward | - | - | - | 2.16 | - | - | reference |
| Disaggregated, 235B | 2/2/1/8 | 2 | flex | 2.11 | 2.2 | - | stable, 20 it. |
| Disaggregated, 235B | 2/2/1/4 | 2 | flex | 2.11 | 1.7 | - | stable, 200 it. |
| Colocated, 4B | 2/2/1/4 | 4 | all-to-all | 2.18 | 29 | 77.4 | finite, 2 it. |
| Colocated, 4B | 1/2/1/8 | 2 | all-to-all | 2.18 | 29 | - | finite, 2 it. |
| Colocated, 4B | 2/2/1/8 | 2 | all-to-all | 2.18 | 29 | - | finite, 2 it. |
| Colocated, 4B | 1/2/1/16 | 1 | all-to-all | 2.70 | 72.9 | above reference | |
| Colocated, 4B | 2/1/1/16 | 2 | all-to-all | 3.15 to 3.22 | to | 110.9 | losses rise |
| Colocated, 4B | 2/1/1/16 | 2 | all-gather | 2.18 | 29 | - | finite, 2 it. |
| Colocated, 4B, seq. experts | 2/1/1/16 | 2 | all-to-all | 3.11 | - | above reference | |
| Colocated, 4B, fp32 router | 2/1/1/16 | 2 | all-to-all | - | - | - | NaN in the forward loss, first iteration |
| Colocated, 235B, 3 runs | 2/2/4/16 | 2 | all-to-all | 2.63 to 2.68 | to | - | Inf/NaN, 18 to 58 it. |
| Colocated, 235B | 2/2/4/16 | 2 | all-gather | 2.11 | 12 | - | finite, 60 it. |
Table 28: The Qwen3-30B-A3B student on different grids, 3 to 8 nodes (edp: expert data-parallel size, GPUs divided by ep-pp; flex: the flex dispatcher with the DeepEP backend; seq. experts: sequential experts instead of grouped GEMM). Disaggregated: DisaggKD with the Qwen3-235B teacher; colocated: ModelOpt with the Qwen3-4B teacher (dense, same vocabulary; 4096-token sequences, learning rate for the 2-iteration cells) or the Qwen3-235B teacher (32768 tokens). LM, it. 2: the student's LM loss at the second iteration, after 1 optimizer step (at learning rate in the 4B-teacher cells); the Torch forward is the Hugging Face loss on the first iteration's 4096-token batch (the Megatron runs read 2.155 there; the second batch gives 2.178 in the healthy cells), and the 32768-token rows have none. Grad norm, it. 1: gradient norm of the first iteration; Layer 0: L2 norm of the first layer's output on the first batch (normalized by the data-parallel size); it.: iterations completed. The checked weight sums of the 3 runs with a layer-0 norm match the Hugging Face checkpoint to relative.
schedule (the 2 runs share their first 18 iterations, after which the 60-iteration schedule decays the learning rate sooner), and completes its 60 planned iterations with finite losses (the longest all-to-all run failed after 58) (Table 28; memory and pace in Table 18). Disaggregated on 4+4 nodes with the KD-only loss (, the LM term skipped), peak learning rate , and the 200-iteration schedule, the pair completes the 60 iterations of a run stopped there with no NaN and no skipped iteration, at 105 s per iteration (Table 17). The disaggregated SQ-L+K runs of Table 17 on 4+4 and on 2+1 nodes run 200 iterations each without a NaN.
NaN on the Nemotron pair. Table 29 lists the colocated Nemotron runs next to the disaggregated one. The student gives NaN in its first iteration in each of the 5 colocated ep-16 cells (tp 2 or 4, pp 4, cp 1, 4, or 8), with the all-to-all and all-gather dispatchers and the Ultra and Nano teachers, and stays finite for 3 iterations at ep 4 (edp 4) with the Nano teacher, the all-gather dispatcher, and cp 4; every ep-16 cell has edp 1. The all-to-all dispatcher gives NaN already in the forward loss at tp4/cp4. The Nano-teacher rows run the Nano student with its own initial checkpoint as teacher, so ModelOpt's KL stays in the loss and only the Ultra teacher is
| Layout | Teacher Grid | edp | Dispatcher | Outcome |
|---|---|---|---|---|
| Disagg. Ultra | 2/2/1/4 | 4 | flex | finite, 200 it. |
| Coloc. Ultra | 2/4/8/16 | 1 | all-to-all | NaN, gradient norm |
| Coloc. Ultra | 4/4/4/16 | 1 | all-to-all | NaN, forward loss |
| Coloc. Ultra | 4/4/4/16 | 1 | all-gather | NaN, gradient norm |
| Coloc. Nano | 4/4/4/16 | 1 | all-gather | NaN, gradient norm |
| Coloc. Nano | 4/4/1/16 | 1 | all-gather | NaN, gradient norm |
| Coloc. Nano | 4/4/4/4 | 4 | all-gather | finite, 3 it. |
Table 29: Nemotron-3 Nano student on 8 nodes (Disagg.: DisaggKD on 4+4 nodes) with the Ultra teacher or, for the student alone, the Nano checkpoint as its own teacher. Grid: tp/pp/cp/ep; edp: expert data-parallel size. NaN: the first value that is not finite, in the first iteration; finite: iterations completed. The colocated runs share data, global batch 128, 32768 tokens, and learning rate , except the 2/4/8/16 row ().
removed.
Llama pair. Table 30a lists the Llama runs. At 16 nodes each layout has a training run and a pace check. The pace of each layout was measured again in a 20-iteration pace check of the same layout. The colocated pace moves by between the 2. The
| (a) Llama | (b) Qwen3-32B to 4B | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Layout (nodes) | Iter. | s/it | GPU-s | Peak | CR | MMLU | Seq. × batch | Microbatches | s/it | Tokens/s/GPU | CR | |
| Colocated (8) | 5 | 484 | 31.0k | 36.7 | - | - | 4096 × 128 | 64 | 13.5 | 2426 | - | |
| Colocated (16), training | 200 | 301 | 38.5k | 27.5 | - | 76.98 | 4096 × 128 | 64 | 69.6 | 471 | all | |
| pace check | 20 | 305 | 39.0k | 27.4 | - | - | 8192 × 64 | 32 | 11.9 | 2755 | - | |
| Disagg. (ours, 4+2) | 5 | 818 | 39.3k | 68.6 | all | - | 16384 × 32 | 16 | 13.5 | 2427 | - | |
| Disagg. (ours, 8+8), training | 400 | 186 | 23.8k | 50.3 | - | 76.41 | ||||||
| pace check | 20 | 235 | 30.1k | 50.3 | all | - | ||||||
| Teacher | 85.21 | |||||||||||
| Initial student | 78.17 | |||||||||||
Table 30: (a) Llama runs at 4.19M tokens per iteration: iterations, median iteration time, GPU-seconds per iteration, and peak memory in GiB (colocated: per GPU; disaggregated: the trainer; torch-allocated). Colocated grids are tp32/pp2/cp1/dp1 (8 nodes) and tp32/pp2/cp2/dp1 (16); disaggregated trainers are tp8/pp2/cp2 with dp1 (4+2) and dp2 (8+8); MMLU (%) is of the trained students, the initial student, and the teacher. The 4+2 median is over iterations 2 to 5. A training run is the full-length run; a pace check is 20 iterations of the same layout, run separately from the training run. (b) Disaggregated Qwen3-32B to 4B at 0.52M tokens per iteration on 2 nodes (tp2/pp2/dp2, 4 producer replicas); Seq. × batch: sequence length times global batch; Microbatches: per DP replica. CR: the parts of the cache release that were on (Table 27). A dash marks the colocated runs, which do not use it.
pace check ran with CR all and is 48.7 s slower, 0.76 s per microbatch over 64 microbatches per DP rank; the release costs 0.77 s per microbatch on the primary pair, and no Llama run isolates it. The speedup at 16 nodes is from the training runs, with CR -, and from the pace checks. At 8 nodes the colocated layout needs 31.0k GPU-seconds per iteration, more than the disaggregated pace check at 16 nodes (30.1k) and more than its training run (23.8k); the disaggregated layout runs on 6 nodes (39.3k GPU-seconds, 5 iterations) where the colocated layout needs 8. Both students score within 1.8 points of the initial student on MMLU (MMLU in Table 30a).
Qwen3-32B pair. On Qwen3-32B to 4B the disaggregated run with CR – is 5.1 to faster per GPU than with CR all (Tables 27 and 30b), and stays below ModelOpt and KDFlow (Table 2). Table 30b holds the tokens per step fixed at 0.52M and varies the sequence length: with CR – the iteration time is 13.5, 11.9, and 13.5 s at 64, 32, and 16 microbatches per replica, whereas with CR all the 4096-token configuration pays 0.86 s per microbatch (0.85 s for the per-microbatch part alone; Table 27). In the 4096-token CR – run the producers' duty is 0.93 (Table 15).
E Artifacts, Licenses, and Compute
The models are Qwen3.5, Qwen3, and Qwen3-4B-Base (Apache License 2.0), Nemotron 3 Nano (NVIDIA Nemotron Open Model License) and Ultra (OpenMDW License 1.1), and Llama 3.1 (Llama 3.1 Community License). The corpus is FineWeb-Edu (ODC-By 1.0) and the benchmark is MMLU (MIT License). The software is Megatron-Bridge, Megatron-Core, Model Optimizer, NeMoRL, Transformer Engine, and the evaluation tool (Apache License 2.0), and KDFlow and Triton (MIT License). All were used for research distillation, as their licenses permit, and the trained students are not released. FineWeb-Edu is a filtered web corpus and MMLU a multiple-choice benchmark; neither is annotated by us. An anonymized codebase accompanies the submission: it holds the code, the run configuration behind each table, the memory and traffic models with their tests, the scripts that produce the tables and figure data, and a standalone MMLU protocol; it holds no run data, so the measured tables are reproduced by re-running the configurations on the stated hardware. The runs reported in this paper used about 15,000 GPU-hours on NVIDIA H100 80 GB GPUs, including the baselines and the MMLU evaluations but not failed attempts or memory and NaN probes.
F Glossary of Symbols
Subscripts and denote the teacher and the student, and stands for either. Superscripts , , and denote the cp rank, the tp rank, and the cell of both. Indices start at 0. Quantities in bytes carry the unit explicitly, and GiB is bytes.
Models and sizes (§3).
Dense and routed-expert parameters of
model ;
Layers of model
Full-attention, linear-attention, and MoE layers of model
Hidden width of model
Vocabulary size and its share per tp rank
Attention heads and key-value heads
Width of one attention head
Routed experts per token
Per-token width of the linear-attention context exchange (Table 13); in Table 20, the width in iterations of the moving average
Parallelism and layout (§3).
tp, pp, cp, dp, ep, Tensor-, pipeline-, context-, data-, etp expert-, and expert-tensor-parallel degrees
edp Data-parallel size of the routed experts, dp cp tp/ep at etp=1
A parallelism grid, the set of legal grids, and the node-minimal grid that fits
Nodes of grid ; number of nodes, each of 8 GPUs
Trainer nodes and producer nodes
Producer replicas of the teacher
Tensor and expert span of one producer replica
Per-GPU memory budget, 79.11 GiB
Tokens (rows) per sequence;
gbs Global batch size in sequences
Tokens per iteration, gbs
Tokens handled by one GPU per iteration,
Microbatches per DP replica, gbs/dp
Microbatches in flight across the pipeline
Bytes per activation element, 2
Degree of a parallel dimension (Table 13); number of parts in Lemma 1
Distance between the ranks of a dimension in Megatron's rank order and the number of ranks it spans; the dimension uses NVLink if , the GPUs of a node, and InfiniBand otherwise
Memory model (§3.1).
Student weights, gradients, and optimizer state per GPU
Student parameters per GPU
Activation memory in the colocated stack and activation and temporary memory of the streamed trainer (both drawn as in Figure 1)
Teacher weight shard per GPU in the colocated layout
Colocated logits buffers
Memory retained by the streamed loss, the windowed fused loss on streamed hidden states
Non-PyTorch memory (CUDA context, NCCL, allocator) of the colocated stack and the trainer
Trainer reference-cycle garbage,
loss-backward and recompute
temporary memory, and expert-layer block
Layers recomputed at once
Producer forward-pass activation and workspace memory, its NCCL buffers, and bytes per routed-expert parameter (1 for fp8, 2 for bf16)
Predicted peak memory per GPU of the colocated stack, the trainer, and the producer
Forward-only token rate of one producer replica (measurement per pair in Appendix B.1)
Iteration time
Traffic model (§3.2).
Bytes sent per GPU and iteration by TP collectives, pipeline activation transfers (per stage boundary and direction), CP exchanges, and expert dispatch and combine collectives of model
Bytes sent per GPU by the student's gradient reduction and parameter gather
Bytes per last-stage rank and iteration of the teacher-to-student transfer
All-reduces per layer: 2 for the teacher's forward pass, 6 for the student's forward, recompute, and backward passes
Algorithm (§4).
cp rank, tp rank, and the cell (last-stage rank) with both
i Row (token) index
r Rows per slot, one cp rank's share of a sequence
Windows per slot, rows per window , and window index; also denotes top- in Sections 2 and 5
Entry index within a tp rank's vocabulary shard and column index over the full vocabulary
Slot index in the producer's stream and the start slot of a resume
Receiver groups, one per DP replica (dp)
Iterations the producer may run ahead of the trainer
Final hidden states of model for the rows of cp rank (the slot), its window , and all rows
lm_head of model and its column shard on tp rank
Block of the logits of model held by cell , and its window
Logits of one row, their shard on tp rank , and the entry of column
Loss and statistics (§4.2).
Softmax of over the columns and its entry for column
Label of row and its one-hot vector
Training loss and the weight of the KD term
Ratio of the LM loss to the KL loss (ModelOpt's balancer) or to the KD loss (rescaled run) in a batch
The SQ-L+K, Bal-L+K, and rescaled-run losses (19); : KD weight at the completed fraction of the iterations
Language-modeling and KD terms of the loss, and
KL divergence of row , the one-hot label vector, and the KD weight of the target
and the teacher's entropy of row
Label loss and distillation loss (soft cross-entropy) of row ; differs from by the teacher's entropy
Log-sum-exp of the student's logits of a row
Row maximum of , sum of , and teacher-weighted sum of student logits
The same statistics over the shard of tp rank
Scan state after entry of a shard
The statistics over a set of columns
A set of columns, its disjoint parts (index ), and the tiles read in one scan (U tiles)
Number of columns in
Gradient of with respect to the window's student logits on tp rank
Real numbers, matrix transpose, and the base of the natural logarithm
1 if and 0 otherwise
-value of the paired McNemar test (Table 26), not the softmax