Tensor Parallelism in LLM Inference

Background

§2.1 LLM Inference Computation

§2.2 Tensor Parallelism and Collective Communication

§2.3 Modified Amdahl's Law

T ( p ) = T compute ideal p ⋅ η ⏟ §2.1 + N coll [ α + 2 ( p − 1 ) M p β net ] ⏟ §2.2

archive

2.3

2.4

Section 4

§4.1 User-facing performance

Data: wall-clock, end-to-end

指标: TTFT, TPOT, Total latency, Throughput(一张表覆盖 9 个 config)

Punchline: TTFT 随 p 近线性下降;TPOT 随 p 子线性,$B=1$ 甚至 regress → prefill 和 decode 行为不对称,引出后续 phase-split 分析

§4.2 Standard Amdahl's law falls short

Data shift: 一次性切换到 GPU active time on least-busy rank(之后 §4.2-4.5 一致使用)

论证: 用 p = 2 数据拟合 serial fraction s ,外推 p = 4 → 预测与实测系统性偏离

结论: standard Amdahl 假设 s 与 p 无关,但实际 comm 开销随 p 增长 → 需要更精细的模型

§4.3 Modified Amdahl with explicit communication

公式: $$T(p) = \underbrace{\sum_k \frac{\text{FLOPs}k / p}{\eta_k \cdot \min(\pi, \beta\text{mem} \cdot I_k)}}{T\text{compute}} + \underbrace{T_\text{kv_copy}}{\text{bytes}/\beta\text{mem}} + \underbrace{N_\text{coll}\left[\alpha + \frac{2(p-1) M}{p \beta_\text{net}}\right]}{T\text{comm}}$$

两个 implementation gap 参数:$\eta$(compute utilization)和 α (network latency),结构上对偶

§4.3 用理论值预测:

→ 给出 a priori 预测,列表展示

§4.4 Kernel-level breakdown and parameter calibration

Phase split: prefill vs decode(NVTX-marked)

5 类 kernel: weight matmul, attention, communication, KV cache copy, other

关键 finding:

Per-GPU 不对称机制:

参数标定(从实测数据):

§4.5 Double Roofline analysis

两张并排子图:

Compute Roofline:

Communication Roofline(平滑曲线,不是折线):

Punchline:

§4.6 (Optional) Validation on quad-A100

实验: 把同一份 setup 跑在 Delta quad-A100(SXM4, NVLink NV4, 单 NUMA)

变化的参数: π +2.1×, β mem +2.2×, β net +6×, NUMA penalty 消除

验证:

论文价值: 把分析框架从 "fit & explain" 升级为 "predict & verify"

附录

如何切分 prefill decode

新增内容

"We additionally capture per-kernel traces with NVIDIA Nsight Systems for each configuration; the processing pipeline used to extract per-phase, per-kernel-category timings is described in Section~4.4."

"我们观察到 prefill 阶段 weight_gemm 在多卡间存在 ~1% 的方差,这与节点上各 GPU 的 boost clock 在持续 compute-bound 负载下的浮动一致;attention 和 decode 阶段的 weight_gemm 由于落在 memory-bound 区域,不受 SM clock 浮动影响,因此跨卡时间一致。"