Kimi K3 on GB300: the architecture and the roofline
DRAFT (unlisted study), written by an AI. The architecture diagrams, the sheets, the sweeps and all of the prose were generated by Fable (Claude) from the author’s brief and have not had a human edit pass — see the footnote.1
The question: with a fixed global batch, GB300 NVL72 hardware and a fixed mixed-precision recipe, what is the smallest cluster that trains Kimi K3 at (close to) its best tokens/s per GPU? Part 3’s method, run again: count the FLOPs, count the bytes each parallelism moves per link, divide by the link’s rate, and check that compute covers the communication. Everything here is a speed-of-light number: spec peaks, perfect overlap, no kernel inefficiency. The sheets are live, as in part 3: the formula column is the program, blue values are knobs, and every sheet’s header downloads the whole page as one workbook.
Assumptions carried from the brief: forced-balanced routing (every EP rank receives exactly S · k tokens per sequence, as MoonEP guarantees; the slots MoonEP reserves for redundant experts are charged to memory, and the traffic of filling them is a knob, ured, 0 by default); cross-stage caching of the attention residual’s block store, so each block reaches a rank once per microbatch; cross-rank activation offload, so the in-flight activations of 1F1B are averaged across pipeline ranks; and two activation-checkpointing policies, A (recompute everything that is not a matmul) and B (recompute everything except SDPA, KDA and the routed experts).
The hardware: GB300 NVL72
Spec-sheet dense peaks first (NVIDIA’s GB300 NVL72 totals divide to exactly 2.5 and 5 PFLOP/s per GPU; the 2.45 and 4.9 one sometimes sees are the same numbers rounded the other way). But “peak GEMM rate” on Blackwell Ultra is not one number: the part is power limited, and how far below the architectural peak a perfectly efficient kernel settles depends on how much its operands make the datapath switch. Public B300 evidence (SXM6, 1,100 W, 148 SMs): cuBLASLt BF16 at 8192³ on low-switching small-integer operands reaches 2,110 TFLOP/s, 94 % of B300’s 2.25 PFLOP/s dense peak, and the raw tensor-core datapath 93 % in isolation, so the kernel side can essentially saturate; CuTe FP8 at the same shape reaches 3,125 TFLOP/s (69 % of 4.5), and a sustained tcgen05 GEMM at 32768² reports the SM clock falling from 2,032 to 1,522 MHz under the power cap. Random operands cost more power than small integers or all-ones (the H100 “predictable data” effect), so the regime that matters for training, large random-data GEMMs run back to back, lands well under the low-switching numbers: on the order of two thirds of peak on B300, and somewhat better on GB300 with its 1.4 kW envelope. The sheet therefore carries the spec peak and a sustained random-data rate separately, and uses the latter everywhere: 1.8 PFLOP/s BF16 as the practical target, and 2× that for MXFP8 (the spec ratio; a power-capped part may well do worse than 2×, since FP8 operands switch about as much per byte and move twice the elements). Both are knobs. Sources: the gb300-microbench repository (B300 SXM6 measurements), the mKernel B300 tcgen05 GEMM PR (sustained clock), and thonking.ai’s “predictable data” note (H100).
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| πbf16 | GB300 BF16 dense peak, spec (FLOP/s) | 2,500,000,000,000,000 | 2.50 × 1015 | 2.50 PFLOP/s | (hardware spec, dense) |
| πfp8 | GB300 FP8 dense peak, spec (FLOP/s) | 5,000,000,000,000,000 | 5.00 × 1015 | 5 PFLOP/s | (hardware spec, dense) |
| πfp4 | GB300 FP4 dense peak, spec (FLOP/s) | 15,000,000,000,000,000 | 1.50 × 1016 | 15 PFLOP/s | (hardware spec, dense; this recipe does not use it) |
| πsolbf16 | BF16 GEMM, sustained on random data (FLOP/s) | 1,800,000,000,000,000 | 1.80 × 1015 | 1.80 PFLOP/s | (model input: the practical target for a large random-operand GEMM at the 1.4 kW GB300 envelope — see the text) |
| ηbf16 | share of the spec peak | 0.72 | 7.20 × 10−1 | 72 % | πsolbf16 / πbf16 |
| πsolfp8 | MXFP8 GEMM, sustained on random data (FLOP/s) | 3,600,000,000,000,000 | 3.60 × 1015 | 3.60 PFLOP/s | (model input: 2× the BF16 figure, the spec ratio; under a power cap FP8 operands switch about as much per byte, so this is if anything generous) |
| ηfp8 | share of the spec peak | 0.72 | 7.20 × 10−1 | 72 % | πsolfp8 / πfp8 |
| βNV | NVLink per GPU, per direction (B/s) | 900,000,000,000 | 9.00 × 1011 | 900 GB/s | (hardware spec: 1.8 TB/s bidirectional) |
| βIB | scale-out per GPU (B/s) | 100,000,000,000 | 1.00 × 1011 | 100 GB/s | (hardware spec: ConnectX-8, 800 Gb/s) |
| NVL | GPUs per NVLink domain | 72 | (hardware spec) | ||
| MGPU | device memory per GPU (B) | 297,020,948,480 | 2.97 × 1011 | 297 GB | (as PyTorch reports it: 276.6 GiB; the spec sheet says 288 GB) |
A common variant uses 64 of the 72 GPUs in a domain (set NVL to 64, with EP and CP to match, and the sweeps below re-run on 64-GPU domains). Per GPU almost nothing changes: weights, gradients and activations per GPU depend on PP · EP and the cluster size, not on the domain, and the EP traffic per token moves by under 1 %. What changes is the grain, and which CP degrees are available. With FP32 gradients and states the no-offload minimum is still four domains, now 256 GPUs instead of 288. But each GPU carries 12.5 % more MXFP8 weights and gradients, and CP 3 no longer divides the domain. Policy A then needs CP 8 under interleaved zero-bubble and runs at about 4,680 tokens/s per GPU instead of 4,950, because KCP’s state exchange grows with CP. The one real advantage of 64 is not in this sheet: 896 experts divide by 64 (14 per rank) and not by 72, so MoonEP’s redundant-expert slots are needed for balance at 72 and not at 64.
The model: Kimi K3
The architecture from the released config and modeling code (the shapes that are only in the code: the KDA decay bottleneck and the gated norm). Ninety-three layers in a 3 : 1 KDA : gated-MLA hybrid, the first layer dense, every other layer a Stable LatentMoE with 896 routed experts of which 16 are active, read and written through a 3,584-wide latent; two shared experts in the hidden dim. The attention residual (AttnRes) adds a handful of norms and pseudo-query projections per layer.
Reading the diagram, which gives K3 the same infra-oriented treatment as part 1’s DeepSeek-V3 diagram (the kernels you actually run, with their shapes):
- Both column enclosures are tabbed. The attention column flips between the KDA block (69 layers) and the gated-MLA block (24 layers: every 4th, plus layer 93 so the stack ends global); the FFN column flips between the LatentMoE block (92 layers) and the single dense layer 1. The margin plan flips the attention tab too.
- KDA is a linear-attention scan, not a softmax attention: q/k/v come from one fused projection followed by per-channel short convolutions, and the delta-rule state update is steered by a per-channel decay α (a rank-128 bottleneck projection) and a per-head write strength β. There is no KV cache; the recurrent state is 96 heads of 128×128.
- The MLA layers are DeepSeek-V3’s MLA with two changes: NoPE (no rotary anywhere: the 64-dim slice DSv3 rotates rides along unrotated; position information comes from the KDA layers), and an input-dependent output gate σ(Wx) ⊙ before the out-projection, which the KDA layers also carry.
- The MoE block wraps the routed experts in a latent projection pair: tokens are down-projected 7,168 → 3,584 before the dispatch all-to-all, the 896 experts (16 active) run 3,584 → 2×3,072 → 3,584 in that latent width, and the combined output is RMSNormed and up-projected back to 7,168. This is why the EP traffic below is priced at the latent width. The two shared experts stay full width, fused as one 7,168 → 2×6,144 MLP.
- The attn-res mix pills are the attention residuals: each module’s input is an α-weighted mix over stored block representations (blocks of 12 layers) rather than the raw residual stream, with the α weights from a per-layer learnable pseudo-query against the RMSNormed block outputs. The rail between mixes carries the current block’s partial sum, which restarts every 12 layers; the dashed block-store inputs hold b₀ (the embedding) and one sum per finished block, so n grows from 1 to 8 with depth, and it is this store that must follow a microbatch down the pipeline.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| d | hidden dim | 7,168 | (architecture) | ||
| V | vocabulary | 163,840 | (architecture) | ||
| L | layers | 93 | (architecture) | ||
| Lkda | KDA layers | 69 | (architecture: 3 of every 4) | ||
| Lmla | gated-MLA layers | 24 | (architecture: every 4th, plus the last) | ||
| Ldns | dense-FFN layers | 1 | (architecture: layer 1, a KDA layer) | ||
| Lmoe | MoE layers | 92 | L − Ldns | ||
| nh | attention heads | 96 | (architecture) | ||
| dh | head dim · KDA q/k/v, MLA qk nope, v | 128 | (architecture) | ||
| dRh | head dim · MLA qk "rope" (never rotated: NoPE) | 64 | (architecture) | ||
| P | projection width | 12,288 | nh · dh | ||
| rq | q latent rank | 1,536 | (architecture) | ||
| rkv | kv latent rank | 512 | (architecture) | ||
| kcv | KDA short-conv kernel | 4 | (architecture) | ||
| rα | KDA decay bottleneck rank | 128 | (modeling_kimi_linear.py: = head dim) | ||
| E | routed experts | 896 | (architecture) | ||
| k | experts per token | 16 | (architecture) | ||
| I | expert inter dim | 3,072 | (architecture) | ||
| ℓ | expert latent width | 3,584 | (architecture: routed experts read and write the latent) | ||
| nsh | shared experts | 2 | (architecture: one fused MLP of 2× width, in the hidden dim) | ||
| Idns | dense-FFN inter dim | 33,792 | (architecture) |
The parameter tally reproduces the advertised 2.78T total and 104.2B active exactly (the test pins both to the digit). Sparsity is 27× (total over active), against DeepSeek-V3’s 18×: more parameters to hold per activated FLOP.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Nkda | KDA attention params, one layer | 443,740,384 | 4.44 × 108 | 444 M | 3 · d · P + 3 · P · kcv + d · rα + rα · P + P + nh + d · nh + d · P + dh + P · d (q/k/v projections, three depthwise convs, decay fa·fb + dt bias + A_log, β, full-rank output gate, gated-norm weight, out-proj) |
| Nmla | gated-MLA attention params, one layer | 232,196,096 | 2.32 × 108 | 232 M | d · rq + rq + rq · nh · (dh + dRh) + d · (rkv + dRh) + rkv + rkv · nh · (dh + dh) + d · P + P · d (q down · norm · up, kv down · norm · up, full-rank gate, out-proj) |
| Nrt | router params, one layer | 6,423,424 | 6.42 × 106 | 6.42 M | E · d + E (weight + correction bias) |
| Ne | params, one routed expert | 33,030,144 | 3.30 × 107 | 33.0 M | 3 · ℓ · I (gate, up, down in the latent) |
| Nlat | latent projections, one layer | 51,383,808 | 5.14 × 107 | 51.4 M | d · ℓ + ℓ + ℓ · d (down · norm · up) |
| Nsh | shared-expert params, one layer | 132,120,576 | 1.32 × 108 | 132 M | 3 · d · I · nsh |
| Nmoe | MoE FFN params, one layer | 29,784,936,832 | 2.98 × 1010 | 29.8 G | Nrt + E · Ne + Nsh + Nlat |
| Nactmoe | MoE FFN params a token activates, one layer | 718,410,112 | 7.18 × 108 | 718 M | Nrt + k · Ne + Nsh + Nlat |
| Ndns | dense FFN params | 726,663,168 | 7.27 × 108 | 727 M | 3 · d · Idns |
| Nmisc | norms + attention-residual params, one layer | 43,008 | 4.30 × 104 | 43.0 K | 6 · d (two block RMSNorms; two AttnRes norms and two pseudo-query projections) |
| Nemb | embedding (= LM head) params | 1,174,405,120 | 1.17 × 109 | 1.17 G | V · d |
| Nfin | final norm + attention-residual params | 21,504 | 2.15 × 104 | 21.5 K | 3 · d |
| Ntot | total params | 2,779,484,476,000 | 2.78 × 1012 | 2.78 T | 2 · Nemb + (Nkda + Ndns + Nmisc) + (Lkda − Ldns) · (Nkda + Nmoe + Nmisc) + Lmla · (Nmla + Nmoe + Nmisc) + Nfin (text model; the 401M vision tower and the (unreleased) MTP layer are out) |
| N | activated params | 104,189,612,640 | 1.04 × 1011 | 104 G | Nemb + (Nkda + Ndns + Nmisc) + (Lkda − Ldns) · (Nkda + Nactmoe + Nmisc) + Lmla · (Nmla + Nactmoe + Nmisc) + Nfin (DeepSeek’s convention: the embedding lookup is not counted, the head is) |
| Nexp | routed-expert params | 2,722,740,830,208 | 2.72 × 1012 | 2.72 T | Lmoe · E · Ne |
| Nne | non-expert params | 56,743,645,792 | 5.67 × 1010 | 56.7 G | Ntot − Nexp |
The batch and the cluster
K3’s report does not state its pre-training batch; Kimi K2 trained at 67M tokens per step, which this sheet adopts as 8,192 sequences of 8,192 tokens (K3 pre-trains at 8k context before extension). The cluster size is the knob the whole page is about; its default is the answer the last section reaches.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| B | sequences per step | 8,192 | (model input: 67M tokens per step, Kimi K2’s pre-training batch; K3’s is not published) | ||
| S | tokens per sequence | 8,192 | (model input: K3 pre-trains at 8k before extending) | ||
| D | tokens per step | 67,108,864 | 6.71 × 107 | 67.1 M | B · S |
| GPUs | GPUs in the cluster | 288 | (model input: four NVL72 domains, the smallest cluster where policy A fits with EP spanning a whole domain, FP32 gradients and states and no host offload (with CP 3) — see the tables at the end) | ||
| DGPU | tokens per GPU per step | 2.33 × 105 | 233 K | D / GPUs |
Compute
The compute time per step is a sum of GEMM terms, one sheet each. The recipe, as briefed: MXFP8 for the attention projections, the dense FFN and shared experts, the routed experts and their latent projections, and the LM head; the routers run BF16 with FP32 logits out; both attention cores in BF16. The routers come first, since the MXFP8 term is 6ND less theirs. Set h8 to 0 to run the LM head in BF16 instead: its GEMMs move to the BF16 term, the pipeline split reprices the last chunk, and the head’s rank keeps a BF16 weight.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| h8 | LM head in MXFP8 | 1 | (model input: 1 = MXFP8 (the briefed recipe), 0 = BF16) | ||
| Nbf16 | params in BF16 GEMMs | 590,872,576 | 5.91 × 108 | 591 M | Lmoe · E · d + (1 − h8) · Nemb (the routers (BF16 forward, FP32 logits out), and the LM head when h8 = 0; every other linear runs MXFP8) |
| Cbf16 | BF16 GEMM FLOPs inside 6ND | 237,916,724,064,681,984 | 2.38 × 1017 | 238 PFLOP | 6 · Nbf16 · D |
| Tbf16 | BF16 GEMM time, routers (and a BF16 head) (s) | 4.59 × 10−1 | 459 ms | Cbf16 / (GPUs · πsolbf16) |
Routed experts could run their weights in MXFP4, K3’s post-training QAT format, but this sheet keeps them in MXFP8; πfp4 is listed for the reader who wants to try it.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| C | FLOPs per step, 6ND | 41,952,279,269,222,645,760 | 4.20 × 1019 | 42.0 EFLOP | 6 · N · D |
| Cfp8 | FP8 GEMM FLOPs inside 6ND | 41,714,362,545,157,963,776 | 4.17 × 1019 | 41.7 EFLOP | C − Cbf16 |
| Tfp8 | FP8 GEMM time (s) | 4.02 × 101 | 40.2 s | Cfp8 / (GPUs · πsolfp8) |
Softmax attention runs on the 24 gated-MLA layers, BF16, quadratic in S and outside 6ND.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| cqk | QKᵀ-shaped FLOPs · one MLA layer, one sequence | 1,236,950,581,248 | 1.24 × 1012 | 1.24 TFLOP | 2 · nh · (dh + dRh) · S · S / 2 (causal keeps half the pairs) |
| cpv | PV-shaped FLOPs · one MLA layer, one sequence | 824,633,720,832 | 8.25 × 1011 | 825 GFLOP | 2 · nh · dh · S · S / 2 |
| Csdpa | softmax-attention FLOPs per step | 1,459,166,279,268,040,704 | 1.46 × 1018 | 1.46 EFLOP | Lmla · B · (4 · cqk + 3 · cpv) (FlashAttention: QKᵀ-shaped ×4 (fwd, bwd replay, dQ, dK), PV-shaped ×3 (fwd, dV, dP)) |
| Tsdpa | softmax-attention time, BF16 (s) | 2.81 × 100 | 2.81 s | Csdpa / (GPUs · πsolbf16) |
The KDA core is priced per token from its chunkwise form: three dh×dh state matmuls per head plus the intra-chunk terms; it is small, and this is the roughest line on the page.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Cch | KDA chunk size | 64 | (chunkwise form: recurrent across chunks, parallel within) | ||
| ckda | KDA FLOPs per token, one layer, fwd | 17,301,504 | 1.73 × 107 | 17.3 MFLOP | nh · (6 · dh · dh + 10 · Cch · dh) (per head: read, correct and update the dh×dh state (3 matmuls), plus the intra-chunk KKᵀ, UT transform (W, U) and QKᵀ·U terms; the C×C inverse is dropped) |
| Ckda | KDA FLOPs per step | 240,344,445,738,811,392 | 2.40 × 1017 | 240 PFLOP | 3 · Lkda · D · ckda (fwd + 2× for bwd; the kernel’s own state recompute is not counted) |
| Tkda | KDA time, BF16 (s) | 4.64 × 10−1 | 464 ms | Ckda / (GPUs · πsolbf16) |
Policy A recomputes only vector work, which 6ND never counted, so it adds no time here; policy B replays every non-expert, non-core matmul once in backward, a 2ND term on the replayed parameters.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Nrp | params replayed under policy B | 54,394,835,552 | 5.44 × 1010 | 54.4 G | N − Nemb − Lmoe · k · Ne (everything a token activates except the head and the routed experts: attention projections, latent, shared experts, routers, the dense FFN) |
| Crp | recompute FLOPs per step, policy B | 7,300,751,242,723,065,856 | 7.30 × 1018 | 7.30 EFLOP | 2 · Nrp · D (one forward replay) |
| Trp | replay time, policy B (s) | 7.04 × 100 | 7.04 s | Crp / (GPUs · πsolfp8) | |
| cArp8 | replayed MXFP8-GEMM FLOPs per token, all layers, policy A | 0 | 0.00 × 100 | 0 FLOP | (from the recompute figure: the matmuls its marks replay, one forward each (K3’s policy replays none; vector work stays unpriced)) |
| cArpbf | replayed BF16 FLOPs per token, all layers, policy A | 0 | 0.00 × 100 | 0 FLOP | (from the recompute figure: the router and the attention kernels it replays (attention at S = 8,192)) |
| TArp | replay time, policy A (s) | 0 | 0.00 × 100 | 0 ms | D · (cArp8 / πsolfp8 + cArpbf / πsolbf16) / GPUs |
Muon adds one more GEMM term: five Newton–Schulz iterations per weight matrix per step, BF16. K3 orthogonalizes q, k and v one head block at a time (Per-Head Muon, its §2.5), which makes the attention projections cheap; the 3 · 896 routed-expert matrices per layer are almost all of it. Each matrix is orthogonalized once, by the rank that owns it, after the pipeline drains: 472 ms per step against 44.0 s of compute, a share that holds at any cluster size, since a fixed batch spreads both over the same GPUs.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nNS | Newton–Schulz iterations per step | 5 | (Muon’s quintic iteration, as Kimi K2 and Moonlight run it) | ||
| cNSkda | Newton–Schulz FLOPs, one KDA layer’s attention | 33,310,521,098,240 | 3.33 × 1013 | 33.3 TFLOP | nNS · (3 · nh · (4 · dh · dh · d + 2 · dh · dh · dh) + 4 · rα · rα · d + 2 · rα · rα · rα + 4 · rα · rα · P + 2 · rα · rα · rα + 4 · nh · nh · d + 2 · nh · nh · nh + 2 · (4 · d · d · P + 2 · d · d · d)) (per m×n matrix (m ≤ n) and iteration: XXᵀ 2m²n, bA + cA² 2m³, BX 2m²n. Per-Head Muon (K3 §2.5) splits q, k and v into nh blocks of dh×d; then fa, fb, the β projection, the output gate and o whole; conv taps, decay and biases are vectors (AdamW)) |
| cNSmla | Newton–Schulz FLOPs, one gated-MLA layer’s attention | 33,195,968,430,080 | 3.32 × 1013 | 33.2 TFLOP | nNS · (4 · rq · rq · d + 2 · rq · rq · rq + nh · (4 · (dh + dRh) · (dh + dRh) · rq + 2 · (dh + dRh) · (dh + dRh) · (dh + dRh)) + 4 · (rkv + dRh) · (rkv + dRh) · d + 2 · (rkv + dRh) · (rkv + dRh) · (rkv + dRh) + 2 · nh · (4 · dh · dh · rkv + 2 · dh · dh · dh) + 2 · (4 · d · d · P + 2 · d · d · d)) (the q and kv down-projections whole; the q up-projection per head, (dh + dRh)×rq; the kv up-projection per head for K and for V, dh×rkv each; the output gate and o whole) |
| cNSmoe | Newton–Schulz FLOPs, one MoE layer | 2,625,514,997,022,720 | 2.63 × 1015 | 2.63 PFLOP | nNS · (4 · E · E · d + 2 · E · E · E + 3 · E · (4 · I · I · ℓ + 2 · I · I · I) + 2 · (4 · ℓ · ℓ · d + 2 · ℓ · ℓ · ℓ) + 3 · (4 · nsh · I · nsh · I · d + 2 · nsh · I · nsh · I · nsh · I)) (the router (K3 runs Muon on every matrix parameter; it is 0.05 % of the total either way), each routed expert’s three I×ℓ matrices, the latent down and up projections, the fused shared expert’s three) |
| cNSdns | Newton–Schulz FLOPs, the dense FFN | 115,223,235,133,440 | 1.15 × 1014 | 115 TFLOP | nNS · 3 · (4 · d · d · Idns + 2 · d · d · d) |
| CNS | Newton–Schulz FLOPs per step | 244,757,732,159,324,160 | 2.45 × 1017 | 245 PFLOP | Lkda · cNSkda + Lmla · cNSmla + Lmoe · cNSmoe + Ldns · cNSdns (every matrix once per step; the embedding and the head are AdamW) |
| TNS | Newton–Schulz time per step, BF16 (s) | 4.72 × 10−1 | 472 ms | CNS / (GPUs · πsolbf16) (each matrix orthogonalized once, by its owner, the work spread evenly over every GPU; after the pipeline drains, so outside λ and the bubble (none of it hidden in the drain)) |
The totals. Newton–Schulz stays out of Tc, which the pipeline schedules stretch, and is added once per step.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| TAc | compute time per step, policy A (s) | 4.40 × 101 | 44.0 s | Tfp8 + Tbf16 + Tsdpa + Tkda + TArp (plus whatever the figure’s marks replay; non-matmul replays are unpriced, as 6ND never counted them) | |
| TBc | compute time per step, policy B (s) | 5.10 × 101 | 51.0 s | Tfp8 + Tbf16 + Tsdpa + Tkda + Trp | |
| ρ∞ | tokens/s per GPU, compute only, policy A | 5.24 × 103 | 5.24 K | DGPU / (TAc + TNS) (the ceiling: no bubble, no exposed comms) |
The layout
EP lives inside one NVLink domain; PP stacks domains, and whatever is left is data parallel. The non-expert parameters are replicated across the EP ranks of a domain, which matters for both memory and the optimizer sharding below. In this sheet a narrower EP never costs rate and always costs memory (more experts per GPU), so left to itself a sweep picks the narrowest EP that fits; but a narrow EP concentrates routing imbalance, and a wide one dilutes it. MoonEP evens out the compute with redundant experts, and its bound of E/EP slots per GPU does grow as EP narrows (priced under NVLink traffic), but at the default ured of 0 that bound costs a narrow EP only the slots’ memory. The sweeps at the end therefore peg EP to the whole domain (72, or 64 if NVL is set so); the knob here is free. CP splits each 8k sequence over CP GPUs of a stage. The GPUs of a CP group hold the same weights (they are replicas of the non-expert slice and members of the domain’s EP group), and each keeps only its own slice’s activations. CP must divide the domain and, for Ulysses, the 96 heads; the sweeps try every such degree (see Context parallelism).
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| PP | pipeline ranks | 4 | (model input) | ||
| EP | expert parallelism | 72 | (model input: the whole NVLink domain) | ||
| CP | context parallelism at the pre-training S | 3 | (model input: each sequence split over CP GPUs of a stage, Ulysses on the MLA layers and KCP on the KDA layers (see Context parallelism); CP divides every microbatch’s activations and multiplies the microbatches per pipeline. It must divide NVL and the nh heads) | ||
| DP | replicas of an expert slice | 1 | GPUs / (PP · EP) | ||
| DPne | replicas of a non-expert slice | 72 | GPUs / PP (every EP rank holds the same non-expert slice) | ||
| Vpp | virtual stages per rank (interleaved schedules) | 2 | (model input; the V-shaped schedules always use 2) |
NVLink traffic
Four kinds of traffic share the domain’s NVLink, one sheet each, then their sum. Dispatch and combine stay on NVLink. Per token and MoE layer the latent goes out MXFP8 (with one scale byte per 32) and comes back BF16, to k · (1 − 1/EP) remote ranks without dedup; K3 saves only the dispatch input and re-dispatches in backward, so the forward dispatch is paid three times per step rather than twice.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| MNV | remote ranks per token | 1.58 × 101 | k · (1 − 1 / EP) (no dedup: with experts sharing a rank the expectation is EP · (1 − (1 − 1/EP)k) − 1 ≈ 14.2 at EP 72) | ||
| Vdisp | dispatch bytes/token·layer | 5.83 × 104 | 58.3 KB | MNV · ℓ · (1 + 1 / 32) (MXFP8 latent + one E8M0 scale per 32) | |
| Vcomb | combine bytes/token·layer | 1.13 × 105 | 113 KB | MNV · ℓ · 2 (BF16) | |
| δdisp | dispatch replayed in backward | 1 | (from the recompute figure, 0/1: K3 saves only the dispatch input and re-dispatches (policy B does too)) | ||
| δcomb | combine replayed in backward | 0 | (from the recompute figure, 0/1) | ||
| Vtok | EP NVLink bytes per token | 3.69 × 107 | 36.9 MB | ((2 + δdisp) · Vdisp + (2 + δcomb) · Vcomb) · Lmoe (fwd + bwd, plus the replayed all-to-alls) | |
| VEP | EP NVLink bytes per GPU·step | 8.60 × 1012 | 8.60 TB | Vtok · DGPU | |
| TEP | EP time per step (s) | 9.55 × 100 | 9.55 s | VEP / βNV |
Balance itself has a price. MoonEP makes every rank receive exactly S · k tokens by copying overloaded experts to underloaded ranks, planned per layer and microbatch from the router’s output: the copies’ weights are fetched before the expert GEMMs, and their gradients are reduced back to the home rank afterwards (K3 §5.2.1). K3 proves that ⌈E/EP⌉ = 13 redundant experts per GPU always suffice and reserves that many slots, but it does not say how many a typical step uses, so ured is that share, 0 by default (the brief’s forced balance at no cost). At the bound, the copies would put 22.7 s per step on NVLink, 2.4 times the dispatch and combine (9.55 s). Under the self-overlap default, anything past about 41 % of the bound is exposed: beyond that point the EP traffic and the copies no longer fit under the expert GEMMs (the next sheet). The slots themselves are charged to memory whatever ured is (Mred, under Memory).
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| ured | redundant experts in use, share of MoonEP’s bound | 0 | (model input: 0 = the brief’s forced balance at no cost, 1 = every GPU fills every slot on every layer and microbatch (the worst case). K3 publishes only the bound) | ||
| nmaxred | redundant-expert slots per GPU, MoonEP’s bound | 13 | ⌈E / EP⌉ (K3 §5.2.1 and §E: a balanced plan always exists in which each GPU’s remote tokens come from one other GPU, so it needs at most that GPU’s experts (E/EP, rounded up when EP does not divide E), and some routings need nearly all of them) | ||
| Vmaxred | redundant-expert bytes per GPU·step, at the bound | 20,436,763,017,216 | 2.04 × 1013 | 20.4 TB | nmaxred · Ne · (2 · b8 + gB) · Lmoe · DGPU · CP / S (planned per MoE layer and microbatch (a GPU sees S / CP tokens of each): each slot’s MXFP8 weights fetched for the forward, fetched again in the other orientation for dgrad (the routed experts are never replayed, and holding the slots across the microbatches in flight would cost far more memory), and its gradient reduced back to the home GPU at gB) |
| Tmaxred | redundant-expert time per step, at the bound (s) | 2.27 × 101 | 22.7 s | Vmaxred / βNV | |
| Tred | redundant-expert time per step (s) | 0 | 0.00 × 100 | 0 ms | ured · Tmaxred |
Whether that traffic is hidden depends on the overlap strategy. Forward–backward overlap (DualPipe-style) lets any compute cover it, so the only question is fNV (the last sheet of this section) under 100 %. The default here is the other strategy: a megakernel-style MoE layer that pipelines its own dispatch against fc1/fc3 and its combine against fc2, needing no second microbatch in flight; then only the routed-expert GEMMs are available as cover, and EP time is 50.6 % of them. Under 100 % it is still hidden at speed of light; the exposed remainder, when there is one, is added to the step.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| ovl | overlap strategy | 1 | (model input: 0 = forward–backward overlap (DualPipe-style: another microbatch’s compute covers the EP traffic, anything under Tc is hidden); 1 = self-overlap (megakernel-style: dispatch pipelined against fc1/fc3 and combine against fc2, so only the routed-expert GEMMs cover it)) | ||
| Cexp | routed-expert GEMM FLOPs per step | 19,577,147,580,179,546,112 | 1.96 × 1019 | 19.6 EFLOP | 6 · Lmoe · k · Ne · D (the work the EP traffic can pipeline against; neither policy replays it) |
| Texp | routed-expert GEMM time per step (s) | 1.89 × 101 | 18.9 s | Cexp / (GPUs · πsolfp8) | |
| fselfEP | EP and redundant-expert time, share of the expert GEMMs | 5.06 × 10−1 | 50.6 % | (TEP + Tred) / Texp (over 100 %: under self-overlap the excess is exposed. The redundant experts’ weights must land before the expert GEMMs, in the dispatch’s window; their gradients go back under the backward’s) | |
| TxEP | exposed EP time per step (s) | 0 | 0.00 × 100 | 0 ms | ovl · max(0, TEP + Tred − Texp) (zero under forward–backward overlap; the pipeline’s fill and drain per layer are not counted) |
The EP ranks also hold identical non-expert slices, whose gradients reduce and whose updated weights gather over the same NVLink.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Xe1F1B | routed-expert params on the fullest rank, 1F1B | 710,280,216,576 | 7.10 × 1011 | 710 G | (from the pipeline model: the split’s layers on the rank with the most parameter bytes plus block store (activations are balanced across ranks by K3’s remote offload, parameters are not)) |
| Xn1F1B | non-expert params on the fullest rank, 1F1B | 13,939,803,072 | 1.39 × 1010 | 13.9 G | (its layers’ attention, norms, router, latents and shared experts; the embedding goes with the first chunk, the head with the last) |
| Xh1F1B | LM-head params on the fullest rank, 1F1B | 0 | 0.00 × 100 | 0 | (from the pipeline model: Nemb if the head’s chunk is on that rank, else 0 (part of the line above)) |
| XeILV | routed-expert params on the fullest rank, interleaved | 710,280,216,576 | 7.10 × 1011 | 710 G | (from the pipeline model: the split’s layers on the rank with the most parameter bytes plus block store (activations are balanced across ranks by K3’s remote offload, parameters are not)) |
| XnILV | non-expert params on the fullest rank, interleaved | 14,151,347,360 | 1.42 × 1010 | 14.2 G | (its layers’ attention, norms, router, latents and shared experts; the embedding goes with the first chunk, the head with the last) |
| XhILV | LM-head params on the fullest rank, interleaved | 0 | 0.00 × 100 | 0 | (from the pipeline model: Nemb if the head’s chunk is on that rank, else 0 (part of the line above)) |
| XeV | routed-expert params on the fullest rank, V shape | 710,280,216,576 | 7.10 × 1011 | 710 G | (from the pipeline model: the split’s layers on the rank with the most parameter bytes plus block store (activations are balanced across ranks by K3’s remote offload, parameters are not); the V shape puts the embedding and the head on rank 0) |
| XnV | non-expert params on the fullest rank, V shape | 14,151,347,360 | 1.42 × 1010 | 14.2 G | (its layers’ attention, norms, router, latents and shared experts; the embedding goes with the first chunk, the head with the last) |
| XhV | LM-head params on the fullest rank, V shape | 0 | 0.00 × 100 | 0 | (from the pipeline model: Nemb if the head’s chunk is on that rank, else 0 (part of the line above)) |
| Qexp | routed-expert params on this GPU, the fullest 1F1B rank | 9,865,003,008 | 9.87 × 109 | 9.87 G | Xe1F1B / EP (the rank’s experts, sharded over EP) |
| Qne | non-expert params on this GPU, the fullest 1F1B rank | 13,939,803,072 | 1.39 × 1010 | 13.9 G | Xn1F1B |
| VNVne | non-expert grad reduce + weight gather over NVLink, bytes/GPU | 82,477,168,176 | 8.25 × 1010 | 82.5 GB | Qne · (1 − 1 / EP) · (gB + 2) (the EP ranks are replicas of the non-expert slice: gradient reduce-scatter, BF16 all-gather, ring volume) |
| TNVne | non-expert sync over NVLink (s) | 9.16 × 10−2 | 91.6 ms | VNVne / βNV |
Context parallelism’s collectives run inside the domain too: Ulysses’ all-to-alls on the MLA layers and KCP’s state gather on the KDA layers (see Context parallelism, below, for both).
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| VCP | context-parallel bytes per GPU·step over NVLink | 1.21 × 1012 | 1.21 TB | (2 · (CP − 1) / CP · vuly · Lmla + 4 · nh · dh · dh · 4 · (CP − 1) · CP / S · Lkda) · DGPU (Ulysses on the MLA layers, KCP’s state all-gather on the KDA layers (both priced in Context parallelism); zero at CP 1) | |
| TCP | context-parallel time per step (s) | 1.35 × 100 | 1.35 s | VCP / βNV | |
| TxCP | exposed context-parallel time per step (s) | 1.35 × 100 | 1.35 s | ovl · TCP (under self-overlap no second microbatch is in flight, and Ulysses’ all-to-alls and KCP’s state gather sit between one microbatch’s kernels: all of it exposed (pessimistic for KCP, whose intra-chunk work could run under the gather); under forward–backward overlap it hides like the EP traffic) |
At speed of light NVLink is busy for 25.0 % of the compute time: fine, but not negligible, and the share is independent of cluster size (both sides scale with tokens per GPU).
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| TNV | NVLink time per step (s) | 1.10 × 101 | 11.0 s | TEP + Tred + TNVne + TCP | |
| fNV | NVLink time, share of compute (policy A) | 2.50 × 10−1 | 25.0 % | TNV / TAc |
ZeRO-1 over the scale-out network
Optimizer states are sharded over every replica of a slice. The per-step cost is a reduce-scatter of the gradients (at gB) and a BF16 all-gather of the updated weights of each GPU’s IB share, plus Muon’s Newton–Schulz gather (each rank fetches the remote shards of the matrices it owns). When a slice has exactly one replica the term is zero: that is the situation at the default cluster size, and it is why the smallest cluster is also the one with no scale-out optimizer traffic at all.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Ψ | params/GPU over IB | 9.65 × 109 | 9.65 G | (Nne + Nexp) / (PP · EP) (the expert slice whole; the non-expert slice split among the domain’s EP ranks, who gather the rest over NVLink) | |
| VNS | Newton–Schulz gather, bytes/GPU | 0 | 0.00 × 100 | 0 B | Ψ / DP · (1 − 1 / DP) · 4 (Muon: each rank fetches the remote shards of the matrices it owns, FP32) |
| Vsync | ZeRO-1 bytes/GPU per step | 0 | 0.00 × 100 | 0 B | Ψ · (1 − 1 / DP) · (gB + 2) + VNS (gradient reduce-scatter at gB, BF16 all-gather; zero when the slice has one replica) |
| Tsync | ZeRO-1 time per step (s) | 0 | 0.00 × 100 | 0 ms | Vsync / βIB |
Pipeline parallelism
A pipeline boundary carries more than one residual. Every attention-residual mix reads the block store (the embedding and one sum per finished 12-layer block) as well as the running partial sum, so a transition must carry the blocks the next rank does not hold yet, plus the partial sum; the widths grow down the pipe, from 2 to 9 hidden vectors per token. Each rank keeps every block it has seen for the microbatch (the AttnRes paper’s cross-stage caching), which saves traffic only when a rank sees the same microbatch a second time, as in interleaved and V-shaped schedules; there it cuts the return trip, but each rank also has twice the transitions. The figure counts it exactly for each layout; the sheet charges the busiest rank, both directions. It is charged to the scale-out link even when the whole pipeline fits inside a domain.
The bubble is plain 1F1B without virtual stages; with 100+ microbatches per pipeline at the default size it is a few percent, and virtual stages would cut it further at larger clusters.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| rres | hidden vectors the busiest rank sends per token, forward + backward | 17 | (from the pipeline model at this PP (the figure above): each transition carries the AttnRes blocks the receiving rank lacks plus the partial sum, backward returns the same as gradients; the widest of 1F1B, interleaved and V) | ||
| DPP | tokens per pipeline per step | 9.32 × 105 | 932 K | D · PP / GPUs | |
| Vres | boundary bytes per token, busiest rank | 243,712 | 2.44 × 105 | 244 KB | rres · d · 2 (BF16) |
| VPP | PP bytes per GPU·step | 2.27 × 1011 | 227 GB | Vres · DPP (the busiest rank, both directions; charged to the scale-out link) | |
| TPP | PP time per step (s) | 2.27 × 100 | 2.27 s | VPP / βIB | |
| m | microbatches per pipeline per step | DPP · CP / S (one sequence each, split over CP GPUs of a stage: a GPU sees S / CP tokens of it) | |||
| bPP | 1F1B bubble, share of compute | 8.79 × 10−3 | 0.879 % | (PP − 1) / m (no virtual stages) | |
| cmax8,1F1B | slowest rank’s FP8-GEMM FLOPs per token, 1F1B | 158,815,555,200 | 1.59 × 1011 | 159 GFLOP | (from the pipeline model at this PP: chunks cut to balance roofline time per rank, the LM head on the last chunk (K3 publishes no split)) |
| cmaxbf,1F1B | slowest rank’s BF16 FLOPs per token, 1F1B | 7,294,943,232 | 7.29 × 109 | 7.29 GFLOP | (the router and the attention kernels on that rank) |
| λ1F1B | stage imbalance, 1F1B: slowest rank over the mean | PP · (cmax8,1F1B / πsolfp8 + cmaxbf,1F1B / πsolbf16) · D / (Cfp8 / πsolfp8 + (Cbf16 + Csdpa + Ckda) / πsolbf16) (whole layers per rank: the slowest stage sets the pipeline’s pace, bubble included) | |||
| cmax8,ILV | slowest rank’s FP8-GEMM FLOPs per token, interleaved | 158,815,555,200 | 1.59 × 1011 | 159 GFLOP | (from the pipeline model at this PP: chunks cut to balance roofline time per rank, the LM head on the last chunk (K3 publishes no split)) |
| cmaxbf,ILV | slowest rank’s BF16 FLOPs per token, interleaved | 7,294,943,232 | 7.29 × 109 | 7.29 GFLOP | (the router and the attention kernels on that rank) |
| λILV | stage imbalance, interleaved: slowest rank over the mean | PP · (cmax8,ILV / πsolfp8 + cmaxbf,ILV / πsolbf16) · D / (Cfp8 / πsolfp8 + (Cbf16 + Csdpa + Ckda) / πsolbf16) (whole layers per rank: the slowest stage sets the pipeline’s pace, bubble included) | |||
| cmax8,V | slowest rank’s FP8-GEMM FLOPs per token, V shape | 158,815,555,200 | 1.59 × 1011 | 159 GFLOP | (from the pipeline model at this PP: chunks cut to balance roofline time per rank, the LM head on the last chunk (K3 publishes no split)) |
| cmaxbf,V | slowest rank’s BF16 FLOPs per token, V shape | 7,294,943,232 | 7.29 × 109 | 7.29 GFLOP | (the router and the attention kernels on that rank) |
| λV | stage imbalance, V shape: slowest rank over the mean | PP · (cmax8,V / πsolfp8 + cmaxbf,V / πsolbf16) · D / (Cfp8 / πsolfp8 + (Cbf16 + Csdpa + Ckda) / πsolbf16) (whole layers per rank: the slowest stage sets the pipeline’s pace, bubble included) | |||
| TAbub | bubble time per step, policy A (s) | 3.95 × 10−1 | 395 ms | TAc · λ1F1B · bPP (bubbles are slots of the slowest stage) | |
| TBbub | bubble time per step, policy B (s) | 4.58 × 10−1 | 458 ms | TBc · λ1F1B · bPP |
Memory
Weights unsharded in MXFP8 (gathered in BF16, kept in both scaling orientations: 2 · (1 + 1/32) B per parameter); gradients unsharded at gB bytes (4 for the all-FP32 policy, 2 for BF16 grads with FP32 accumulation in the epilogue; K3’s pipeline ZeRO-2 with CPU-offloaded shards would remove most of this line, left in as the device-resident case); optimizer state oB bytes per parameter (FP32 master + one Muon momentum, FP32 or BF16) sharded across all replicas. Both are knobs; the second table at the end sweeps all four combinations. The per-token stash is tallied per layer kind under each policy: MXFP8 for anything a GEMM consumes or a replayed vector op needs, BF16 for the kernels’ inputs and outputs. Under policy A the routed experts’ fc1 outputs dominate (k · 2 · I bytes per token per layer); policy B keeps those and little else.
Not every rank holds the same bytes. Activations can move: K3 offloads them to other pipeline ranks until every rank holds the same share, so the activation rows below are averages. Parameters cannot, and the split under Pipeline parallelism balances time, not bytes: the rank with the head gets fewer layers, and the embedding, which costs nothing to run, puts 1.2B parameters of weights and gradients on the first chunk’s rank. The V shape puts both on rank 0. The memory rows therefore test the fullest rank of each schedule family (1F1B, interleaved, V): its layers’ experts and non-expert parameters, the embedding or head if it has them, and its AttnRes block store, which is never offloaded (blocks held × microbatches in flight on that rank). With FLOP-balanced cuts the fullest rank carries 2 to 6 % more parameter bytes than the average at PP 3 to 8, where the minimum clusters sit, and up to 15 % at PP 24, where the embedding’s rank has as many layers as any other; a split that balanced bytes instead would trade that back against the stage imbalance λ.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| μ | reserved for temporaries, share of device memory | 0.1 | 1.00 × 10−1 | 10 % | (model input: workspace, communication buffers, fragmentation, the allocator’s slack — none of it is in the tally; the last table sweeps this) |
| Muse | usable memory per GPU (B) | 267,318,853,632 | 2.67 × 1011 | 267 GB | MGPU · (1 − μ) |
| b8 | bytes per MXFP8 element | 1.03125 | 1 + 1 / 32 (one E8M0 scale per 32) | ||
| gB | bytes per unsharded gradient element | 4 | (model input: 4 = FP32 grads, accumulation and reduce-scatter; 2 = BF16 grads and reduce-scatter with FP32 accumulation in the epilogue) | ||
| oB | optimizer bytes per sharded param | 8 | (model input: FP32 master weights + one Muon momentum: 8 = FP32 states, 6 = BF16 states) | ||
| W | weights on this GPU, MXFP8 (B) | 49,097,412,540 | 4.91 × 1010 | 49.1 GB | 2 · b8 · (Qexp + Qne) − (1 − h8) · (2 · b8 − 2) · Xh1F1B (unsharded, resident in both scaling orientations (forward and dgrad), as Transformer Engine keeps them; a BF16 head keeps its gathered BF16 copy, 2 B per param) |
| G | gradients on this GPU (B) | 95,219,224,320 | 9.52 × 1010 | 95.2 GB | gB · (Qexp + Qne) (unsharded; K3’s pipeline ZeRO-2 + CPU offload would cut this) |
| O | optimizer state on this GPU (B) | 80,468,891,072 | 8.05 × 1010 | 80.5 GB | oB · (Qexp / DP + Qne / DPne) (sharded across every replica of the slice) |
| Mred | redundant-expert slots on this GPU (B) | 2,160,377,856 | 2.16 × 109 | 2.16 GB | nmaxred · Ne · (b8 + gB) (MoonEP reserves the bound whatever ured, so planning never fails: one MoE layer’s slots at a time, MXFP8 weights in one orientation and the gradient staging buffer at gB) |
| WILV | weights + gradients on the fullest rank, interleaved (B) | 145,599,124,106 | 1.46 × 1011 | 146 GB | (2 · b8 + gB) · (XeILV / EP + XnILV) − (1 − h8) · (2 · b8 − 2) · XhILV |
| OILV | optimizer state on the fullest rank, interleaved (B) | 8.05 × 1010 | 80.5 GB | oB · (XeILV / (EP · DP) + XnILV / DPne) | |
| WV | weights + gradients on the fullest rank, V shape (B) | 145,599,124,106 | 1.46 × 1011 | 146 GB | (2 · b8 + gB) · (XeV / EP + XnV) − (1 − h8) · (2 · b8 − 2) · XhV |
| OV | optimizer state on the fullest rank, V shape (B) | 8.05 × 1010 | 80.5 GB | oB · (XeV / (EP · DP) + XnV / DPne) |
What each layer stashes for backward depends on which ops replay. The figure below is the block as an op graph: click an op to flip it between saved (↓) and recomputed (↻, teal); a recomputed op’s inputs must then be stashed or recomputed in turn, so a flip can move bytes elsewhere. The presets are no recompute, K3’s policy (element-wise operators and the attention-residual mixes recompute, the routed experts’ input comes back by re-dispatching, GEMM outputs stay in block-wise FP8) and recompute all (replay the layer from its input, both all-to-alls included). Stash formats stay at K3’s recipe throughout, so only the recompute choice moves. The figure drives the sheet’s policy A: its stash rows below are Σ κ · rate with one kept? input κ per tensor, set from the figure’s marks; a replayed all-to-all adds to the EP traffic, a replayed matmul or attention kernel to policy A’s compute time, and every table further down re-runs. The K3 preset is the published policy A.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| σres | residual stash per token, one layer | 28,672 | 2.87 × 104 | 28.7 KB | d · 2 + κmix1 · d · 2 + κx1 · d · 2 + κmix2 · d · 2 (x0, the checkpoint anchor, always; the rest as the figure stashes them, BF16; the AttnRes store is σstore) |
| σAkda | KDA stash per token, policy A | 88,291 | 8.83 × 104 | 88.3 KB | κn1 · d · b8 + κrstd1 · 4 + κqkv · 3 · P · b8 + κconv · 3 · P · 2 + κα · P · b8 + κfa · 2 · rα + κβ · nh · b8 + κg · P · b8 + κscan · P · 2 + κgo · P · b8 + κrstdg · 4 · nh + κout · d · 2 (κ = 1 where the recompute figure stashes the tensor (its kept? row below); the formats are K3’s recipe) |
| σAmla | gated-MLA stash per token, policy A | 138,114 | 1.38 × 105 | 138 KB | κn1 · d · b8 + κrstd1 · 4 + κcq · rq · b8 + κckv · (rkv + dRh) · b8 + κncq · rq · b8 + κrstdq · 4 + κnckv · rkv · b8 + κrstdkv · 4 + κq · nh · (dh + dRh) · 2 + κkv · nh · (2 · dh + dRh) · 2 + κattn · nh · dh · 2 + κlse · 4 · nh + κg · P · b8 + κgo · P · b8 + κout · d · 2 (κ = 1 where the recompute figure stashes the tensor (its kept? row below); the formats are K3’s recipe) |
| σAmoe | MoE stash per token, policy A | 125,088 | 1.25 × 105 | 125 KB | κn2 · d · (2 + b8) + κrstd2 · 4 + κrt · (E + k) · 4 + κz · ℓ · b8 + κdisp · k · ℓ · b8 + κfc1 · k · 2 · I · b8 + κact · k · I · b8 + κfc2 · k · ℓ · 2 + κcomb · ℓ · b8 + κnz · ℓ · b8 + κrstdz · 4 + κup · d · 2 + κfc1s · 2 · I · nsh · b8 + κacts · I · nsh · b8 + κfc2s · d · 2 + κadd · d · 2 (κ = 1 where the recompute figure stashes the tensor (its kept? row below); the formats are K3’s recipe) |
| σAdns | dense-FFN stash per token, policy A | 69,696 | 6.97 × 104 | 69.7 KB | κn2 · d · b8 + κrstd2 · 4 + κfc1d · 2 · Idns · b8 + κactd · Idns · b8 + κfc2d · d · 2 (κ = 1 where the recompute figure stashes the tensor (its kept? row below); the formats are K3’s recipe) |
| σstore | one AttnRes block, per token | 14,336 | 1.43 × 104 | 14.3 KB | d · 2 (BF16; a rank holds the blocks it has seen for every microbatch in flight, from the forward until that microbatch’s backward ends, and the cross-rank offload does not move them) |
| σA | stash per token, all layers, policy A | 24,634,143 | 2.46 × 107 | 24.6 MB | L · σres + Lkda · σAkda + Lmla · σAmla + Lmoe · σAmoe + Ldns · σAdns + 6 · V (+ the head’s BF16 logits and FP32 loss gradient) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| κmix1 | attn mix out kept? | 0 | (from the recompute figure, 0/1) | ||
| κx1 | x1 (partial sum) kept? | 1 | (from the recompute figure, 0/1) | ||
| κmix2 | ffn mix out kept? | 0 | (from the recompute figure, 0/1) | ||
| κn1 | norm1 out kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstd1 | norm1 out: its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κqkv | q, k, v (pre-conv) kept? | 1 | (from the recompute figure, 0/1) | ||
| κconv | q, k, v kept? | 0 | (from the recompute figure, 0/1) | ||
| κα | α (decay) kept? | 1 | (from the recompute figure, 0/1) | ||
| κfa | α (decay): its f_a output kept? | 1 | (from the recompute figure, 0/1) | ||
| κβ | β kept? | 1 | (from the recompute figure, 0/1) | ||
| κg | gate kept? | 1 | (from the recompute figure, 0/1) | ||
| κscan | scan out kept? | 1 | (from the recompute figure, 0/1) | ||
| κgo | gated out kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstdg | gated out: its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κout | attn proj out kept? | 0 | (from the recompute figure, 0/1) | ||
| κcq | q latent kept? | 1 | (from the recompute figure, 0/1) | ||
| κckv | kv latent kept? | 1 | (from the recompute figure, 0/1) | ||
| κncq | norm(q latent) kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstdq | norm(q latent): its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κnckv | norm(kv latent) kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstdkv | norm(kv latent): its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κq | q kept? | 1 | (from the recompute figure, 0/1) | ||
| κkv | k, v kept? | 1 | (from the recompute figure, 0/1) | ||
| κattn | attn out kept? | 1 | (from the recompute figure, 0/1) | ||
| κlse | attn out: its lse kept? | 1 | (from the recompute figure, 0/1) | ||
| κn2 | norm2 out kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstd2 | norm2 out: its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κrt | router state (logits, k probs) kept? | 1 | (from the recompute figure, 0/1) | ||
| κz | z (latent) kept? | 1 | (from the recompute figure, 0/1) | ||
| κdisp | dispatched tokens kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc1 | gate, up (routed) kept? | 1 | (from the recompute figure, 0/1) | ||
| κact | act out (routed) kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc2 | expert outputs kept? | 0 | (from the recompute figure, 0/1) | ||
| κcomb | combined latent kept? | 1 | (from the recompute figure, 0/1) | ||
| κnz | norm(latent) kept? | 0 | (from the recompute figure, 0/1) | ||
| κrstdz | norm(latent): its rstd kept? | 0 | (from the recompute figure, 0/1) | ||
| κup | moe out kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc1s | gate, up (shared) kept? | 1 | (from the recompute figure, 0/1) | ||
| κacts | act out (shared) kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc2s | shared out kept? | 0 | (from the recompute figure, 0/1) | ||
| κadd | ffn out kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc1d | gate, up kept? | 1 | (from the recompute figure, 0/1) | ||
| κactd | act out kept? | 0 | (from the recompute figure, 0/1) | ||
| κfc2d | ffn out kept? | 0 | (from the recompute figure, 0/1) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| σBkda | KDA stash per token, policy B | 24,576 | 2.46 × 104 | 24.6 KB | 2 · P (the kernel output only; its inputs come back with the replay) |
| σBmla | gated-MLA stash per token, policy B | 24,960 | 2.50 × 104 | 25.0 KB | 2 · P + 4 · nh (o and the LSE) |
| σBmoe | MoE stash per token, policy B | 105,136 | 1.05 × 105 | 105 KB | k · 2 · I · b8 + ℓ · b8 + 4 · k (the experts’ fc1 outputs, the combined latent, k probs; dispatch input, router, latent and shared experts come back with the replay) |
| σB | stash per token, all layers, policy B | 14,283,584 | 1.43 × 107 | 14.3 MB | L · 2 · d + Lkda · σBkda + Lmla · σBmla + Lmoe · σBmoe + 6 · V (block inputs BF16 + the kept kernels’ stashes + the head) |
Activations in flight: one sequence per microbatch, (PP + 1)/2 microbatches resident on average once cross-rank offload balances 1F1B’s skew, and this rank’s 1/PP of the layers.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nflt | microbatches in flight, 1F1B, averaged over ranks | 2.5 | (PP + 1) / 2 (1F1B holds PP − r on rank r; cross-rank offload balances them) | ||
| AA | saved activations per GPU, policy A, 1F1B (B) | 42,042,270,720 | 4.20 × 1010 | 42.0 GB | σA · S / CP · nflt / PP (S / CP tokens of one sequence per microbatch, balanced across ranks by the remote offload) |
| AB | saved activations per GPU, policy B, 1F1B (B) | 2.44 × 1010 | 24.4 GB | σB · S / CP · nflt / PP | |
| H1F1B | AttnRes blocks × microbatches in flight on the fullest rank, 1F1B | 12 | 1.20 × 101 | (from the pipeline model: blocks held × (PP − r) microbatches) | |
| Ast1F1B | block store on the fullest rank, 1F1B (B) | 469,762,048 | 4.70 × 108 | 470 MB | H1F1B · σstore · S / CP |
| HILV | AttnRes blocks × microbatches in flight on the fullest rank, interleaved | 27 | 2.70 × 101 | (from the pipeline model: blocks held × chunks in flight / V) | |
| AstILV | block store on the fullest rank, interleaved (B) | 1,056,964,608 | 1.06 × 109 | 1.06 GB | HILV · σstore · S / CP |
| HV | AttnRes blocks held on the fullest rank per microbatch, V shape | 6 | (from the pipeline model; every rank holds the same number of microbatches in a V, so each schedule multiplies by its own n) | ||
| MA | memory per GPU, policy A, 1F1B (B) | 269,457,938,556 | 2.69 × 1011 | 269 GB | W + G + O + Mred + AA + Ast1F1B (the fullest rank) |
| MB | memory per GPU, policy B, 1F1B (B) | 2.52 × 1011 | 252 GB | W + G + O + Mred + AB + Ast1F1B | |
| fAmem | of usable memory, policy A | 1.01 × 100 | 101 % | MA / Muse (over 100 %: does not fit) | |
| fBmem | of usable memory, policy B | 9.42 × 10−1 | 94.2 % | MB / Muse |
Other schedules
The rows above are plain 1F1B. Each schedule changes two cells: the microbatches in flight (memory) and the bubble (time). Interleaving with V virtual stages divides the bubble by V but roughly doubles the in-flight count; splitting the weight gradient off the backward (zero-bubble, ZB-H1) fills a further two thirds of the bubble at the same memory. The V-shaped schedules of “Pipeline Parallelism with Controllable Memory” (arXiv 2405.15362) put two chunks per rank in a V and trade bubble for memory: V-Min at a third of 1F1B’s peak, V-Half at half, V-ZB at 1F1B’s peak with no bubble at all. Bubble shares use the paper’s unit-time (F = B = W) counts; memory is the paper’s exact per-rank peak for the V schedules and the rank-averaged count for the interleaved ones. The sweep tables at the end consider every schedule.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nILVflt | microbatches in flight, interleaved 1F1B | 3.5 | PP − 1 + 1 / Vpp (rank r warms up with 2 · (PP − r − 1) + (V − 1) · PP + 1 chunks of 1/V; averaged over ranks, balanced by cross-rank offload) | ||
| bILV | bubble, interleaved 1F1B, share of compute | 4.39 × 10−3 | 0.439 % | (PP − 1) / (Vpp · m) | |
| MAILV | memory per GPU, policy A, interleaved 1F1B (B) | 2.88 × 1011 | 288 GB | WILV + OILV + Mred + σA · S / CP · nILVflt / PP + AstILV (the fullest rank) | |
| MBILV | memory per GPU, policy B, interleaved 1F1B (B) | 2.63 × 1011 | 263 GB | WILV + OILV + Mred + σB · S / CP · nILVflt / PP + AstILV (the fullest rank) | |
| ρAILV | tokens/s per GPU, policy A, interleaved 1F1B | 4.97 × 103 | 4.97 K | DGPU / (TAc · λILV · (1 + bILV) + TNS + TxEP + TxCP) | |
| ρBILV | tokens/s per GPU, policy B, interleaved 1F1B | 4.30 × 103 | 4.30 K | DGPU / (TBc · λILV · (1 + bILV) + TNS + TxEP + TxCP) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nIZBflt | microbatches in flight, interleaved zero-bubble (ZB-H1 split) | 3.5 | PP − 1 + 1 / Vpp (as interleaved 1F1B) | ||
| bIZB | bubble, interleaved zero-bubble (ZB-H1 split), share of compute | 1.46 × 10−3 | 0.146 % | (PP − 1) / (3 · Vpp · m) (F + B − W over F + B + W at F = B = W) | |
| MAIZB | memory per GPU, policy A, interleaved zero-bubble (ZB-H1 split) (B) | 2.88 × 1011 | 288 GB | WILV + OILV + Mred + σA · S / CP · nIZBflt / PP + AstILV (the fullest rank) | |
| MBIZB | memory per GPU, policy B, interleaved zero-bubble (ZB-H1 split) (B) | 2.63 × 1011 | 263 GB | WILV + OILV + Mred + σB · S / CP · nIZBflt / PP + AstILV (the fullest rank) | |
| ρAIZB | tokens/s per GPU, policy A, interleaved zero-bubble (ZB-H1 split) | 4.98 × 103 | 4.98 K | DGPU / (TAc · λILV · (1 + bIZB) + TNS + TxEP + TxCP) | |
| ρBIZB | tokens/s per GPU, policy B, interleaved zero-bubble (ZB-H1 split) | 4.32 × 103 | 4.32 K | DGPU / (TBc · λILV · (1 + bIZB) + TNS + TxEP + TxCP) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nVminflt | microbatches in flight, ZB-V-Min | 2 | ⌈(PP + 2) / 3⌉ (exact, every rank alike) | ||
| bVmin | bubble, ZB-V-Min, share of compute | 0.0078125 | 7.81 × 10−3 | 0.781 % | 2 · PP / (3 · m) (≈ 4 · PP pass-units per step over 6 · m; small constants dropped) |
| MAVmin | memory per GPU, policy A, ZB-V-Min (B) | 2.62 × 1011 | 262 GB | WV + OV + Mred + (σA / PP + HV · σstore) · S / CP · nVminflt (the fullest rank) | |
| MBVmin | memory per GPU, policy B, ZB-V-Min (B) | 2.48 × 1011 | 248 GB | WV + OV + Mred + (σB / PP + HV · σstore) · S / CP · nVminflt (the fullest rank) | |
| ρAVmin | tokens/s per GPU, policy A, ZB-V-Min | 4.95 × 103 | 4.95 K | DGPU / (TAc · λV · (1 + bVmin) + TNS + TxEP + TxCP) | |
| ρBVmin | tokens/s per GPU, policy B, ZB-V-Min | 4.29 × 103 | 4.29 K | DGPU / (TBc · λV · (1 + bVmin) + TNS + TxEP + TxCP) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nVhalfflt | microbatches in flight, ZB-V-Half | 3 | ⌈(PP + 1) / 2⌉ (exact, every rank alike) | ||
| bVhalf | bubble, ZB-V-Half, share of compute | 0.005859375 | 5.86 × 10−3 | 0.586 % | PP / (2 · m) (≈ 3 · PP pass-units over 6 · m) |
| MAVhalf | memory per GPU, policy A, ZB-V-Half (B) | 2.79 × 1011 | 279 GB | WV + OV + Mred + (σA / PP + HV · σstore) · S / CP · nVhalfflt (the fullest rank) | |
| MBVhalf | memory per GPU, policy B, ZB-V-Half (B) | 2.58 × 1011 | 258 GB | WV + OV + Mred + (σB / PP + HV · σstore) · S / CP · nVhalfflt (the fullest rank) | |
| ρAVhalf | tokens/s per GPU, policy A, ZB-V-Half | 4.96 × 103 | 4.96 K | DGPU / (TAc · λV · (1 + bVhalf) + TNS + TxEP + TxCP) | |
| ρBVhalf | tokens/s per GPU, policy B, ZB-V-Half | 4.30 × 103 | 4.30 K | DGPU / (TBc · λV · (1 + bVhalf) + TNS + TxEP + TxCP) |
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| nVZBflt | microbatches in flight, ZB-V (zero bubble) | 4 | PP (the no-bubble lower bound: one full microbatch) | ||
| bVZB | bubble, ZB-V (zero bubble), share of compute | 0 | 0.00 × 100 | 0 % | 0 |
| MAVZB | memory per GPU, policy A, ZB-V (zero bubble) (B) | 2.96 × 1011 | 296 GB | WV + OV + Mred + (σA / PP + HV · σstore) · S / CP · nVZBflt (the fullest rank) | |
| MBVZB | memory per GPU, policy B, ZB-V (zero bubble) (B) | 2.68 × 1011 | 268 GB | WV + OV + Mred + (σB / PP + HV · σstore) · S / CP · nVZBflt (the fullest rank) | |
| ρAVZB | tokens/s per GPU, policy A, ZB-V (zero bubble) | 4.99 × 103 | 4.99 K | DGPU / (TAc · λV · (1 + bVZB) + TNS + TxEP + TxCP) | |
| ρBVZB | tokens/s per GPU, policy B, ZB-V (zero bubble) | 4.32 × 103 | 4.32 K | DGPU / (TBc · λV · (1 + bVZB) + TNS + TxEP + TxCP) |
Offloading to the host
Is offloading activations always good? At speed of light it is a bandwidth question: every stashed byte crosses to Grace memory and back, and that traffic must hide inside the compute. φ is the share of the stash the host link can carry per step; over 100 % the whole stash can live on the host and only two microbatches of this rank’s layers stay resident. At the default layout φ is under 100 % for policy A — its MXFP8 stash is bigger than the host link can move inside the compute — and about even for policy B, so offload is a partial relief for A and a full one for B. The optimizer state is a separate question: offload it after the step and prefetch it during the last microbatch’s backward; βpf is the bandwidth that window demands. The sweep’s offload rows use these cells: resident activations = A − min(φ, 1) · (A − Amin), states resident only at the step’s end, both the mid-step and end-of-step peaks checked, host capacity checked.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| βhost | host memory bandwidth per GPU (B/s) | 256,000,000,000 | 2.56 × 1011 | 256 GB/s | (Grace LPDDR5X, 512 GB/s per superchip shared by two GPUs; the NVLink-C2C link (450 GB/s per direction) is not the limit) |
| Mhost | host memory per GPU (B) | 240,000,000,000 | 2.40 × 1011 | 240 GB | (480 GB per Grace, two GPUs) |
| VAoff | activation bytes through host memory per step, policy A | 11,480,342,724,608 | 1.15 × 1013 | 11.5 TB | 2 · σA · DGPU (every stashed byte written out and read back) |
| VBoff | activation bytes through host memory per step, policy B | 6.66 × 1012 | 6.66 TB | 2 · σB · DGPU | |
| TAoff | time to offload every activation, policy A (s) | 44.845088768 | 4.48 × 101 | 44.8 s | VAoff / βhost |
| TBoff | time to offload every activation, policy B (s) | 2.60 × 101 | 26.0 s | VBoff / βhost | |
| φA | share of the stash the host link can carry inside compute, policy A | 9.81 × 10−1 | 98.1 % | TAc / TAoff (over 100 %: everything can go; under: only this fraction, the rest must stay resident) | |
| φB | share of the stash the host link can carry inside compute, policy B | 1.96 × 100 | 196 % | TBc / TBoff | |
| AAmin | resident activations with full offload, policy A (B) | 33,633,816,576 | 3.36 × 1010 | 33.6 GB | 2 · σA · S / CP / PP (the microbatch in forward and the one prefetched for backward, this rank’s layers) |
| ABmin | resident activations with full offload, policy B (B) | 1.95 × 1010 | 19.5 GB | 2 · σB · S / CP / PP | |
| Tpf | prefetch window for the optimizer state (s) | 8.59 × 10−2 | 85.9 ms | TAc · 2 / (3 · m) (the last microbatch’s backward on this rank: B + W of one microbatch, policy A compute) | |
| βpf | bandwidth to prefetch the optimizer state in that window (B/s) | 9.37 × 1011 | 937 GB/s | O / Tpf | |
| fpf | of host bandwidth | 3.66 × 100 | 366 % | βpf / βhost (over 100 %: the prefetch spills past the last microbatch) | |
| mpf | microbatches of backward the prefetch must span | 4 | ⌈fpf⌉ (start it this many microbatches before the end; their activations then share the GPU with the arriving states) | ||
| Mend | memory per GPU at the optimizer step (B) | 226,945,905,788 | 2.27 × 1011 | 227 GB | W + G + O + Mred (states back on the GPU, activations gone) |
| MAoff | memory per GPU mid-step with states and activations offloaded, policy A, 1F1B (B) | 180,580,593,340 | 1.81 × 1011 | 181 GB | W + G + Mred + AAmin + Ast1F1B (valid when φA ≥ 100 %; the peak is the larger of this and Mend) |
| MBoff | memory per GPU mid-step with states and activations offloaded, policy B, 1F1B (B) | 1.66 × 1011 | 166 GB | W + G + Mred + ABmin + Ast1F1B | |
| fhost | host memory used, policy A, 1F1B | 5.10 × 10−1 | 51.0 % | (O + AA) / Mhost |
Putting it together
At the default layout (288 GPUs: PP 4 × EP 72, each sequence split over CP 3 GPUs, a single replica, so no ZeRO-1 traffic at all) plain 1F1B lands policy A at 101 % of usable memory (device memory less the μ reserve) and policy B at 94.2 %. ZB-V-Min holds 2 microbatches in flight instead of 2.5, brings policy A down to 262 GB and runs at 4.95 K tokens/s per GPU against a compute-only ceiling of 5.24 K; the loss is its 0.781 % bubble, CP’s traffic (1.35 s per step, exposed under the self-overlap default) and the stage imbalance λV = 1.021: whole layers per rank leave the slowest rank that much above the mean, and the pipeline runs at the slowest rank’s pace. Policy B pays its replay and lands at 4.32 K under interleaved zero-bubble. V-ZB would be slightly faster, but it holds a full PP of microbatches, and even with CP dividing each of them by 3 it misses usable memory by 0.8 GiB, less than the 2.0 GiB MoonEP reserves for redundant experts (Mred). EP traffic is 50.6 % of the expert GEMMs it pipelines against, so nothing is exposed under the self-overlap default. Host offload: the link can carry 98.1 % of policy A’s stash inside the compute and 196 % of policy B’s, so offloading everything is only possible for B; prefetching the optimizer state in one microbatch’s backward would need 366 % of the host bandwidth, so it has to start 4 microbatches early. The first table below sweeps cluster sizes and picks, per policy, the fitting layout with the best tokens/s per GPU; the second finds the smallest fitting cluster for each gradient × optimizer-state policy, with and without host offload; the third repeats that at the current gradient and optimizer knobs for a range of memory margins, since a tally that lands within a few percent of device memory is not a fit (workspace, communication buffers and fragmentation are not in it). All three try every schedule and every CP that divides the domain and the heads, with EP pegged to the domain, and name the winner; the first two use the margin knob μ. Rows marked † are communication bound at speed of light (comms exceed compute on some link), so their step time is understated.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| TIB | scale-out time per step (s) | 2.27 × 100 | 2.27 s | Tsync + TPP | |
| fIB | scale-out time, share of compute (policy A) | 5.17 × 10−2 | 5.17 % | TIB / TAc (under 100 % with fNV: compute bound, comms overlapped) | |
| TAstep | step time, policy A (s) | 4.71 × 101 | 47.1 s | TAc · λ1F1B + TAbub + TNS + TxEP + TxCP (the slowest stage’s compute, the bubble, Newton–Schulz, exposed EP and CP traffic) | |
| TBstep | step time, policy B (s) | 5.44 × 101 | 54.4 s | TBc · λ1F1B + TBbub + TNS + TxEP + TxCP | |
| ρA | tokens/s per GPU, policy A | 4.95 × 103 | 4.95 K | DGPU / TAstep | |
| ρB | tokens/s per GPU, policy B | 4.29 × 103 | 4.29 K | DGPU / TBstep | |
| εA | of the compute-only ceiling, policy A | 9.43 × 10−1 | 94.3 % | ρA / ρ∞ | |
| εB | of the compute-only ceiling, policy B | 8.18 × 10−1 | 81.8 % | ρB / ρ∞ |
| GPUs | domains | policy A · recompute non-matmul | policy B · recompute all but SDPA, KDA, experts | ||||
|---|---|---|---|---|---|---|---|
| layout · schedule | memory | tok/s/GPU | layout · schedule | memory | tok/s/GPU | ||
| gradients | optimizer states | host offload | policy A | policy B | ||
|---|---|---|---|---|---|---|
| min GPUs · layout | tok/s/GPU | min GPUs · layout | tok/s/GPU | |||
| margin | no offload | host offload | ||
|---|---|---|---|---|
| policy A | policy B | policy A | policy B | |
Reading the tables: once a zero-bubble schedule fits, tokens/s per GPU sits near the compute-only ceiling divided by the stage imbalance λ. What separates the layouts that fit is λ (2 to 4 %, depending on how the 93 layers and the head divide among the ranks), the bubble of the memory-lean schedules, and CP’s exposed traffic. CP is the memory lever: it divides each microbatch’s activations and block store by CP, and costs its all-to-alls and state gathers. It also shrinks the bubble (more, shorter microbatches), which is why V-ZB, the schedule with the most microbatches in flight, often wins once CP makes room for it. The sweeps keep the best rate over every CP, and CP shows up only where a layout needs it to fit. So “the minimum number of GB300s that maximizes tokens/s per GPU” is the smallest cluster at which the preferred policy fits. With EP spanning the domain, a 10 % memory reserve, FP32 gradients and states and nothing offloaded, that is four domains (288 GPUs) for either policy: A under CP 3 and ZB-V-Min at 4.95 K tokens/s per GPU, B under CP 3 and interleaved ZB at 4.32 K. Six domains buy 1.4 % more (CP 2 and V-ZB), what CP 3 and V-Min cost at four. BF16 gradients take both to three domains, with or without host offload; offload alone reaches four with everything FP32, without CP (the ‡ reminds that the optimizer prefetch must start several microbatches early). Three domains is the floor for any of this: at PP 3 each rank holds 31 layers, and below that the MXFP8 weights and gradients alone overflow. The margin table is the honest version of “fits”: this roofline holds no communication buffers, no fragmentation, no vision tower, and the minimum cluster holds at four domains up to a 20 % reserve and moves to six at 25 %. Not modeled: virtual pipeline stages, the vision tower, MTP, activation offload bandwidth, and any kernel efficiency below the spec peak (set η).
Context parallelism
K3 trains at 8k only at first: pre-training grows the window from 8k to 64k, and the cooldown from 256k to 1M (§3.4). Its pre-training stack lists context parallelism alongside PP, EP and ZeRO-1, citing DeepSpeed-Ulysses (§5.2), and gives the KDA layers their own scheme, KDA Context Parallelism (§5.1.2). On this page CP does two jobs. At 8k it is a memory lever: splitting each sequence over CP GPUs divides every microbatch’s activations by CP, which is what lets policy A fit on four domains instead of six (the layout knob CP, priced in the NVLink and memory rows above). In the long-context phases it is a necessity. The second half of the sheet below prices those phases at the default cluster with the batch’s tokens held fixed. Each GPU still processes the same tokens per step, so the projections, the experts and their traffic don’t change; the softmax attention grows with S, and CP adds its own traffic.
The 69 KDA layers carry their context in a fixed-size state, so KCP passes states, not tokens: each GPU all-gathers its slice’s cumulative transition and zero-start state, one dh×dh pair per head. That is cheap only when slices are long. A state is 96 · 128 · 128 FP32 values, 6.3 MB, about a hundred tokens’ worth of up-projected K and V. The 24 MLA layers have three options:
- Head-parallel (Ulysses), the scheme K3 cites. It all-to-alls Q, K and V from a sequence split to a head split and O back: 123 KB per token and layer, of which a GPU sends the (CP − 1)/CP that leaves it, no matter how large CP grows. It adds no FLOPs, but CP must divide the 96 heads.
- Latent all-gather, the shape of DeepSeek V4’s context parallelism. It gathers the 576-wide latent, 1.15 KB per token and layer from each of the CP − 1 other slices. The price is that every GPU re-runs the kv up-projection for every token it gathers.
- Up-projected K/V all-gather (Llama 3; ring attention moves the same bytes). It gathers 61.4 KB per token and layer from every other slice, and holds a layer’s whole-sequence K and V while its attention runs.
| cell | quantity | value (exact) | scientific | SI | formula |
|---|---|---|---|---|---|
| Sx | sequence length of the long-context phase | 65,536 | (model input: 64k ends pre-training; the cooldown runs 256k to 1M (K3 §3.4)) | ||
| CPx | context-parallel degree | 24 | (model input: 24 keeps a GPU’s slice of a 64k sequence at the S / CP tokens the memory rows above hold) | ||
| Dslice | tokens per GPU per sequence slice | 2.73 × 103 | 2.73 K | Sx / CPx | |
| ax | per-microbatch activations per GPU, relative to the pre-training layout | 1 | 1.00 × 100 | 1 × | Dslice · CP / S (the stash and the block store scale with a GPU’s tokens per microbatch: Sx / CPx against S / CP) |
| Txc | policy A compute per step at Sx (s) | 6.37 × 101 | 63.7 s | TAc + Tsdpa · (Sx / S − 1) (the batch’s tokens held fixed (K3 publishes no long-phase batch either): only the softmax attention grows; KDA is linear in S) | |
| Nukv | kv up-projection params, one MLA layer | 12,582,912 | 1.26 × 107 | 12.6 M | rkv · nh · 2 · dh |
| vuly | Q, K, V and O bytes per token·MLA layer | 122,880 | 1.23 × 105 | 123 KB | nh · (2 · (dh + dRh) + 2 · dh) · 2 (BF16, what Ulysses moves) |
| vlat | latent bytes per token·MLA layer | 1,152 | 1.15 × 103 | 1.15 KB | (rkv + dRh) · 2 (BF16: cKV and the shared, never-rotated dRh key) |
| vkv | up-projected K and V bytes per token·MLA layer | 61,440 | 6.14 × 104 | 61.4 KB | nh · (dh + dRh + dh) · 2 (BF16, the shared key broadcast to every head as the kernel sees it) |
| xa2a | share of a GPU’s all-to-all bytes that leave the NVLink domain | 0 | 0.00 × 100 | 0 % | max(0, CPx − NVL) / CPx (CP groups packed into domains) |
| xag | share of an all-gather’s peers beyond the NVLink domain | 0 | 0.00 × 100 | 0 % | max(0, CPx − NVL) / (CPx − 1) |
| Vuly | head-parallel (Ulysses): bytes per GPU·step | 1.32 × 1012 | 1.32 TB | 2 · (CPx − 1) / CPx · vuly · Lmla · DGPU (all-to-all Q, K, V from a sequence split to a head split and O back; the backward mirrors it. CP must divide the nh heads) | |
| Tuly | head-parallel (Ulysses): link time per step (s) | 1.46 × 100 | 1.46 s | Vuly · ((1 − xa2a) / βNV + xa2a / βIB) (no FLOPs added) | |
| Vlat | latent all-gather: bytes per GPU·step | 444,529,115,136 | 4.45 × 1011 | 445 GB | 3 · (CPx − 1) · vlat · Lmla · DGPU (gather forward, gather again and reduce-scatter its gradient backward) |
| Tlat | latent all-gather: link time per step (s) | 4.94 × 10−1 | 494 ms | Vlat · ((1 − xag) / βNV + xag / βIB) | |
| Clatrp | latent all-gather: replayed up-projection FLOPs per GPU·step | 12,947,848,928,690,176 | 1.29 × 1016 | 12.9 PFLOP | 8 · (CPx − 1) · Nukv · Lmla · DGPU (every GPU up-projects the CP − 1 gathered slices too: forward, recompute, dgrad, wgrad) |
| Tlatrp | latent all-gather: replay time per step, MXFP8 (s) | 3.60 × 100 | 3.60 s | Clatrp / πsolfp8 (compute: no overlap hides it) | |
| Vkv | up-projected K/V all-gather: bytes per GPU·step | 23,708,219,473,920 | 2.37 × 1013 | 23.7 TB | 3 · (CPx − 1) · vkv · Lmla · DGPU (Llama 3’s scheme (ring attention moves the same): every slice’s K and V forward, again backward, plus the dK and dV partials) |
| Tkv | up-projected K/V all-gather: link time per step (s) | 2.63 × 101 | 26.3 s | Vkv · ((1 − xag) / βNV + xag / βIB) | |
| Mkv | one layer’s gathered K and V, whole sequence (B) | 4,026,531,840 | 4.03 × 109 | 4.03 GB | Sx · vkv (resident while the layer’s attention runs) |
| Vkcp | KDA context parallelism (KCP): bytes per GPU·step | 3,408,056,549,376 | 3.41 × 1012 | 3.41 TB | 4 · nh · dh · dh · 4 · (CPx − 1) · Lkda · DGPU · CPx / Sx (K3 §5.1.2: each slice all-gathers its cumulative transition M and zero-start state S̃, dh×dh per head, FP32; the backward re-gathers M with the state gradient’s fragment: four state-sized matrices per slice and layer. KCP’s own FLOPs are not priced) |
| Tkcp | KCP: link time per step (s) | 3.79 × 100 | 3.79 s | Vkcp · ((1 − xag) / βNV + xag / βIB) (the same for every MLA scheme) | |
| Δul | Ulysses minus the latent all-gather, nothing overlapped (s) | -2.63 × 100 | -2.63 s | Tuly − Tlat − Tlatrp (negative: Ulysses is cheaper. With every transfer hidden, Ulysses costs nothing and the latent all-gather still costs Tlatrp) | |
| fΔ | the same, share of compute at Sx | -4.13 × 10−2 | -4.13 % | Δul / Txc | |
| CPtie | CP at which the two tie with nothing overlapped, inside a domain | 8.59 × 100 | 8.59 | 2 · vuly / βNV / (3 · vlat / βNV + 8 · Nukv / πsolfp8) (per token and layer: Ulysses (CP − 1)/CP · 2 · vuly of NVLink, the latent (CP − 1) · (3 · vlat of NVLink + 8 · Nukv FLOPs)) | |
| CPby | CP below which the latent all-gather moves fewer bytes | 7.11 × 101 | 71.1 | 2 · vuly / (3 · vlat) |
At 8k on CP 3, Ulysses and KCP put 1.35 s per step on NVLink, all of it exposed under the self-overlap default, against 44.0 s of compute (rows VCP to TxCP above). A GPU’s slice is only 2,731 tokens, and at a fixed S KCP’s bytes grow with CP · (CP − 1), so CP is a lever to pull only as far as memory requires.
At 64k on CP 24 (a GPU’s slice is the same 2,731 tokens, so the memory above still holds), Ulysses puts 1.46 s of traffic per step on NVLink. The latent all-gather moves only 494 ms but replays 3.60 s of up-projections, against 63.7 s of compute. Whether the transfers hide decides which is cheaper. If they overlap, Ulysses costs nothing (NVLink is busy for 25.0 % of the 8k step’s compute, and a smaller share at 64k) and the latent’s replay remains, because compute can’t hide behind compute. If nothing overlaps, the two tie at CP 8.59 and the latent wins only below that. It moves fewer bytes up to CP 71.1 or so, but on NVLink bytes are not where the cost is. The up-projected K/V all-gather needs 26.3 s of NVLink at 64k, which hides only with overlap, and 4.03 GB resident per layer, which grows with S. KCP adds 3.79 s whichever scheme the MLA layers use. The table sweeps CP at the current Sx, over the degrees that divide a pipeline stage.
| CP | tokens/GPU per slice | Ulysses | latent: link | latent: replay | K/V all-gather | KCP | Ulysses − latent |
|---|
Per GPU and step, each MLA scheme’s seconds depend only on CP, not on S, because the tokens per GPU are fixed; only compute and KCP move with Sx. So the ranking is the same in every phase, and the same seconds become a smaller share of compute as S grows. The difference is small either way, because only 24 of the 93 layers are MLA: below CP ≈ 9 a fully exposed latent all-gather saves at most 0.6 s per step, about 1 % of compute at 64k; above it Ulysses wins, by 2.6 s (4 %) at CP 24; and with any overlap Ulysses wins everywhere. K3’s choice of Ulysses is what this roofline would pick.
The limit is Ulysses’ divisibility, not its cost. A CP group has to fit inside a pipeline stage, which at the default cluster is one 72-GPU domain, and Ulysses also needs CP to divide 96 heads. So it stops at CP 24 here. At 1M that leaves 43,691 tokens per GPU per slice, 16 times the slice the memory section fits at 8k on CP 3. The latent all-gather can use all 72 GPUs of the stage (14,564 tokens, 5.3 times). Neither fits at this cluster without more recompute, more offload or more GPUs per stage, which is why the 1M cooldown is a different layout problem from the one this page solves. KCP is the opposite case: at 8k on CP 8 its slices are only 1,024 tokens, and the state exchange then costs more than either MLA scheme. Splitting 8k sequences to save memory is therefore a KDA cost first, which is why it pays only up to CP 3 or so.
Conclusion
Recommendation. Train Kimi K3 on four NVL72 domains, 288 GB300s, laid out as PP 4 × EP 72 with a single data-parallel replica, each 8k sequence split three ways by context parallelism (Ulysses on the MLA layers, KCP on the KDA layers), under a memory-lean zero-bubble pipeline schedule (ZB-V-Min) and the activation policy that recomputes only non-matmul work. Expect about 4.95 K tokens/s per GPU at speed of light, which is 94.3 % or more of what the GPUs can do at all on this model. Adding GPUs beyond that buys little tokens/s per GPU (six domains drop to CP 2 under V-ZB for 1.4 %); it mostly raises tokens/s. Taking GPUs away forces a trade: three domains (216) work only with BF16 gradients.
Why the floor is where it is. The model is 2.78T parameters, of which 2.72T are routed experts. With EP spanning a 72-GPU domain and PP ranks stacking domains, each GPU holds 1/(PP · 72) of the experts and 1/PP of everything else, in MXFP8 with gradients at 4 bytes and optimizer state at 8 bytes per parameter. At four domains that is 49.1 GB of weights, 95.2 GB of gradients and 80.5 GB of optimizer state per GPU, before any activation. One 8k-token microbatch stashes 24.6 MB per token across the whole model under policy A; a pipeline keeps several microbatches in flight, and the share that lands on one GPU is what decides whether the configuration fits in 267 GB of usable memory. Context parallelism cuts that share: on CP 3 each GPU keeps a third of every sequence’s activations. The schedule matters as much as the policy here: plain 1F1B lands at 101 %, V-Min at 262 GB, because it holds 2 microbatches in flight instead of 2.5.
Why tokens/s per GPU does not improve with more GPUs. Everything in the step either scales with tokens per GPU (compute, EP traffic, pipeline traffic) or is a per-step fixed cost (the optimizer sync, the bubble). With one replica the optimizer sync is zero, and with a zero-bubble or near-zero-bubble schedule the bubble is a few percent. So the rate at the smallest fitting cluster is already within a few percent of the compute-only ceiling, 5.24 K, and larger clusters win back only the last few percent: the bubble and CP traffic they can afford to drop, and a PP that divides the layers more evenly. The one thing that would move the ceiling is the GEMM rate itself: this page prices the GPUs at 3.60 PFLOP/s MXFP8 and 1.80 PFLOP/s BF16, a power-limited sustained estimate rather than the 5 PFLOP/s and 2.50 PFLOP/s spec peaks, and that single assumption is worth more than every parallelism choice on the page combined.
Why communication is not the constraint. Three links carry traffic. NVLink carries the expert dispatch and combine, 36.9 MB per token after the dispatch replay, and the context-parallel traffic: together 25.0 % of the compute time at speed of light, and 50.6 % of the expert GEMM time it can pipeline against even without a second microbatch in flight. The scale-out link carries the pipeline boundary (the partial sum plus the attention-residual blocks the next rank lacks) and, with more than one replica, the optimizer sync; at the recommended size that is 5.17 % of compute. The Grace link decides whether offload is free: it can carry 98.1 % of policy A’s stash inside the compute and 196 % of policy B’s, so offloading everything is only possible for B, and the optimizer prefetch must begin 4 microbatches before the end of the step rather than one.
What would change the recommendation. A larger memory reserve: at 25 % the no-offload minimum for policy A moves to six domains. Cheaper state: BF16 gradients bring both policies to three domains without offload. The overlap: CP’s traffic is charged exposed here; hidden, larger CP degrees would cost nothing, and the bubble they remove would favor them. A different batch: tokens per GPU scale everything proportional, so halving the global batch halves the compute per step but leaves the per-step state alone, and the amortization argument weakens. Imbalance: the sheet assumes forced-balanced routing, and prices MoonEP’s redundant experts only as a knob (ured, 0 by default). Full slots on every layer and microbatch would expose 13.4 s per step under self-overlap and take policy A’s V-Min rate from 4,951 to about 3,850 tokens/s per GPU; a narrow EP would save memory on paper and is excluded because it concentrates imbalance, and with it the copies MoonEP must make. And the GEMM rate, as above.
What this page is not. A speed-of-light tally: spec and estimated-sustained rates, perfect overlap wherever the arithmetic allows it, no kernel inefficiency, no straggler, no fill and drain inside the megakernel, no vision tower, no MTP, no virtual stages, the long-context phases only as a side calculation, unit-time bubble counts for the zero-bubble schedules, and a memory tally that holds no communication buffers or fragmentation beyond the μ reserve. The margin table at the end is the honest way to read the fits.
1 Disclosure: this draft study — prose, architecture diagrams, sheet structure and model — was generated by Fable (Claude) from the Kimi K3 config and technical report, part 3’s roofline sheets and the author’s stated assumptions, and has not yet had a human edit pass. It is not part of the published series. ↩