Pidoku

Communication Cost Math

Module 9 Lesson 9.g 1h 30m Difficulty 4/5

Prerequisites 9.c, 9.f, 14.c, 14.d


Before you start: words you need#

WordPlain meaning
α (alpha)The fixed cost of one communication step, whatever its size: kernel launch, synchronisation, the time for the first byte to cross the link. Measured in microseconds.
β (beta)The cost per byte: 1 ÷ bandwidth. Sending S bytes costs S × β = S ÷ bandwidth.
Step (hop)One round of a collective in which every GPU sends to a partner at the same time. A ring all-reduce over N GPUs takes 2(N−1) steps (9.f).
Message sizeThe bytes one all-reduce has to sum. For tensor parallelism: tokens in the step × hidden size × bytes per number (14.c).
Decode stepOne forward pass that produces one new token for every sequence in the batch (12.c).
OverheadCommunication time ÷ compute time. 20% means every step takes 1.2 times as long as the maths alone.
Scaling efficiencySpeedup ÷ number of GPUs. 8 GPUs that run 6 times faster are 75% efficient.
Hierarchical all-reduceAn all-reduce done in layers: sum inside each node over NVLink first, cross the network with a small piece, then share the result inside each node again.

1. What is it?#

A way to estimate, on paper, how much time a parallelism layout spends talking instead of computing. It is pure arithmetic, like the KV cache maths in 12.f, and it is how you choose between tensor, pipeline and expert parallelism (14.c–14.e) before renting hardware.

The whole lesson rests on one formula, the α-β model (also called the Hockney model):

Time of one collective = α × steps  +  β × bytes moved per GPU
                         └ latency ┘    └──── bandwidth ────┘

Typical inputs, consistent with 9.c and 9.f (measure your own):

Link                         α per step   bandwidth per GPU, one direction
NVLink 4 via NVSwitch (H100)   ~2 µs        450 GB/s
NVLink 5 (B200)                ~2 µs        900 GB/s
InfiniBand NDR / 400G RDMA     ~5 µs        ~50 GB/s     (NIC, switch hops, proxy thread)
PCIe 5 x16                     ~5–10 µs     ~50 GB/s

The formula has two regimes:

SMALL messages (up to a few hundred KB):  α × steps dominates   → latency-bound
LARGE messages (several MB and up):       β × bytes dominates   → bandwidth-bound

LLM decode lives in the small-message regime; prefill lives in the large-message regime. They need different reasoning, and different fixes.


2. Why does it matter?#

  • GPUs are expensive and communication is invisible on a spec sheet. A layout that looks fine (“16 GPUs, 16x the bandwidth”) can spend most of its time waiting on the network. Fifteen minutes of arithmetic can save a six-figure hardware mistake.
  • It explains the rules everyone follows. “Keep tensor parallelism inside an NVLink domain”, “TP ≤ 8 on H100”, “pipeline across nodes”: each is a result you can derive here instead of memorise.
  • It tells you which optimisation helps. If you are latency-bound, more bandwidth does nothing and fewer steps (one-shot or two-shot all-reduce, 9.f) helps a lot. If you are bandwidth-bound, the reverse.

3. Simple analogy#

Moving house with a van.

  • α is the fixed cost of every trip: loading the van, driving, parking, unloading. It is the same whether you carry one box or fifty.
  • β is the cost per box.

With a few small boxes (decode), the number of trips decides everything, so you want fewer trips, not a bigger van. With a whole house of furniture (prefill), the van’s size decides everything.

A ring all-reduce over 8 GPUs makes 14 trips. A two-shot all-reduce makes 2. For small loads that is the whole story.


4. Tiny example: one all-reduce by hand#

Llama-3-70B has hidden size 8192. In decode at batch 32, each tensor-parallel all-reduce sums 32 × 8192 numbers in BF16 (2 bytes each):

message S = 32 × 8192 × 2 = 524,288 bytes ≈ 0.52 MB

Ring all-reduce on 8 GPUs over NVLink 4 (α = 2 µs, 450 GB/s):
  latency term   = 2(N−1) × α        = 14 × 2 µs              = 28.0 µs
  bandwidth term = 2(N−1)/N × S ÷ BW = 1.75 × 0.52 MB ÷ 450 GB/s = 2.0 µs
  total                                                      ≈ 30 µs

93% of the time is the fixed cost of 14 steps. The bytes barely matter. A 70B model does this 160 times per decode step (2 per layer × 80 layers), so it adds up fast.


5. Technical explanation#

The volumes, per strategy#

Per forward pass (one decode step, or one prefill), per GPU. T is the number of tokens in the step: the batch size for decode, the prompt length × batch for prefill. d is the hidden size, b the bytes per activation (2 for BF16; activations usually stay in BF16 even when weights are FP8).

TENSOR PARALLELISM, N GPUs (14.c)
  2 all-reduces per layer, each of S = T × d × b
  bytes per GPU = 2L × 2(N−1)/N × S
  steps         = 2L × 2(N−1)  ring,  2L × 2·log₂N  tree,  2L × 2  two-shot

PIPELINE PARALLELISM, P stages (14.d)
  one point-to-point send of T × d × b at each stage boundary
  bytes = (P−1) × T × d × b,   steps = P−1     ← tiny, and only P−1 times per pass

EXPERT PARALLELISM, N GPUs, top-k routing (14.e)
  2 all-to-alls per MoE layer (dispatch tokens to experts, combine results)
  bytes per GPU ≈ 2 × L_moe × T_gpu × k × d × b × (N−1)/N
  (each token goes to k experts; with even routing, (N−1)/N of the copies leave the GPU,
   and an all-to-all sends distinct data to every peer, so there is no ring-style saving)

DATA PARALLELISM (14.b)
  nothing per step: each replica serves its own requests

Tensor parallelism is the expensive one: many collectives, every layer, on the critical path.

Worked example 1: tensor-parallel decode#

Llama-3-70B (80 layers, d = 8192, BF16, 141 GB of weights), TP = 8 on one H100 node, batch 32. Compute per decode step is the time to read each GPU’s eighth of the weights from HBM: 141.2 GB ÷ 8 ÷ 3.35 TB/s = 5.27 ms. The program in section 6 prints:

  ring        30.0 µs each   4.81 ms per step  overhead  91%
  tree        14.3 µs each   2.29 ms per step  overhead  44%
  two-shot     6.0 µs each   0.97 ms per step  overhead  18%
  of the ring time, latency term = 4.48 ms, bandwidth term = 0.33 ms

Two lessons:

  1. A naive ring model badly overestimates decode cost. NCCL uses trees, NVLink SHARP and the LL protocols for small messages, and engines use their own one-shot and two-shot kernels inside an NVLink domain (9.f). The algorithm choice moves the overhead from 91% to 18%.
  2. The latency term dominates decode. Of the ring’s 4.81 ms, 4.48 ms is the fixed cost of steps. This is why tensor-parallel scaling degrades with N and why custom all-reduce kernels exist.

Treat the two-shot row as a lower bound for an 8-GPU H100 node. Real overhead is usually somewhat higher, because of kernel launches between layers and imperfect overlap. Measure it (exercise C).

Worked example 2: tensor-parallel prefill#

Same model and node, one 2,048-token prompt:

  message 33.6 MB, ring 25.4 ms (latency 4.5 ms, bandwidth 20.9 ms)
  compute 60.2 ms, communication = 42% of compute

The message is 64 times larger than in decode (2,048 tokens instead of 32), and now the bandwidth term dominates: 20.9 of 25.4 ms. Compute here is FLOP-bound: 2 × 70.6 B × 2,048 FLOPs ÷ 8 GPUs at an assumed 600 TFLOP/s achieved per H100 (about 60% of the 989 TFLOP/s dense BF16 peak).

42% looks bad, but much of it can overlap with compute in prefill: the engine can start the next GEMM on one chunk while the previous chunk’s all-reduce runs, and fused GEMM + communication kernels do this inside one kernel (13.j). Fewer steps barely help here; more bandwidth (NVLink 5, NVLink SHARP) does.

Decode communication is latency-bound; prefill communication is bandwidth-bound. That is why the same engine uses different all-reduce algorithms for the two (9.f).


6. Under the hood: the calculator#

The program computes examples 1 and 2, then example 3: Llama-3.1-405B in BF16 (810 GB) on two 8×H100 nodes. One node has 640 GB, so the weights must span both. Should the 16 GPUs run TP = 16 across the nodes, or TP = 8 inside each node with PP = 2 across? Every layout keeps 64 sequences in flight. For PP that means two micro-batches of 32 taking turns, so both stages stay busy. Compute counts weight reads only; KV cache reads are ignored.

Go
// commcost.go: communication cost of tensor and pipeline parallelism, alpha-beta model.
package main

import (
	"fmt"
	"math"
)

// A link: alpha = fixed cost per step (seconds), bw = bytes/s per GPU, one direction.
type link struct{ alpha, bw float64 }

var (
	nvlink = link{2e-6, 450e9} // NVLink 4 through NVSwitch (H100 node)
	ib     = link{5e-6, 50e9}  // InfiniBand NDR 400 Gb/s, one NIC per GPU
)

const hbm = 3.35e12 // H100 HBM3, bytes/s

// All-reduce of s bytes over n GPUs (formulas from 9.f).
func ring(l link, n, s float64) float64 { return 2*(n-1)*l.alpha + 2*(n-1)/n*s/l.bw }
func tree(l link, n, s float64) float64 { return 2*math.Log2(n)*l.alpha + 2*s/l.bw }
func twoShot(l link, n, s float64) float64 {
	return 2*l.alpha + 2*(n-1)/n*s/l.bw
}

// Two nodes of g GPUs: reduce-scatter inside each node, all-reduce the 1/g shard
// across nodes over the NICs, all-gather inside each node.
func hierarchical(g, s float64, net link) float64 {
	intra := nvlink.alpha + (g-1)/g*s/nvlink.bw // one direct step through NVSwitch
	inter := ring(net, 2, s/g)
	return intra + inter + intra
}

func ms(t float64) float64 { return t * 1e3 }

func main() {
	// Example 1 and 2: Llama-3-70B, 80 layers, hidden 8192, BF16, TP=8 on one H100 node.
	const L, d, W = 80.0, 8192.0, 141.2e9 // W = weight bytes (70.6B params x 2)
	ars := 2 * L                          // all-reduces per forward pass
	fmt.Println("EXAMPLE 1  decode, batch 32, TP=8 over NVLink")
	s := 32 * d * 2
	compute := W / 8 / hbm
	fmt.Printf("  message %.2f MB, %0.f all-reduces, compute %.2f ms per step\n", s/1e6, ars, ms(compute))
	for _, a := range []struct {
		name string
		t    float64
	}{
		{"ring", ring(nvlink, 8, s)}, {"tree", tree(nvlink, 8, s)}, {"two-shot", twoShot(nvlink, 8, s)},
	} {
		lat := ars * a.t
		fmt.Printf("  %-9s %6.1f µs each  %5.2f ms per step  overhead %3.0f%%\n",
			a.name, a.t*1e6, ms(lat), 100*lat/compute)
	}
	fmt.Printf("  of the ring time, latency term = %.2f ms, bandwidth term = %.2f ms\n",
		ms(ars*2*7*nvlink.alpha), ms(ars*2*7.0/8*s/nvlink.bw))

	fmt.Println("\nEXAMPLE 2  prefill, one 2,048-token prompt, TP=8 over NVLink")
	s = 2048 * d * 2
	flops := 2 * 70.6e9 * 2048 / 8 // per GPU
	compute = flops / 600e12       // 600 TFLOP/s achieved BF16
	t := ars * ring(nvlink, 8, s)
	fmt.Printf("  message %.1f MB, ring %.1f ms (latency %.1f ms, bandwidth %.1f ms)\n",
		s/1e6, ms(t), ms(ars*14*nvlink.alpha), ms(ars*1.75*s/nvlink.bw))
	fmt.Printf("  compute %.1f ms, communication = %.0f%% of compute\n", ms(compute), 100*t/compute)

	// Example 3: Llama-3.1-405B BF16, 126 layers, hidden 16384, 2 nodes x 8 H100.
	// 64 sequences in flight in every layout. Weight reads only; KV reads ignored.
	const L3, d3, W3 = 126.0, 16384.0, 810e9
	ars3 := 2 * L3
	fmt.Println("\nEXAMPLE 3  405B BF16 decode on 2 nodes x 8 H100, 64 sequences in flight")
	fmt.Println("  layout                     comm ms  compute ms  ITL ms   tok/s")
	stage := W3 / 16 / hbm // every GPU holds 1/16 of the weights in both layouts
	s64 := 64 * d3 * 2
	for _, a := range []struct {
		name string
		t    float64
	}{
		{"TP=16, flat ring over IB", ring(ib, 16, s64)},
		{"TP=16, hierarchical", hierarchical(8, s64, ib)},
		{"  same, IB alpha 20 µs", hierarchical(8, s64, link{20e-6, ib.bw})},
	} {
		comm := ars3 * a.t
		itl := stage + comm
		fmt.Printf("  %-26s %7.1f %11.1f %7.1f %7.0f\n", a.name, ms(comm), ms(stage), ms(itl), 64/itl)
	}
	// TP=8 in each node, PP=2 across: two micro-batches of 32 take turns.
	s32 := 32 * d3 * 2
	tpComm := (ars3 / 2) * twoShot(nvlink, 8, s32) // each stage owns half the layers
	send := ib.alpha + s32/ib.bw
	perStage := stage + tpComm + send
	fmt.Printf("  %-26s %7.1f %11.1f %7.1f %7.0f\n", "TP=8 x PP=2",
		ms(2*(tpComm+send)), ms(2*stage), ms(2*perStage), 32/perStage)

	// KV cache room: 16 x 80 GB, 10% reserved, minus weights. 405B has 8 KV heads,
	// so TP=16 stores every KV head twice; TP=8 x PP=2 stores each once.
	kvTok := 2 * L3 * 8 * 128 * 2 // bytes per token, BF16
	room := 0.9*16*80e9 - W3
	fmt.Printf("\n  KV room %.0f GB, KV per token %.0f KB\n", room/1e9, kvTok/1e3)
	for _, c := range []struct {
		name   string
		copies float64
	}{{"TP=16", 2}, {"TP=8 x PP=2", 1}} {
		tokens := room / (kvTok * c.copies)
		fmt.Printf("  %-12s holds %4.0fk tokens = %3.0f sequences of 8k tokens\n",
			c.name, tokens/1e3, tokens/8192)
	}
}

Output:

EXAMPLE 1  decode, batch 32, TP=8 over NVLink
  message 0.52 MB, 160 all-reduces, compute 5.27 ms per step
  ring        30.0 µs each   4.81 ms per step  overhead  91%
  tree        14.3 µs each   2.29 ms per step  overhead  44%
  two-shot     6.0 µs each   0.97 ms per step  overhead  18%
  of the ring time, latency term = 4.48 ms, bandwidth term = 0.33 ms

EXAMPLE 2  prefill, one 2,048-token prompt, TP=8 over NVLink
  message 33.6 MB, ring 25.4 ms (latency 4.5 ms, bandwidth 20.9 ms)
  compute 60.2 ms, communication = 42% of compute

EXAMPLE 3  405B BF16 decode on 2 nodes x 8 H100, 64 sequences in flight
  layout                     comm ms  compute ms  ITL ms   tok/s
  TP=16, flat ring over IB      57.6        15.1    72.7     880
  TP=16, hierarchical            6.9        15.1    22.0    2907
    same, IB alpha 20 µs        14.5        15.1    29.6    2164
  TP=8 x PP=2                    2.1        30.2    32.3    1981

  KV room 342 GB, KV per token 516 KB
  TP=16        holds  331k tokens =  40 sequences of 8k tokens
  TP=8 x PP=2  holds  663k tokens =  81 sequences of 8k tokens

Reading example 3#

  • A flat ring across the nodes is hopeless: 30 steps per all-reduce, each paced by the slowest link (InfiniBand), 252 times per step. 57.6 ms of communication against 15.1 ms of compute.
  • A hierarchical all-reduce changes the picture. Summing inside each node over NVLink first leaves only one-eighth of the data to cross the network, in two steps. That is close to what NCCL’s tree and NVLS-tree algorithms do across nodes. In this idealised model TP = 16 then has the lowest latency (22 ms) and the highest throughput, even with a pessimistic 20 µs network step.
  • Pipeline parallelism wins on what the latency table leaves out. Two things decide it:
    1. KV cache capacity. Llama-3.1-405B has only 8 KV heads. With TP = 16, each KV head must be stored on two GPUs (14.c: the TP degree should divide the KV-head count). The KV cache costs twice the memory, so at 8k tokens per sequence the cluster holds 40 sequences, fewer than the 64 the table assumed. TP = 8 × PP = 2 holds 81.
    2. Fragility. TP = 16 puts 252 network round trips on the critical path of every token. Any jitter, congestion or one slow NIC adds to every one of them, and the custom NVLink all-reduce kernels cannot be used across nodes. PP crosses the network once per step with a 1 MB send that tolerates latency.

So the usual layout (and vLLM’s documented recommendation) is TP = GPUs per node, PP = number of nodes: derived, with the trade-off in view. PP costs per-token latency (each token passes both stages in turn: 32 ms against 22 ms), and you accept that for capacity and robustness. If ITL matters more than anything and the model has enough KV heads, measure cross-node TP rather than ruling it out.

On GB200/GB300 NVL72 racks, NVLink spans 72 GPUs across 18 trays (9.c), so “across nodes” no longer means “across the network”. There, wide TP or EP inside the rack uses NVLink numbers, not InfiniBand ones (9.h).


7. Performance implications: when does TP stop helping?#

As TP grows, each GPU reads fewer weights, so compute time falls as 1/N. The number of collective steps grows: as log N for trees, as N for rings. Somewhere the two curves cross.

Go
// tpscale.go: when does adding tensor-parallel GPUs stop paying off?
package main

import (
	"fmt"
	"math"
)

const (
	W     = 141.2e9 // weight bytes: Llama-3-70B in BF16
	BW    = 3.35e12 // HBM bytes/s per GPU (H100)
	alpha = 2e-6    // seconds per collective step
	L     = 80.0    // layers
	c     = 2.0     // all-reduces per layer
)

// One decode step: weights split N ways, plus 2*L tree all-reduces of 2*log2(N) steps.
// Small decode messages, so only the latency term is kept.
func step(n float64) (compute, comm float64) {
	return W / (n * BW), alpha * c * L * 2 * math.Log2(n)
}

func main() {
	base, _ := step(1)
	fmt.Println("   N  compute ms  comm ms  total ms  speedup  efficiency")
	for _, n := range []float64{1, 2, 4, 8, 16, 32, 64} {
		comp, comm := step(n)
		total := comp + comm
		fmt.Printf("%4.0f %11.2f %8.2f %9.2f %7.2fx %10.0f%%\n",
			n, comp*1e3, comm*1e3, total*1e3, base/total, 100*base/total/n)
	}
	// d/dN [W/(N BW) + 2 alpha c L log2 N] = 0  =>  N = W ln2 / (2 alpha c L BW)
	opt := W * math.Ln2 / (2 * alpha * c * L * BW)
	comp, comm := step(opt)
	fmt.Printf("\ntime-optimal N = %.1f: speedup %.1fx, efficiency %.0f%%\n",
		opt, base/(comp+comm), 100*base/(comp+comm)/opt)
	for _, th := range []float64{0.8, 0.7, 0.5} {
		best := 1.0
		for n := 1.0; n <= 64; n++ {
			comp, comm := step(n)
			if base/(comp+comm)/n >= th {
				best = n
			}
		}
		fmt.Printf("largest N with efficiency >= %.0f%%: %.0f\n", th*100, best)
	}
}

Output:

   N  compute ms  comm ms  total ms  speedup  efficiency
   1       42.15     0.00     42.15    1.00x        100%
   2       21.07     0.64     21.71    1.94x         97%
   4       10.54     1.28     11.82    3.57x         89%
   8        5.27     1.92      7.19    5.86x         73%
  16        2.63     2.56      5.19    8.11x         51%
  32        1.32     3.20      4.52    9.33x         29%
  64        0.66     3.84      4.50    9.37x         15%

time-optimal N = 45.6: speedup 9.5x, efficiency 21%
largest N with efficiency >= 80%: 6
largest N with efficiency >= 70%: 8
largest N with efficiency >= 50%: 16

The time-optimal point comes from setting the derivative of W/(N·BW) + 2αcL·log₂N to zero:

d/dN [W/(N·BW)]       = −W / (N²·BW)
d/dN [2αcL·log₂N]     =  2αcL / (N·ln2)

equal when  N = W·ln2 / (2αcL·BW)
              = 141.2e9 × 0.693 / (2 × 2e-6 × 2 × 80 × 3.35e12) ≈ 45.6

So the time-optimal TP degree is about 46, but efficiency there is about 21%: 46 GPUs for a 9.5x speedup. Time-optimal is not cost-optimal. Two more limits apply in practice. The TP degree must divide the head counts (Llama-3-70B has 64 query and 8 KV heads, so 6 is out and the useful values are 2, 4, 8). And on H100 the NVLink domain is 8 GPUs, so anything beyond 8 crosses the network and pays example 3’s costs.

Practical answer: the smallest TP that fits the model and meets the latency target, at most one NVLink domain, and data parallelism (14.b) for throughput. Now you can derive why.

Other effects to keep in mind:

  • Batch size moves the regime. Decode messages scale with batch: at batch 1 you are purely latency-bound, at batch 512 (8 MB messages for a 70B model) the bandwidth term is back.
  • Overlap hides some of it. Good engines overlap communication with compute (13.j). Expect measured overhead below the model’s prediction in prefill, and close to it in decode, where the all-reduce sits between dependent GEMMs.
  • The model ranks options well and predicts absolutes poorly. Use it to throw out bad layouts, then measure the survivors.

8. Production implications#

The estimation checklist, for any proposed layout:

1. Per-GPU weight bytes → compute time per step (decode: bytes ÷ HBM; prefill: FLOPs ÷ achieved FLOP/s).
2. Messages per step, their size and the step count for the algorithm actually used.
3. α and β measured on the real interconnect with nccl-tests (9.f), not taken from the datasheet.
4. T_comm = α × steps + β × bytes.  Overhead = T_comm ÷ T_compute.
5. Overhead above ~30% in decode: reconsider the layout.
6. Does the TP degree divide the query-head and KV-head counts? If not, KV memory is replicated.
7. Are all GPUs of each TP group in one NVLink domain?
8. Efficiency = speedup ÷ N. Below ~70%: smaller N plus data parallelism.
9. With PP: bubble (P−1)/(M+P−1) for M micro-batches (14.d), and per-token latency × P stages.
10. KV capacity left after weights, per layout (12.f, 12.q).
  • Do this before provisioning, and again when the batch size, model or hardware changes.
  • Record α and β per node type next to your capacity plan (23.b).
  • Verify the engine’s custom all-reduce is on. It matters most at small batch (9.f).

9. Common mistakes#

  1. Using ring step counts when NCCL and the engine use trees or two-shot. Overestimates small-message cost several times.
  2. Ignoring the latency term in decode. It dominates.
  3. Ignoring the bandwidth term in prefill. It dominates there.
  4. Optimising for time instead of efficiency. Time-optimal TP wastes GPUs.
  5. Using datasheet bandwidth. NVIDIA quotes NVLink both directions combined; the model needs one direction, and achieved rates are lower still (9.c).
  6. Comparing layouts on latency only. KV capacity (head replication) and robustness can decide it.
  7. Not re-deriving for a different batch size or model.

10. Hands-on exercise#

A. Extend the calculator. Add expert parallelism to commcost.go: for a MoE model of your choice, compute the all-to-all bytes per GPU per step at EP = 8 and EP = 16, using the formula in section 5. This is the companion to your 12.q capacity calculator.

B. Measure α and β. Run all_reduce_perf from 1 KB to 1 GB (9.f). Fit a straight line to time against message size: the intercept is roughly α × steps, the slope is roughly β × 2(N−1)/N. Compare with the table in section 1.

C. Validate the model. For a model you can run at TP = 2, 4 and 8, predict the communication overhead with your α and β and compare it with the measured step time (a profile from 22.h makes the all-reduces visible). What is your model’s error? Calibrate it.

D. Find the knee. Run tpscale.go for an 8B, a 70B and a 405B model, and for B200 (8 TB/s HBM). Where does efficiency drop below 70% for each? Why does a bigger model tolerate more TP?

E. Multi-node decision. Rerun example 3 with your measured InfiniBand α and β, and with a model that has 16 or more KV heads. Does TP = 16 become the better choice?


11. Interview questions#

  1. Write the α-β model of a collective. What are α and β, and how would you measure them?
  2. Why is decode communication latency-bound and prefill communication bandwidth-bound?
  3. Estimate the TP = 8 all-reduce overhead for a 70B model at batch 32 on NVLink.
  4. Why does tensor-parallel efficiency fall as N grows, and what is the functional form?
  5. Why is the time-optimal TP degree not the cost-optimal one?
  6. Two nodes, a model too big for one: TP = 16 or TP = 8 × PP = 2? Argue both sides.
  7. How does the number of KV heads affect the choice of TP degree?

12. Further reading#

Checked on 13 November 2026.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in