<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nvlink on lo0 — Tech Blog</title><link>https://blog.lo0.es/en/tags/nvlink/</link><description>Recent content in Nvlink on lo0 — Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 08 Jun 2026 06:00:00 +0200</lastBuildDate><atom:link href="https://blog.lo0.es/en/tags/nvlink/index.xml" rel="self" type="application/rss+xml"/><item><title>The corridors and the security guard: PCIe topology, GPUDirect P2P and ACS</title><link>https://blog.lo0.es/en/posts/pcie-topology-gpudirect-p2p-acs-security-guard/</link><pubDate>Mon, 08 Jun 2026 06:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/pcie-topology-gpudirect-p2p-acs-security-guard/</guid><description>&lt;blockquote>
&lt;p>This continues the &lt;em>below the engine&lt;/em> series. The &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">NVLink and NCCL post&lt;/a> explained the &lt;em>shared bench&lt;/em> over which the GPUs pass data to each other at 450 GB/s. But that bench only connects GPUs to each other. Everything else, disk, network, the host, travels over &lt;strong>another bus&lt;/strong>, PCIe, and through its corridors. The &lt;a href="https://blog.lo0.es/en/posts/pantry-lift-from-disk-to-hbm-why-the-kitchen-opens-late/">cold start&lt;/a> already brushed against this with GPUDirect Storage; this post opens up the complete floor plan of the corridors and the guard who watches them.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>On a 4×H100 SXM node, the GPUs talk over NVLink (450 GB/s per direction, around 7× PCIe), and for the all-reduce of &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">tensor parallel&lt;/a> that is the path. But PCIe does not go away: it is where everything else comes in. The weights come up from the NVMe over PCIe (the &lt;a href="https://blog.lo0.es/en/posts/pantry-lift-from-disk-to-hbm-why-the-kitchen-opens-late/">cold start&lt;/a>), the data from another node arrives via the NIC over PCIe (RDMA), and a KV that moves between nodes travels over PCIe. GPUDirect is the family that lets those bytes go &lt;strong>straight from the device into the HBM&lt;/strong> without bouncing through host RAM: P2P (GPU↔GPU), RDMA (GPU↔NIC) and Storage (GPU↔NVMe). The obstacle is a guard called ACS (Access Control Services): a PCIe security feature that by default forces &lt;em>peer-to-peer&lt;/em> traffic &lt;strong>up to the root complex&lt;/strong> for inspection, which destroys the direct path and inserts a detour through the CPU. The IOMMU (VT-d) does something similar if it is not in &lt;em>passthrough&lt;/em> mode. Disabling them gives performance; keeping them gives isolation and virtualisation, and that is a real decision in an ENS environment. This post explains the topology (&lt;code>nvidia-smi topo -m&lt;/code>), GPUDirect, why ACS and IOMMU break P2P with numbers, the 10 knobs and the trap of removing the guard without knowing what it was watching. On the generic 4×H100 SXM cluster.&lt;/p>
&lt;h2 id="where-you-are-the-corridors-not-the-bench">Where you are: the corridors, not the bench&lt;/h2>
&lt;p>Picture the kitchen as a building. The elite cooking stations, the GPUs, are in a room with a &lt;strong>huge central bench&lt;/strong> (NVLink/NVSwitch) over which they pass ingredients at full speed without standing up. That bench is for them and them alone.&lt;/p>
&lt;p>But the building has more to it: the pantry (the NVMe storage), the loading door (the network, the NIC) and reception (the CPU and its RAM). To reach any of those, the stations do not use the central bench: they use the &lt;strong>corridors of the building&lt;/strong>, the PCIe bus. And here the character of the post appears: at the entrance of each corridor there is a &lt;strong>security guard&lt;/strong> (ACS) who, by default, does not let two stations hand each other something directly along the corridor: it forces them to &lt;strong>take the parcel up to reception&lt;/strong> to be checked, and only then does it come down to its destination. It is safe, but it is an absurd detour when the two stations are right next to each other. GPUDirect is the permission to skip that detour; ACS and IOMMU are the reasons why, often, you cannot.&lt;/p>
&lt;h2 id="the-topology-of-a-node-two-buses-not-one">The topology of a node: two buses, not one&lt;/h2>
&lt;p>The most common mistake is to think that a node has &amp;ldquo;a bus&amp;rdquo;. There are (at least) two, and they do different things:&lt;/p>
&lt;ul>
&lt;li>NVLink / NVSwitch — the high-speed GPU↔GPU mesh. On H100 SXM, &lt;strong>18 links × 50 GB/s = 900 GB/s bidirectional&lt;/strong> between any two GPUs, with NVSwitch giving an &lt;em>all-to-all&lt;/em> with no contention (&lt;a href="https://www.nvidia.com/en-us/data-center/h100/">NVLink, NVIDIA&lt;/a>). It is the shared bench.&lt;/li>
&lt;li>PCIe Gen5 — the general I/O bus. An &lt;strong>x16 link gives 128 GB/s bidirectional&lt;/strong> (around 64 per direction) (&lt;a href="https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/h100/PB-11773-001_v01.pdf">H100 product brief&lt;/a>). It connects each GPU with the CPU, the RAM, the NICs and the NVMes. It is the corridor.&lt;/li>
&lt;/ul>
&lt;p>The difference is 7×: NVLink moves in one second what PCIe takes seven to move. That is why intra-node tensor parallel goes over NVLink and nobody argues about it. PCIe matters for the &lt;em>other&lt;/em> things: pulling weights off disk, receiving from the network, moving KV between nodes.&lt;/p>
&lt;p>The tool for seeing this is &lt;code>nvidia-smi topo -m&lt;/code>, which prints a matrix of how each pair is connected (&lt;a href="https://forums.developer.nvidia.com/t/nvidia-smi-topo-m-revisited/216584">NVIDIA forum&lt;/a>):&lt;/p>
&lt;pre tabindex="0">&lt;code> GPU0 GPU1 GPU2 GPU3 NIC0 CPU Affinity NUMA
GPU0 X NV18 NV18 NV18 PXB 0-47 0
GPU1 NV18 X NV18 NV18 PXB 0-47 0
GPU2 NV18 NV18 X NV18 SYS 48-95 1
GPU3 NV18 NV18 NV18 X SYS 48-95 1
&lt;/code>&lt;/pre>&lt;p>The legend is what matters: NV18 = 18 NVLink links (the bench); PXB = crosses PCIe switches but not the host; PHB = goes through the host bridge; NODE = same NUMA, crossing PCIe; SYS = crosses the inter-socket interconnect (the worst case, it traverses NUMA). The fact that &lt;code>GPU0↔NIC0&lt;/code> is PXB and &lt;code>GPU2↔NIC0&lt;/code> is SYS tells you exactly which GPU should handle that NIC&amp;rsquo;s traffic, GPU 0, without crossing NUMA. This links directly with the &lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">NUMA post&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/">network NUMA&lt;/a> one: PCIe affinity &lt;strong>is&lt;/strong> NUMA affinity.&lt;/p>
&lt;svg viewBox="0 0 720 280" xmlns="http://www.w3.org/2000/svg" font-family="sans-serif" font-size="12" role="img" aria-label="Topology of a node: NVLink on top, PCIe below, ACS as the gate">
&lt;rect x="120" y="20" width="480" height="40" rx="6" fill="none" stroke="#7c3aed" stroke-width="2"/>
&lt;text x="360" y="45" text-anchor="middle" fill="#7c3aed">NVSwitch — NVLink mesh 900 GB/s (GPU↔GPU bench)&lt;/text>
&lt;rect x="120" y="80" width="90" height="36" rx="4" fill="none" stroke="currentColor" stroke-width="1.5"/>&lt;text x="165" y="103" text-anchor="middle" fill="currentColor">GPU0&lt;/text>
&lt;rect x="250" y="80" width="90" height="36" rx="4" fill="none" stroke="currentColor" stroke-width="1.5"/>&lt;text x="295" y="103" text-anchor="middle" fill="currentColor">GPU1&lt;/text>
&lt;rect x="380" y="80" width="90" height="36" rx="4" fill="none" stroke="currentColor" stroke-width="1.5"/>&lt;text x="425" y="103" text-anchor="middle" fill="currentColor">GPU2&lt;/text>
&lt;rect x="510" y="80" width="90" height="36" rx="4" fill="none" stroke="currentColor" stroke-width="1.5"/>&lt;text x="555" y="103" text-anchor="middle" fill="currentColor">GPU3&lt;/text>
&lt;line x1="165" y1="80" x2="165" y2="60" stroke="#7c3aed" stroke-width="1.5"/>&lt;line x1="295" y1="80" x2="295" y2="60" stroke="#7c3aed" stroke-width="1.5"/>&lt;line x1="425" y1="80" x2="425" y2="60" stroke="#7c3aed" stroke-width="1.5"/>&lt;line x1="555" y1="80" x2="555" y2="60" stroke="#7c3aed" stroke-width="1.5"/>
&lt;rect x="250" y="160" width="220" height="34" rx="4" fill="none" stroke="#dc2626" stroke-width="2" stroke-dasharray="5 3"/>&lt;text x="360" y="182" text-anchor="middle" fill="#dc2626">PCIe switch + ACS (the guard)&lt;/text>
&lt;line x1="165" y1="116" x2="300" y2="160" stroke="#2563eb" stroke-width="1.2"/>&lt;line x1="295" y1="116" x2="330" y2="160" stroke="#2563eb" stroke-width="1.2"/>&lt;line x1="425" y1="116" x2="390" y2="160" stroke="#2563eb" stroke-width="1.2"/>&lt;line x1="555" y1="116" x2="420" y2="160" stroke="#2563eb" stroke-width="1.2"/>
&lt;rect x="120" y="230" width="120" height="34" rx="4" fill="none" stroke="currentColor"/>&lt;text x="180" y="252" text-anchor="middle" fill="currentColor" font-size="11">CPU + RAM (root)&lt;/text>
&lt;rect x="300" y="230" width="120" height="34" rx="4" fill="none" stroke="currentColor"/>&lt;text x="360" y="252" text-anchor="middle" fill="currentColor" font-size="11">NIC (network)&lt;/text>
&lt;rect x="480" y="230" width="120" height="34" rx="4" fill="none" stroke="currentColor"/>&lt;text x="540" y="252" text-anchor="middle" fill="currentColor" font-size="11">NVMe (disk)&lt;/text>
&lt;line x1="180" y1="194" x2="180" y2="230" stroke="#2563eb" stroke-width="1.2"/>&lt;line x1="360" y1="194" x2="360" y2="230" stroke="#2563eb" stroke-width="1.2"/>&lt;line x1="430" y1="194" x2="540" y2="230" stroke="#2563eb" stroke-width="1.2"/>
&lt;text x="610" y="180" fill="#dc2626" font-size="10">ACS on →&lt;/text>
&lt;text x="610" y="195" fill="#dc2626" font-size="10">up to root&lt;/text>
&lt;/svg>
&lt;h2 id="gpudirect-skipping-reception">GPUDirect: skipping reception&lt;/h2>
&lt;p>Without GPUDirect, moving a piece of data from the NIC (or the NVMe) to the GPU takes a mandatory detour: &lt;strong>device → host RAM → GPU&lt;/strong>. That bounce through RAM consumes CPU bandwidth, spends copies and adds latency. GPUDirect removes the bounce by letting the data go &lt;strong>straight from the device into the HBM&lt;/strong>. Three flavours:&lt;/p>
&lt;ul>
&lt;li>GPUDirect P2P — GPU↔GPU over PCIe (when there is no NVLink between them, or for traffic that does not use the bench).&lt;/li>
&lt;li>GPUDirect RDMA — GPU↔NIC: the network card writes directly into the HBM. It is what makes efficient multi-node viable (NCCL over InfiniBand/RoCE).&lt;/li>
&lt;li>GPUDirect Storage (GDS) — GPU↔NVMe: the disk writes straight into the HBM, with no host buffer. It is the lever of the &lt;a href="https://blog.lo0.es/en/posts/pantry-lift-from-disk-to-hbm-why-the-kitchen-opens-late/">cold start&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>On an SXM node, the GPU↔GPU traffic of &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">tensor parallel&lt;/a> &lt;strong>does not use P2P over PCIe&lt;/strong>: it uses NVLink. That is why GPUDirect matters above all at the edges of the node: the network (RDMA, for multi-node) and the disk (GDS, for startup). That is where ACS does damage.&lt;/p>
&lt;h2 id="the-guard-why-acs-and-iommu-break-p2p">The guard: why ACS and IOMMU break P2P&lt;/h2>
&lt;p>&lt;strong>ACS (Access Control Services)&lt;/strong> is a PCIe security feature designed for virtualisation and isolation: it guarantees that one device cannot read from or write to another directly without the &lt;em>root complex&lt;/em> mediating. To achieve that, it &lt;strong>forces peer-to-peer transactions up to the root complex&lt;/strong> and back down (&lt;a href="https://docs.nvidia.com/gpudirect-storage/best-practices-guide/index.html">GDS best practices, NVIDIA&lt;/a>). It is exactly the opposite of what GPUDirect wants: the direct path stops being direct.&lt;/p>
&lt;p>The IOMMU (VT-d on Intel, the equivalent on AMD) translates addresses and isolates devices. If it is active and &lt;strong>not&lt;/strong> in passthrough mode, it also &lt;strong>redirects P2P traffic through the root complex&lt;/strong>, with the same effect: performance through the floor or, in extreme cases, &lt;em>hangs&lt;/em> (&lt;a href="https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/troubleshooting.html">NCCL troubleshooting&lt;/a>).&lt;/p>
&lt;p>Summarised without detours (&lt;a href="https://morgangiraud.medium.com/multi-gpu-nvidia-p2p-capabilities-and-debugging-tips-fb7597b4e2b5">Giraud, debugging P2P&lt;/a>): ACS forces the trip through the root &lt;em>for security checks&lt;/em>; IOMMU forces it &lt;em>for isolation and virtualisation&lt;/em>. Both break the goal of P2P (direct communication with no intermediaries) and add overhead. If you do not need that security/virtualisation on that path, disabling them recovers the performance. The operational recipe for maximum GPUDirect performance: &lt;strong>ACS off&lt;/strong> on the switches along the path and &lt;strong>IOMMU in passthrough&lt;/strong> (&lt;code>iommu=pt&lt;/code>) or disabled.&lt;/p>
&lt;h2 id="the-maths-that-matter-how-much-the-detour-costs">The maths that matter: how much the detour costs&lt;/h2>
&lt;p>Take a &lt;strong>KV SWAP&lt;/strong> of 5 GB (preemption from the &lt;a href="https://blog.lo0.es/en/posts/vllm-scheduler-step-maitre-d-each-round/">scheduler&lt;/a> that sends KV to the host, or a transfer between nodes in &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Path&lt;/th>
&lt;th>Effective BW&lt;/th>
&lt;th>Time for 5 GB&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>NVLink (GPU↔GPU intra-node)&lt;/td>
&lt;td>~450 GB/s&lt;/td>
&lt;td>&lt;strong>~11 ms&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Direct PCIe Gen5 x16 (P2P, ACS off)&lt;/td>
&lt;td>~55 GB/s&lt;/td>
&lt;td>&lt;strong>~91 ms&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>PCIe via root complex (ACS on)&lt;/td>
&lt;td>~25-30 GB/s*&lt;/td>
&lt;td>&lt;strong>~170-200 ms&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>* The detour through the root does not just &amp;ldquo;add latency&amp;rdquo;: it saturates the host bridge bandwidth, contends with other traffic and, depending on the topology, can fall well below the direct path. The figure is an order of magnitude, to show the size of the problem, not a benchmark.&lt;/p>
&lt;p>The reading: on the path that does use PCIe (network, disk, swap), having ACS on can &lt;strong>double or triple&lt;/strong> the time. And if that time is on the critical path, a cold start, a preemption swap, an inter-node all-reduce, it shows up in the latency the user sees. What disabling ACS does &lt;strong>not&lt;/strong> fix: traffic that already went over NVLink (intra-node TP). There, ACS is irrelevant.&lt;/p>
&lt;h2 id="the-real-tension-performance-vs-isolation-and-ens">The real tension: performance vs isolation (and ENS)&lt;/h2>
&lt;p>Here the post gets serious, because the &amp;ldquo;disable ACS and IOMMU&amp;rdquo; recipe has a cost that in a regulated environment is not free. ACS and IOMMU &lt;strong>exist for a reason&lt;/strong>: to isolate devices. On a &lt;strong>dedicated bare-metal node&lt;/strong> for inference, with no virtualisation or multi-tenancy, you are not isolating anything that matters and disabling them is reasonable. But:&lt;/p>
&lt;ul>
&lt;li>If you do &lt;strong>GPU passthrough to VMs&lt;/strong> or use containers with strong isolation, the IOMMU is &lt;strong>necessary&lt;/strong>, not optional.&lt;/li>
&lt;li>In a multi-tenant scenario where several workloads share a node, ACS provides a guarantee that one device does not snoop on another.&lt;/li>
&lt;li>Under ENS (&lt;a href="https://blog.lo0.es/en/posts/technical-controls-ens-iso-42001-eu-ai-act-cross-mapping/">see technical controls&lt;/a>), workload isolation and access traceability can be requirements; disabling bus isolation to gain 80 ms is a decision you have to &lt;strong>justify and document&lt;/strong>, not a silent tweak.&lt;/li>
&lt;/ul>
&lt;p>The design way out, when you need both: &lt;strong>keep the isolation where compliance requires it and design so that the hot path does not depend on P2P over PCIe&lt;/strong>. Concretely, on an SXM node, the bulk of the critical traffic (TP) already goes over NVLink and ACS does not affect it. For the network, dedicate one NIC per GPU on its own PCIe switch (PXB) and use GPUDirect RDMA only on the path you control. For the disk, cache weights on local NVMe. That way you do not pay the choice between performance and isolation: you avoid it on the path that matters.&lt;/p>
&lt;h2 id="the-10-knobs">The 10 knobs&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>#&lt;/th>
&lt;th>Knob&lt;/th>
&lt;th>What it controls&lt;/th>
&lt;th>Cost / risk&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>ACS off (switches on the path)&lt;/td>
&lt;td>P2P detour through root&lt;/td>
&lt;td>you lose bus isolation&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>&lt;code>iommu=pt&lt;/code> / off&lt;/td>
&lt;td>P2P redirection through root&lt;/td>
&lt;td>breaks VM passthrough if off&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>&lt;code>nvidia-smi topo -m&lt;/code>&lt;/td>
&lt;td>audit the real topology&lt;/td>
&lt;td>— (always worth it)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>&lt;code>p2pBandwidthLatencyTest&lt;/code>&lt;/td>
&lt;td>measure P2P for real&lt;/td>
&lt;td>— (verify before assuming)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>NIC placement&lt;/td>
&lt;td>same PCIe switch as the GPU&lt;/td>
&lt;td>SYS if it crosses NUMA&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>NVMe placement&lt;/td>
&lt;td>NUMA-local to the GPU&lt;/td>
&lt;td>H2D crossing UPI&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>7&lt;/td>
&lt;td>&lt;code>nvidia-peermem&lt;/code> (GDR)&lt;/td>
&lt;td>enables RDMA into HBM&lt;/td>
&lt;td>correct driver/kernel&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>PCIe gen/lanes (x16)&lt;/td>
&lt;td>width of the corridor&lt;/td>
&lt;td>GPU silently at x8&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>9&lt;/td>
&lt;td>relaxed ordering / ASPM&lt;/td>
&lt;td>PCIe latency and power&lt;/td>
&lt;td>jitter if misconfigured&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>10&lt;/td>
&lt;td>persistence mode&lt;/td>
&lt;td>avoids re-init of the path&lt;/td>
&lt;td>idle GPU still paid for&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="how-it-connects-with-the-rest-of-the-stack">How it connects with the rest of the stack&lt;/h2>
&lt;p>&lt;strong>With NVLink and NCCL.&lt;/strong> The &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">NVLink post&lt;/a> covers the GPU↔GPU bench; this one covers the &lt;em>other&lt;/em> bus, the one connecting to disk, network and host. They are complementary: ACS affects PCIe, not NVLink.&lt;/p>
&lt;p>&lt;strong>With the cold start.&lt;/strong> The GPUDirect Storage of the &lt;a href="https://blog.lo0.es/en/posts/pantry-lift-from-disk-to-hbm-why-the-kitchen-opens-late/">disk→HBM post&lt;/a> is GPUDirect over the storage path; ACS on strangles it just as it strangles P2P.&lt;/p>
&lt;p>&lt;strong>With NUMA.&lt;/strong> The PCIe affinity of &lt;code>topo -m&lt;/code> &lt;strong>is&lt;/strong> the NUMA affinity of the &lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">host post&lt;/a>; placing NIC and NVMe on the correct NUMA avoids the SYS path.&lt;/p>
&lt;p>&lt;strong>With the network.&lt;/strong> NIC placement and GPUDirect RDMA is the subject of the &lt;a href="https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/">network NUMA post&lt;/a>; the same principle of &amp;ldquo;get the CPU out of the way&amp;rdquo;.&lt;/p>
&lt;p>&lt;strong>With PagedAttention and the scheduler.&lt;/strong> The preemption &lt;strong>SWAP&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/vllm-scheduler-step-maitre-d-each-round/">scheduler&lt;/a>) moves &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">KV&lt;/a> blocks over PCIe; that is why V1 prefers RECOMPUTE and why this bus matters.&lt;/p>
&lt;p>&lt;strong>With disaggregated serving.&lt;/strong> Transferring KV between pools in &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a> travels PCIe→NIC→PCIe; ACS and placement decide whether it is viable.&lt;/p>
&lt;p>&lt;strong>With ENS.&lt;/strong> Bus isolation is a technical control; see &lt;a href="https://blog.lo0.es/en/posts/technical-controls-ens-iso-42001-eu-ai-act-cross-mapping/">ENS/42001/AI Act controls&lt;/a>.&lt;/p>
&lt;h2 id="traps-and-things-that-are-not-what-they-look-like">Traps and things that are not what they look like&lt;/h2>
&lt;p>&lt;strong>&amp;ldquo;Disable ACS everywhere, it goes faster.&amp;rdquo;&lt;/strong> On a dedicated node, fine. On one with virtualisation, multi-tenancy or isolation requirements (ENS), you are removing a security control. The correct decision is &lt;em>per path&lt;/em> and documented, not global and silent.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;NVLink and PCIe are the same bus, more or less.&amp;rdquo;&lt;/strong> No. They are two buses with a 7× difference and different purposes. TP goes over NVLink; disk, network and host go over PCIe. Confusing them leads to &amp;ldquo;optimising&amp;rdquo; ACS for traffic that does not even go through PCIe.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;P2P just works, there is nothing to check.&amp;rdquo;&lt;/strong> P2P &lt;strong>is silently disabled&lt;/strong> with ACS/IOMMU active, and many distros enable them by default. Check with &lt;code>p2pBandwidthLatencyTest&lt;/code> and &lt;code>nvidia-smi topo -m&lt;/code>; do not assume you have the direct path just because the GPUs are on the same node.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;IOMMU off always, for performance.&amp;rdquo;&lt;/strong> If you do GPU passthrough to virtual machines, the IOMMU is mandatory; disabling it breaks the passthrough. The correct mode is usually &lt;code>passthrough&lt;/code> (&lt;code>iommu=pt&lt;/code>): it keeps the necessary mapping without penalising P2P.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;More PCIe lanes = faster GPU.&amp;rdquo;&lt;/strong> PCIe is the I/O path, not the compute path. A GPU at x8 instead of x16 takes longer to &lt;em>load&lt;/em> and to &lt;em>communicate over PCIe&lt;/em>, but generates tokens at the same speed once the weights are inside. The damage from x8 is in the cold start and in multi-node, not in decode throughput.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;GPUDirect fixes any I/O bottleneck.&amp;rdquo;&lt;/strong> GPUDirect removes the bounce through the CPU; if your bottleneck is the device itself (saturated NVMe, NIC at full tilt) or the topology (a SYS path crossing NUMA), GPUDirect does not touch it. Measure where the bottleneck is first.&lt;/p>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>This whole series has been going down floors looking for where the time goes, and this one reaches the wiring of the building. Intuition treats the node as a homogeneous box where &amp;ldquo;the GPUs talk to everything&amp;rdquo;; the reality is that there are two buses with opposite purposes, an elite bench for the GPUs (NVLink) and some service corridors for everything else (PCIe), and a security guard in the corridors who, with the best of intentions, makes every parcel go up to reception before it is delivered. GPUDirect is the permission for direct delivery; ACS and IOMMU are the legitimate reasons why sometimes you are not given it. The lesson is not &amp;ldquo;disable the guard&amp;rdquo;: it is understanding &lt;strong>which path is critical&lt;/strong> (almost never the one you think) and &lt;strong>what the guard was watching&lt;/strong> before sending it home. On a dedicated node, the direct path is almost free and worth taking. On one that shares workloads or lives under ENS, bus isolation is a control you sacrifice with justification or do not sacrifice at all. Good design does not choose between performance and isolation blindly: it puts the critical traffic on the bench that needs no guard, and leaves the corridors for what can wait.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">The shared bench: NVLink, NVSwitch and NCCL&lt;/a> — the GPU↔GPU bus that ACS does not touch; complementary to this post.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pantry-lift-from-disk-to-hbm-why-the-kitchen-opens-late/">From disk to HBM: cold start&lt;/a> — GPUDirect Storage over the NVMe path, strangled by ACS just like P2P.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">NUMA, hugepages and CPU isolation&lt;/a> — PCIe affinity is NUMA affinity; placing NIC and NVMe on the right socket.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/">Network NUMA, Cilium eBPF and DRANET&lt;/a> — NIC placement and GPUDirect RDMA, the same principle of getting the CPU out of the way.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention and the block manager&lt;/a> — the KV that travels over PCIe when a SWAP happens.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/vllm-scheduler-step-maitre-d-each-round/">The pass: vLLM&amp;rsquo;s scheduler step&lt;/a> — why V1 prefers RECOMPUTE to SWAP (it avoids the trip over PCIe).&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode separated&lt;/a> — transferring KV between nodes goes PCIe→NIC→PCIe.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/technical-controls-ens-iso-42001-eu-ai-act-cross-mapping/">Technical controls ENS / ISO 42001 / EU AI Act&lt;/a> — bus isolation as a security control to be justified.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>NVIDIA, &lt;em>GPUDirect Storage Best Practices Guide&lt;/em> (ACS, IOMMU, paths): &lt;a href="https://docs.nvidia.com/gpudirect-storage/best-practices-guide/index.html">https://docs.nvidia.com/gpudirect-storage/best-practices-guide/index.html&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>NCCL Troubleshooting&lt;/em> (IOMMU/VT-d and P2P): &lt;a href="https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/troubleshooting.html">https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/troubleshooting.html&lt;/a>.&lt;/li>
&lt;li>M. Giraud, &lt;em>Multi-GPU (NVIDIA) P2P capabilities and debugging tips&lt;/em>: &lt;a href="https://morgangiraud.medium.com/multi-gpu-nvidia-p2p-capabilities-and-debugging-tips-fb7597b4e2b5">https://morgangiraud.medium.com/multi-gpu-nvidia-p2p-capabilities-and-debugging-tips-fb7597b4e2b5&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>H100 Product Brief&lt;/em> (PCIe Gen5, NVLink 900 GB/s): &lt;a href="https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/h100/PB-11773-001_v01.pdf">https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/h100/PB-11773-001_v01.pdf&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>GPUDirect RDMA documentation&lt;/em>: &lt;a href="https://docs.nvidia.com/cuda/gpudirect-rdma/index.html">https://docs.nvidia.com/cuda/gpudirect-rdma/index.html&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>The shared bench: NVLink, NVSwitch and NCCL, the cable every token crosses in tensor parallel</title><link>https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/</link><pubDate>Sat, 06 Jun 2026 07:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/</guid><description>&lt;blockquote>
&lt;p>This post goes one floor below the engine. In the &lt;a href="https://blog.lo0.es/en/posts/anatomy-on-premise-llm-inference-stack-seven-layers/">seven-layer inference stack&lt;/a> and in &lt;a href="https://blog.lo0.es/en/posts/one-big-replica-or-many-small-ones-platform-decision/">one big replica or many small ones&lt;/a> the decision was &lt;em>how many&lt;/em> GPUs and &lt;em>how&lt;/em> to split the model; here we explain the cable that makes that split work, or that strangles it. It is the first of a mini-series &amp;ldquo;below the engine&amp;rdquo;: interconnect (this one) → kernel and NUMA → Kubernetes resource managers.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>&lt;strong>Tensor parallelism (TP) does not split a model into four chunks that run on their own.&lt;/strong> It spreads each layer across the GPUs, but after attention and after the MLP the GPUs have to &lt;strong>add up their partial results&lt;/strong> with an &lt;em>all-reduce&lt;/em>. On a Llama-70B with 80 layers, that is around 160 all-reduces &lt;strong>per generated token&lt;/strong>. That all-reduce travels over the interconnect, so the interconnect sits on the &lt;strong>critical path of every token&lt;/strong>, not in the background plumbing. On an HGX H100 baseboard, the 8 GPUs all talk to each other at &lt;strong>900 GB/s bidirectional&lt;/strong> via four NVSwitch chips; without NVSwitch/NVLink, that same traffic falls back to the CPU over PCIe and loses an order of magnitude. NCCL is the library that decides how each collective is done (ring, tree, or NVLS = NVLink-SHARP, which offloads the summation to the switch itself). And there is an asymmetry almost nobody keeps in mind: &lt;strong>decode is latency-bound&lt;/strong> (tiny messages, 16 KB) and &lt;strong>prefill is bandwidth-bound&lt;/strong> (huge batched activations), which is why &amp;ldquo;more NVLink bandwidth&amp;rdquo; speeds up prefill but barely touches token-by-token decode. This post explains the mechanism, gives the 10 real NCCL/driver knobs worth touching, and connects with vLLM&amp;rsquo;s custom all-reduce, disaggregated serving and GPU observability. With scepticism about which levers move the needle.&lt;/p>
&lt;h2 id="where-you-are-the-floor-below-the-engine">Where you are: the floor below the engine&lt;/h2>
&lt;div class="diagram" style="max-width:560px;margin:1.2rem auto;">
&lt;svg viewBox="0 0 560 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Stack layers: you are at the interconnect, below the engine">
&lt;text x="280" y="24" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="700" fill="currentColor">The vertical stack · you are at the cable&lt;/text>
&lt;rect x="120" y="40" width="320" height="40" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="65" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Model · weights, quantisation, KV cache&lt;/text>
&lt;rect x="120" y="86" width="320" height="40" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="111" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Engine · vLLM / SGLang (TP, PP, batching)&lt;/text>
&lt;rect x="120" y="132" width="320" height="40" rx="6" fill="#eef3fb" stroke="#4a6fa5" stroke-width="1.4"/>
&lt;text x="280" y="157" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">CUDA · kernels + NCCL (collectives)&lt;/text>
&lt;rect x="120" y="178" width="320" height="52" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="3"/>
&lt;text x="280" y="200" text-anchor="middle" font-family="sans-serif" font-size="12.5" font-weight="700" fill="#1f5c34">YOU ARE HERE · NVLink + NVSwitch&lt;/text>
&lt;text x="280" y="218" text-anchor="middle" font-family="sans-serif" font-size="10.5" fill="#2c6b42">the physical interconnect between GPUs&lt;/text>
&lt;rect x="120" y="236" width="320" height="40" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="261" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Hardware · H100 SXM GPU, HBM3, SM&lt;/text>
&lt;text x="280" y="298" text-anchor="middle" font-family="sans-serif" font-size="10.5" font-style="italic" fill="#777">every all-reduce from the engine above crosses this layer, per token&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-four-mechanics-and-a-single-bench">The analogy: four mechanics and a single bench&lt;/h2>
&lt;p>Four mechanics assemble one and the same car engine. It is not that each builds their own engine in parallel, that would be four cars (four replicas of the model, a different strategy). Here they build &lt;strong>a single one, at the same time&lt;/strong>, splitting the parts: one does the pistons, another the cylinder head, another the crankshaft. The problem is that the parts fit into each other: before going on, &lt;strong>all four have to put together what they have and check that it matches&lt;/strong>. That &amp;ldquo;put together and check&amp;rdquo; happens dozens of times during the build.&lt;/p>
&lt;p>There are two ways to organise the workshop:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>A single large bench, everyone around it (NVSwitch).&lt;/strong> Each mechanic reaches out and hands their part directly to any other, all at once, without standing up. It is instant and simultaneous. This is &lt;strong>NVLink + NVSwitch&lt;/strong>: the GPUs form an &lt;em>all-to-all&lt;/em> where anyone talks to anyone at 900 GB/s at the same time.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Four separate workshops with a courier (PCIe via CPU).&lt;/strong> Every part a mechanic wants to hand to another goes into a box, goes down to reception (host memory, via CPU), and from there up to the destination workshop. Slower, and serialised by reception. This is what happens when &lt;strong>there is no NVLink&lt;/strong>: inter-GPU traffic falls back to PCIe and bounces through the CPU, around 14× slower than NVLink.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>The thesis of the post follows on its own: &lt;strong>tensor parallelism only makes sense if the mechanics share the bench.&lt;/strong> As soon as the &amp;ldquo;put together and check&amp;rdquo; (the all-reduce) has to go through reception, splitting the work costs more than it saves. That is why, on a serious platform, TP &lt;strong>does not cross the NVLink boundary&lt;/strong>: TP=4 or 8 &lt;em>inside&lt;/em> the baseboard where there is NVSwitch, and above that you replicate or use pipeline, never stretch TP over PCIe or over the network. When each option makes sense is covered in &lt;a href="https://blog.lo0.es/en/posts/one-big-replica-or-many-small-ones-platform-decision/">one big replica or many small ones&lt;/a>; here we explain &lt;em>why&lt;/em> the cable dictates that decision.&lt;/p>
&lt;h2 id="the-mechanism-what-an-all-reduce-really-is-and-why-there-are-160-per-token">The mechanism: what an all-reduce really is and why there are 160 per token&lt;/h2>
&lt;p>Tensor parallelism splits the weight matrices by columns/rows across the $N$ GPUs. Each GPU computes a portion of the layer output. But the next operation needs the complete output, so it has to be recombined. That recombination is a collective operation: an &lt;code>all-reduce&lt;/code>, which adds the partial tensors of all the GPUs element by element and leaves the result &lt;strong>identical on all of them&lt;/strong>.&lt;/p>
&lt;p>In a standard transformer block there are &lt;strong>two synchronisation points per layer&lt;/strong>:&lt;/p>
&lt;ol>
&lt;li>After the output projection of attention (the &lt;code>o_proj&lt;/code> that recombines the split heads).&lt;/li>
&lt;li>After the second matrix of the MLP (the &lt;code>down_proj&lt;/code> that recombines the split feed-forward).&lt;/li>
&lt;/ol>
$$ \text{all-reduces per token} = 2 \times L_{\text{layers}} $$
&lt;p>For a Llama-70B ($L = 80$): $2 \times 80 = 160$ all-reduces &lt;strong>per generated token&lt;/strong>. Not per request, not per sequence: &lt;strong>per token&lt;/strong>. Multiply by decode throughput and you understand why the interconnect is not background infrastructure but a hot path.&lt;/p>
&lt;div class="diagram" style="max-width:800px;margin:1.2rem auto;">
&lt;svg viewBox="0 0 800 300" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="All-reduce in the decode loop of tensor parallel">
&lt;defs>&lt;marker id="nva" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="400" y="22" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="700" fill="currentColor">One transformer layer at TP=4 · two all-reduces per layer&lt;/text>
&lt;!-- 4 GPUs -->
&lt;g>
&lt;rect x="40" y="50" width="150" height="40" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="1.4"/>&lt;text x="115" y="75" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">GPU0 · ¼ heads&lt;/text>
&lt;rect x="40" y="98" width="150" height="40" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="1.4"/>&lt;text x="115" y="123" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">GPU1 · ¼ heads&lt;/text>
&lt;rect x="40" y="146" width="150" height="40" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="1.4"/>&lt;text x="115" y="171" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">GPU2 · ¼ heads&lt;/text>
&lt;rect x="40" y="194" width="150" height="40" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="1.4"/>&lt;text x="115" y="219" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">GPU3 · ¼ heads&lt;/text>
&lt;/g>
&lt;!-- AllReduce 1 -->
&lt;rect x="240" y="70" width="120" height="144" rx="9" fill="#f7efda" stroke="#c79a32" stroke-width="2"/>
&lt;text x="300" y="130" text-anchor="middle" font-family="sans-serif" font-size="12" font-weight="700" fill="#222">ALL-REDUCE&lt;/text>
&lt;text x="300" y="148" text-anchor="middle" font-family="sans-serif" font-size="10" fill="#444">attn o_proj&lt;/text>
&lt;text x="300" y="164" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#777">(NVLink)&lt;/text>
&lt;!-- MLP -->
&lt;rect x="410" y="70" width="120" height="144" rx="6" fill="#eef3fb" stroke="#4a6fa5" stroke-width="1.4"/>
&lt;text x="470" y="135" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">MLP&lt;/text>
&lt;text x="470" y="152" text-anchor="middle" font-family="sans-serif" font-size="9.5" fill="#444">(split)&lt;/text>
&lt;!-- AllReduce 2 -->
&lt;rect x="580" y="70" width="120" height="144" rx="9" fill="#f7efda" stroke="#c79a32" stroke-width="2"/>
&lt;text x="640" y="130" text-anchor="middle" font-family="sans-serif" font-size="12" font-weight="700" fill="#222">ALL-REDUCE&lt;/text>
&lt;text x="640" y="148" text-anchor="middle" font-family="sans-serif" font-size="10" fill="#444">mlp down_proj&lt;/text>
&lt;text x="640" y="164" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#777">(NVLink)&lt;/text>
&lt;!-- next layer -->
&lt;rect x="720" y="98" width="60" height="88" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.2"/>
&lt;text x="750" y="138" text-anchor="middle" font-family="sans-serif" font-size="10" font-weight="700" fill="#333">layer&lt;/text>
&lt;text x="750" y="152" text-anchor="middle" font-family="sans-serif" font-size="10" font-weight="700" fill="#333">i+1&lt;/text>
&lt;path d="M190,142 L240,142" fill="none" stroke="#666" stroke-width="1.5" marker-end="url(#nva)"/>
&lt;path d="M360,142 L410,142" fill="none" stroke="#666" stroke-width="1.5" marker-end="url(#nva)"/>
&lt;path d="M530,142 L580,142" fill="none" stroke="#666" stroke-width="1.5" marker-end="url(#nva)"/>
&lt;path d="M700,142 L720,142" fill="none" stroke="#666" stroke-width="1.5" marker-end="url(#nva)"/>
&lt;text x="400" y="262" text-anchor="middle" font-family="sans-serif" font-size="11" fill="#444">× 80 layers = 160 all-reduces per token · each one crosses the interconnect&lt;/text>
&lt;text x="400" y="282" text-anchor="middle" font-family="sans-serif" font-size="10.5" font-style="italic" fill="#999">if the cable is slow, decode collapses — the engine waits on the cable&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h3 id="how-the-all-reduce-is-done-ring-tree-nvls">How the all-reduce is done: ring, tree, NVLS&lt;/h3>
&lt;p>NCCL does not have a single way of doing an all-reduce; it picks an algorithm according to topology and message size:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Ring.&lt;/strong> The GPUs form a ring; each one passes a chunk to its neighbour, adds, and rotates. It takes $2(N-1)$ steps. It is &lt;strong>bandwidth-optimal&lt;/strong> for large messages: the cost of moving the data is $\frac{2(N-1)}{N} \times M$ bytes over the link, almost independent of $N$. The downside: $2(N-1)$ latency hops, bad for small messages.&lt;/li>
&lt;li>&lt;strong>Tree.&lt;/strong> Tree reduction: $\log N$ levels. &lt;strong>Better latency&lt;/strong> for small messages and many nodes, worse bandwidth utilisation.&lt;/li>
&lt;li>&lt;strong>NVLS (NVLink SHARP).&lt;/strong> The Hopper trick: the summation &lt;strong>is not done by the GPUs, it is done by the NVSwitch&lt;/strong>. The switch has reduction units; the GPUs send their tensors, the switch adds them in flight and returns the result. It takes work away from the GPUs (frees up SMs) and reduces hops. Available &lt;strong>only with a 3rd-generation NVSwitch (NVLink4) plus Hopper or newer&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;p>The mental rule: &lt;strong>decode (tiny messages) wants latency → tree/LL or vLLM&amp;rsquo;s custom kernel; prefill (huge messages) wants bandwidth → ring/NVLS&lt;/strong>. That is why there is no global &amp;ldquo;optimal NCCL_ALGO&amp;rdquo;; it depends on which phase you are looking at.&lt;/p>
&lt;h2 id="the-maths-that-matter-why-decode-and-prefill-stress-the-cable-the-other-way-round">The maths that matter: why decode and prefill stress the cable the other way round&lt;/h2>
&lt;p>Here is the asymmetry almost everyone skips. The size of the tensor that gets all-reduced in each layer is, approximately:&lt;/p>
$$ M \approx B \times S \times h \times 2\ \text{bytes (BF16)} $$
&lt;p>where $B$ = batch, $S$ = tokens processed in this forward pass, $h$ = hidden size.&lt;/p>
&lt;p>&lt;strong>In decode&lt;/strong>, you generate &lt;strong>1 token per sequence&lt;/strong> per iteration. For a single sequence ($B \times S = 1$) and $h = 8192$ (Llama-70B):&lt;/p>
$$ M_{\text{decode}} \approx 1 \times 8192 \times 2 = 16\ \text{KB per all-reduce} $$
&lt;p>16 KB is tiny. At 900 GB/s, moving 16 KB takes around 18 nanoseconds of pure transfer, but the real cost is dominated by the &lt;strong>launch latency of the collective&lt;/strong> (synchronisation, kernel launch), of the order of single-digit microseconds. With 160 all-reduces per token:&lt;/p>
$$ t_{\text{comms/token}} \approx 160 \times (5\text{–}10\,\mu s) \approx 0.8\text{–}1.6\ \text{ms} $$
&lt;p>That is the communication floor per token, &lt;strong>independent of bandwidth&lt;/strong>. An uncomfortable and counter-intuitive implication: &lt;strong>buying more NVLink bandwidth does not speed up token-by-token decode of a single sequence.&lt;/strong> What helps in decode is &lt;strong>lowering the latency per collective&lt;/strong> (LL protocol, vLLM&amp;rsquo;s custom all-reduce, NVLS to remove hops) and batching (raising $B$ amortises the fixed latency over more tokens, the deep reason continuous batching exists, covered in &lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">continuous batching&lt;/a>).&lt;/p>
&lt;p>&lt;strong>In prefill&lt;/strong>, you process the whole prompt at once: $S$ can be thousands of tokens, and with batching $B \times S$ reaches tens of thousands. There:&lt;/p>
$$ M_{\text{prefill}} \approx 8000 \times 8192 \times 2 \approx 131\ \text{MB per all-reduce} $$
&lt;p>131 MB does stress the bandwidth. At 900 GB/s (NVSwitch) the ring all-reduce moves $\frac{2 \cdot 3}{4} \times 131 \approx 196$ MB effective in around 0.22 ms; over PCIe (around 64 GB/s aggregate, bouncing through the CPU) it would be &lt;strong>around 3 ms and serialised&lt;/strong>. Here the cable is the bottleneck and NVLS/bandwidth rule.&lt;/p>
&lt;p>Summary in one line: &lt;strong>prefill is bandwidth-bound, decode is latency-bound.&lt;/strong> Any interconnect tuning that does not say which phase it helps is noise.&lt;/p>
&lt;h2 id="the-hardware-nvlink-4-and-nvswitch-on-the-hgx-baseboard">The hardware: NVLink 4 and NVSwitch on the HGX baseboard&lt;/h2>
&lt;p>On the generic reference cluster, &lt;strong>4×H100 SXM&lt;/strong> inside an HGX baseboard, the concrete figures:&lt;/p>
&lt;ul>
&lt;li>Each H100 SXM5 has &lt;strong>18 NVLink 4 links&lt;/strong>, each one 50 GB/s bidirectional ⇒ &lt;strong>900 GB/s bidirectional aggregate per GPU&lt;/strong>. That is &lt;strong>&amp;gt;14× the bandwidth of a PCIe Gen4 x16&lt;/strong> (around 64 GB/s bidir).&lt;/li>
&lt;li>On an 8-GPU HGX H100 baseboard, the 18 links of each GPU are spread against &lt;strong>four 3rd-generation NVSwitch&lt;/strong> chips (grouped 5+4+4+5). The result is all-to-all: any GPU talks to any other at 900 GB/s simultaneously, without going through CPU or PCIe.&lt;/li>
&lt;li>A 4-GPU baseboard is half a board: same principle, via NVSwitch. &lt;strong>Design key&lt;/strong>: if your 4 H100s are connected by NVSwitch, you have real all-to-all; if they are on &lt;strong>different boards connected by PCIe&lt;/strong> (some &amp;ldquo;4×PCIe&amp;rdquo; configurations), &lt;strong>you do not have NVLink between all of them&lt;/strong> and TP=4 suffers. Verify it, do not assume it.&lt;/li>
&lt;/ul>
&lt;div class="diagram" style="max-width:800px;margin:1.2rem auto;">
&lt;svg viewBox="0 0 800 300" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="NVSwitch all-to-all vs PCIe through the CPU">
&lt;defs>&lt;marker id="nvt" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#3c8c54"/>&lt;/marker>&lt;/defs>
&lt;text x="200" y="24" text-anchor="middle" font-family="sans-serif" font-size="12.5" font-weight="700" fill="#1f5c34">With NVSwitch · all-to-all 900 GB/s&lt;/text>
&lt;circle cx="120" cy="80" r="26" fill="#dceede" stroke="#3c8c54" stroke-width="1.6"/>&lt;text x="120" y="84" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G0&lt;/text>
&lt;circle cx="280" cy="80" r="26" fill="#dceede" stroke="#3c8c54" stroke-width="1.6"/>&lt;text x="280" y="84" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G1&lt;/text>
&lt;circle cx="120" cy="220" r="26" fill="#dceede" stroke="#3c8c54" stroke-width="1.6"/>&lt;text x="120" y="224" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G2&lt;/text>
&lt;circle cx="280" cy="220" r="26" fill="#dceede" stroke="#3c8c54" stroke-width="1.6"/>&lt;text x="280" y="224" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G3&lt;/text>
&lt;rect x="170" y="130" width="60" height="40" rx="6" fill="#f7efda" stroke="#c79a32" stroke-width="1.8"/>&lt;text x="200" y="155" text-anchor="middle" font-family="sans-serif" font-size="10" font-weight="700" fill="#222">NVSw&lt;/text>
&lt;path d="M138,98 L180,135" stroke="#3c8c54" stroke-width="1.6" fill="none"/>
&lt;path d="M262,98 L220,135" stroke="#3c8c54" stroke-width="1.6" fill="none"/>
&lt;path d="M138,202 L180,165" stroke="#3c8c54" stroke-width="1.6" fill="none"/>
&lt;path d="M262,202 L220,165" stroke="#3c8c54" stroke-width="1.6" fill="none"/>
&lt;path d="M120,106 L120,194" stroke="#3c8c54" stroke-width="1.2" fill="none" stroke-dasharray="3 2"/>
&lt;path d="M280,106 L280,194" stroke="#3c8c54" stroke-width="1.2" fill="none" stroke-dasharray="3 2"/>
&lt;line x1="420" y1="40" x2="420" y2="270" stroke="#ccc" stroke-width="1"/>
&lt;text x="610" y="24" text-anchor="middle" font-family="sans-serif" font-size="12.5" font-weight="700" fill="#a85454">No NVLink · PCIe via CPU (around 14× slower)&lt;/text>
&lt;circle cx="530" cy="80" r="26" fill="#f3dede" stroke="#b35454" stroke-width="1.6"/>&lt;text x="530" y="84" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G0&lt;/text>
&lt;circle cx="690" cy="80" r="26" fill="#f3dede" stroke="#b35454" stroke-width="1.6"/>&lt;text x="690" y="84" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G1&lt;/text>
&lt;circle cx="530" cy="220" r="26" fill="#f3dede" stroke="#b35454" stroke-width="1.6"/>&lt;text x="530" y="224" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G2&lt;/text>
&lt;circle cx="690" cy="220" r="26" fill="#f3dede" stroke="#b35454" stroke-width="1.6"/>&lt;text x="690" y="224" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">G3&lt;/text>
&lt;rect x="580" y="130" width="60" height="40" rx="6" fill="#e8e8e8" stroke="#888" stroke-width="1.6"/>&lt;text x="610" y="155" text-anchor="middle" font-family="sans-serif" font-size="10" font-weight="700" fill="#333">CPU&lt;/text>
&lt;path d="M548,98 L590,135" stroke="#b35454" stroke-width="1.4" fill="none"/>
&lt;path d="M672,98 L630,135" stroke="#b35454" stroke-width="1.4" fill="none"/>
&lt;path d="M548,202 L590,165" stroke="#b35454" stroke-width="1.4" fill="none"/>
&lt;path d="M672,202 L630,165" stroke="#b35454" stroke-width="1.4" fill="none"/>
&lt;text x="610" y="292" text-anchor="middle" font-family="sans-serif" font-size="10" font-style="italic" fill="#999">all inter-GPU traffic bounces through host memory, serialised&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-10-knobs-worth-touching">The 10 knobs worth touching&lt;/h2>
&lt;p>Almost all of them are NCCL environment variables (injected into the inference engine process) or driver settings. Ordered by impact/frequency in an on-premise deployment. The canonical detail is in the &lt;a href="https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/env.html">NCCL env vars docs&lt;/a>.&lt;/p>
&lt;h3 id="knob-1--nccl_debug--topology-dump-see-what-is-happening-before-touching-anything">Knob 1 — &lt;code>NCCL_DEBUG&lt;/code> + topology dump: see what is happening before touching anything&lt;/h3>
&lt;p>Do not optimise blind: &lt;strong>first confirm which topology and algorithms NCCL picked&lt;/strong>. This tells you whether it really is using NVLink or whether, silently, it fell back to PCIe/SHM, the number one failure and the most expensive one.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_DEBUG&lt;/span>&lt;span class="o">=&lt;/span>INFO &lt;span class="c1"># prints topology, rings/trees built, transport chosen&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_DEBUG_SUBSYS&lt;/span>&lt;span class="o">=&lt;/span>GRAPH,TUNING,NET &lt;span class="c1"># narrows it down to what matters&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># look in the log for: &amp;#34;via NVLink&amp;#34; / &amp;#34;via P2P&amp;#34; (good) vs &amp;#34;via SHM&amp;#34; / &amp;#34;via PCI&amp;#34; (bad)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you see &lt;code>via SHM&lt;/code> or &lt;code>via PCI&lt;/code> between GPUs that should have NVLink, &lt;strong>you have a topology problem&lt;/strong> (PCIe ACS enabled, IOMMU, GPUs on different boards) and no other knob fixes it. This is knob 1 for a reason: half of the &amp;ldquo;NVLink is slow&amp;rdquo; cases are &amp;ldquo;NVLink is not being used&amp;rdquo;.&lt;/p>
&lt;h3 id="knob-2--nccl_algo-ring-vs-tree-vs-nvls">Knob 2 — &lt;code>NCCL_ALGO&lt;/code>: ring vs tree vs NVLS&lt;/h3>
&lt;p>Forces or excludes algorithms. By default NCCL picks according to size, and it usually gets it right; touch it only with a measurement in front of you.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_ALGO&lt;/span>&lt;span class="o">=&lt;/span>NVLS,Tree,Ring &lt;span class="c1"># order of preference&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_ALGO&lt;/span>&lt;span class="o">=&lt;/span>^Ring &lt;span class="c1"># exclude Ring (^ prefix)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Rule: prefill/training (bandwidth) ⇒ Ring/NVLS; decode (latency) ⇒ Tree or, better, vLLM&amp;rsquo;s custom kernel (knob 10/stack). In most inference workloads, &lt;strong>leaving it on auto and validating with knob 1 is the right thing&lt;/strong>; forcing it &amp;ldquo;just in case&amp;rdquo; usually makes things worse.&lt;/p>
&lt;h3 id="knob-3--nccl_proto-ll--ll128--simple">Knob 3 — &lt;code>NCCL_PROTO&lt;/code>: LL / LL128 / Simple&lt;/h3>
&lt;p>The protocol controls the latency/bandwidth trade-off at low level:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_PROTO&lt;/span>&lt;span class="o">=&lt;/span>Simple &lt;span class="c1"># maximum bandwidth, more latency (large messages)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_PROTO&lt;/span>&lt;span class="o">=&lt;/span>LL &lt;span class="c1"># low-latency, half-bandwidth (tiny messages: decode)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_PROTO&lt;/span>&lt;span class="o">=&lt;/span>LL128 &lt;span class="c1"># compromise, default on platforms that support it&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>LL&lt;/code> (low-latency) uses flags instead of barriers and wins on the 16 KB messages of decode; &lt;code>Simple&lt;/code> wins on the 131 MB of prefill. The default &lt;code>LL,LL128,Simple&lt;/code> lets NCCL choose by size, which again is normally the best option.&lt;/p>
&lt;h3 id="knob-4--nccl_nvls_enable-offload-the-summation-to-the-nvswitch">Knob 4 — &lt;code>NCCL_NVLS_ENABLE&lt;/code>: offload the summation to the NVSwitch&lt;/h3>
&lt;p>NVLink SHARP (NVLS) makes the switch do the reduction, freeing up GPU SMs:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_NVLS_ENABLE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">1&lt;/span> &lt;span class="c1"># default: ON where there is an NVLink4+ NVSwitch (Hopper)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>An important sceptical caveat&lt;/strong>: NVLS &lt;strong>requires NVSwitch&lt;/strong> (3rd gen, NVLink4). On a node with NVLink through direct GPU-to-GPU &lt;em>bridges&lt;/em> (no switch) or on 4×PCIe, &lt;strong>NVLS is not available&lt;/strong> and this knob does nothing. Before &amp;ldquo;enabling it&amp;rdquo;, confirm with knob 1 that your topology has a switch. Where it does apply, its biggest advantage is freeing SMs for compute, which is relevant when comms and kernels compete (knob 5).&lt;/p>
&lt;h3 id="knob-5--nccl_min_nchannels--nccl_max_nchannels-how-many-sms-communication-steals">Knob 5 — &lt;code>NCCL_MIN_NCHANNELS&lt;/code> / &lt;code>NCCL_MAX_NCHANNELS&lt;/code>: how many SMs communication steals&lt;/h3>
&lt;p>Each NCCL &amp;ldquo;channel&amp;rdquo; consumes GPU SMs to move data. More channels = more collective bandwidth, but &lt;strong>fewer SMs for the inference kernel&lt;/strong>. It is a split of a fixed resource.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_MIN_NCHANNELS&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">4&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_MAX_NCHANNELS&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">16&lt;/span> &lt;span class="c1"># raising it helps prefill (bandwidth); steals SMs from decode&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In decode, where the GPU is under-used on compute but tied to latency, trimming channels rarely hurts and sometimes helps; in prefill, more channels squeeze out the bandwidth. A measurement knob, not a faith knob.&lt;/p>
&lt;h3 id="knob-6--nccl_buffsize-the-buffer-size-per-channel">Knob 6 — &lt;code>NCCL_BUFFSIZE&lt;/code>: the buffer size per channel&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_BUFFSIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">8388608&lt;/span> &lt;span class="c1"># 8 MB (default 4 MB); larger buffers → better BW on large messages&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Raising it helps bandwidth-bound prefill at the cost of memory per channel. For workloads dominated by small messages (pure decode), the default is plenty.&lt;/p>
&lt;h3 id="knob-7--nccl_p2p_level--nccl_p2p_disable-guarantee-p2p-over-nvlink">Knob 7 — &lt;code>NCCL_P2P_LEVEL&lt;/code> / &lt;code>NCCL_P2P_DISABLE&lt;/code>: guarantee P2P over NVLink&lt;/h3>
&lt;p>P2P is what lets one GPU read another&amp;rsquo;s memory directly over NVLink without going through the host. If it is disabled or degraded, traffic falls back to SHM/PCIe.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_P2P_LEVEL&lt;/span>&lt;span class="o">=&lt;/span>NVL &lt;span class="c1"># use P2P up to the NVLink level&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># NCCL_P2P_DISABLE=1 ← only as a workaround if P2P HANGS (multi-NUMA PCIe, certain Blackwell)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Watch out for the trap: &lt;code>NCCL_P2P_DISABLE=1&lt;/code> and &lt;code>--disable-custom-all-reduce&lt;/code> are recommended as a &lt;strong>patch&lt;/strong> when vLLM hangs on PCIe-only multi-NUMA topologies. It is a &lt;strong>robustness patch that sacrifices performance&lt;/strong>: use it if it hangs, never &amp;ldquo;by default&amp;rdquo;.&lt;/p>
&lt;h3 id="knob-8--gpudirect-rdma-for-multi-node-nccl_net_gdr_level">Knob 8 — GPUDirect RDMA for multi-node: &lt;code>NCCL_NET_GDR_LEVEL&lt;/code>&lt;/h3>
&lt;p>When TP fits in one node, this does not apply. When you have to cross nodes (huge model, pipeline parallel between baseboards), GPUDirect RDMA lets the GPU talk to the NIC &lt;strong>without bouncing through host memory&lt;/strong>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_NET_GDR_LEVEL&lt;/span>&lt;span class="o">=&lt;/span>PHB &lt;span class="c1"># enables GDR according to GPU–NIC proximity on the PCIe bus&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Without GDR, every inter-node hop adds a host copy. With InfiniBand/RoCE plus GDR, the KV or the activations travel GPU→NIC→network→NIC→GPU. It is the basis of serious multi-node work and of &lt;a href="https://blog.lo0.es/en/posts/mixed-nvidia-intel-environments-llm-inference/">mixed environments&lt;/a>.&lt;/p>
&lt;h3 id="knob-9--nccl_ib_hca--nccl_socket_ifname-pin-the-right-nic">Knob 9 — &lt;code>NCCL_IB_HCA&lt;/code> / &lt;code>NCCL_SOCKET_IFNAME&lt;/code>: pin the right NIC&lt;/h3>
&lt;p>The most common and silent multi-node mistake: NCCL picks the &lt;strong>management NIC&lt;/strong> (1 GbE) instead of the fabric one (InfiniBand/100 GbE). Result: collectives at a snail&amp;rsquo;s pace with no visible error.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_SOCKET_IFNAME&lt;/span>&lt;span class="o">=&lt;/span>eth0 &lt;span class="c1"># control interface (bootstrap)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_IB_HCA&lt;/span>&lt;span class="o">=&lt;/span>mlx5_0,mlx5_1 &lt;span class="c1"># the real InfiniBand HCAs of the fabric&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">NCCL_IB_GID_INDEX&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">3&lt;/span> &lt;span class="c1"># correct GID for RoCE v2&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Pin them explicitly. &amp;ldquo;Auto&amp;rdquo; gets it right on clean clusters and fails as soon as there is more than one NIC.&lt;/p>
&lt;h3 id="knob-10--driver-persistence-mode-clocks-and-nvlink-error-counters">Knob 10 — Driver: persistence mode, clocks and NVLink error counters&lt;/h3>
&lt;p>Below NCCL, the driver has levers and, above all, &lt;strong>telemetry you have to look at&lt;/strong>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">nvidia-smi -pm &lt;span class="m">1&lt;/span> &lt;span class="c1"># persistence mode: avoids driver re-init (latency/jitter)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">nvidia-smi nvlink --status &lt;span class="c1"># are all 18 links active and at full speed?&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">nvidia-smi nvlink -e &lt;span class="c1"># error/CRC counters per link&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">nvidia-smi -q -d ECC &lt;span class="c1"># memory errors that degrade silently&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>An NVLink link that negotiates at half speed or accumulates CRC errors degrades the all-reduce &lt;strong>without raising any error&lt;/strong>: the system &amp;ldquo;works&amp;rdquo;, it is just slower. These counters are the difference between diagnosing in five minutes and chasing a ghost for days. They are integrated in DCGM (knob/stack: observability).&lt;/p>
&lt;h3 id="summary-table">Summary table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>#&lt;/th>
&lt;th>Knob&lt;/th>
&lt;th>Variable / command&lt;/th>
&lt;th>Phase it helps&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>Topology diagnosis&lt;/td>
&lt;td>&lt;code>NCCL_DEBUG=INFO&lt;/code> + &lt;code>SUBSYS=GRAPH&lt;/code>&lt;/td>
&lt;td>always, first&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>Collective algorithm&lt;/td>
&lt;td>&lt;code>NCCL_ALGO&lt;/code> (NVLS/Tree/Ring)&lt;/td>
&lt;td>depends on phase; auto usually wins&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>Protocol&lt;/td>
&lt;td>&lt;code>NCCL_PROTO&lt;/code> (LL/LL128/Simple)&lt;/td>
&lt;td>LL=decode, Simple=prefill&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>NVLink SHARP&lt;/td>
&lt;td>&lt;code>NCCL_NVLS_ENABLE=1&lt;/code>&lt;/td>
&lt;td>prefill; frees SMs (requires NVSwitch)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>Channels (SMs)&lt;/td>
&lt;td>&lt;code>NCCL_MIN/MAX_NCHANNELS&lt;/code>&lt;/td>
&lt;td>+prefill bandwidth / −SM theft in decode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>Buffer&lt;/td>
&lt;td>&lt;code>NCCL_BUFFSIZE&lt;/code>&lt;/td>
&lt;td>bandwidth-bound prefill&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>7&lt;/td>
&lt;td>NVLink P2P&lt;/td>
&lt;td>&lt;code>NCCL_P2P_LEVEL=NVL&lt;/code>&lt;/td>
&lt;td>critical; disable only if it hangs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>GPUDirect RDMA&lt;/td>
&lt;td>&lt;code>NCCL_NET_GDR_LEVEL&lt;/code>&lt;/td>
&lt;td>multi-node&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>9&lt;/td>
&lt;td>Fabric NIC&lt;/td>
&lt;td>&lt;code>NCCL_IB_HCA&lt;/code>/&lt;code>SOCKET_IFNAME&lt;/code>&lt;/td>
&lt;td>multi-node (avoids mgmt NIC)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>10&lt;/td>
&lt;td>Driver + telemetry&lt;/td>
&lt;td>&lt;code>nvidia-smi -pm 1&lt;/code> / &lt;code>nvlink -e&lt;/code>&lt;/td>
&lt;td>jitter + silent diagnosis&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="how-it-connects-with-the-rest-of-the-stack">How it connects with the rest of the stack&lt;/h2>
&lt;p>The interconnect is not an island; it touches almost every layer above.&lt;/p>
&lt;p>&lt;strong>With vLLM, the custom all-reduce.&lt;/strong> vLLM does not always use NCCL: for the tiny messages of decode (&lt;code>world_size==2&lt;/code> or a fully-connected NVLink topology, below a certain &lt;code>max_size&lt;/code>) it uses its &lt;strong>own all-reduce kernel&lt;/strong> that beats NCCL on latency, exactly the decode bottleneck we saw in the maths. It falls back to NCCL for large messages and for topologies without NVLink (where its custom kernel &amp;ldquo;adds little over NCCL&amp;rdquo;). The flag &lt;code>--disable-custom-all-reduce&lt;/code> / &lt;code>VLLM_DISABLE_CUSTOM_ALL_REDUCE&lt;/code> turns it off; it is the patch for hangs on multi-NUMA PCIe. Translation: &lt;strong>the most effective decode latency knob is sometimes not an NCCL one, it is choosing well between vLLM&amp;rsquo;s custom kernel and NCCL.&lt;/strong>&lt;/p>
&lt;p>&lt;strong>With TP vs replicas.&lt;/strong> Everything in &lt;a href="https://blog.lo0.es/en/posts/one-big-replica-or-many-small-ones-platform-decision/">one big replica or many small ones&lt;/a> rests on this: high TP is only viable inside the NVLink domain. The boundary of &amp;ldquo;TP=4 or 4 replicas at TP=1?&amp;rdquo; is drawn by the cable: crossing NVLink with TP means paying for the all-reduce at PCIe prices.&lt;/p>
&lt;p>&lt;strong>With disaggregated serving.&lt;/strong> In &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated prefill/decode&lt;/a>, the KV cache generated in the prefill pool has to travel to the decode pool. That transfer is &lt;strong>another consumer of the interconnect&lt;/strong> (NVLink intra-node, GPUDirect RDMA inter-node) and competes with the all-reduces. Designing the disaggregation without counting the cost of transferring the KV is the classic trap.&lt;/p>
&lt;p>&lt;strong>With MoE.&lt;/strong> Mixture-of-Experts models add expert parallelism: an &lt;code>all-to-all&lt;/code> (not an all-reduce) that routes each token to its expert, possibly on another GPU. It is a different communication pattern and heavier on bandwidth; &lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE in inference&lt;/a> lives or dies by the same cable, with an even more demanding collective.&lt;/p>
&lt;p>&lt;strong>With GPU observability.&lt;/strong> The NVLink counters (&lt;code>nvidia-smi nvlink -e&lt;/code>, TX/RX bytes per link, CRC errors) and NVSwitch utilisation are exposed via DCGM and land in Prometheus/Grafana. The question &amp;ldquo;is the interconnect healthy and saturated?&amp;rdquo; is answered there, alongside the rest of &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability with DCGM&lt;/a>. A slow all-reduce shows up sooner in an NVLink error counter than in API latency.&lt;/p>
&lt;p>&lt;strong>With capacity planning.&lt;/strong> The &lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">inference sizing&lt;/a> that assumes &amp;ldquo;TP=4 scales almost linearly&amp;rdquo; &lt;strong>only holds inside NVLink&lt;/strong>. Outside it, scaling efficiency collapses and the capacity plan lies. The cable is a parameter of the capacity model, not a detail.&lt;/p>
&lt;h2 id="traps-and-things-that-are-not-what-they-look-like">Traps and things that are not what they look like&lt;/h2>
&lt;p>&lt;strong>&amp;ldquo;More NVLink bandwidth = faster decode.&amp;rdquo;&lt;/strong> False for a single sequence. Decode is latency-bound; bandwidth is barely touched by 16 KB messages. What speeds up decode is batching (amortising the fixed latency) and lowering latency per collective (LL, custom kernel, NVLS). Bandwidth rules in prefill.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;I have 4 H100s, so I have NVLink between all four.&amp;rdquo;&lt;/strong> Not necessarily. There are configurations where the GPUs are on different boards joined by PCIe, or with NVLink bridges only in pairs. Confirm it with &lt;code>nvidia-smi nvlink --status&lt;/code> and knob 1 before planning TP=4. A TP=4 over P2P-over-PCIe performs far worse than the brochure says.&lt;/p>
&lt;p>&lt;strong>Forcing &lt;code>NCCL_ALGO&lt;/code>/&lt;code>NCCL_PROTO&lt;/code> &amp;ldquo;to go faster&amp;rdquo;.&lt;/strong> NCCL picks well by size in most cases. Forcing an algorithm without measuring usually makes one of the two phases worse. The correct sequence is: knob 1 (see what it is doing) → measure → touch only if there is evidence.&lt;/p>
&lt;p>&lt;strong>Disabling P2P/custom all-reduce by default.&lt;/strong> They are robustness patches for broken topologies (multi-NUMA PCIe, certain Blackwell). Leaving them on &amp;ldquo;for stability&amp;rdquo; on a node with healthy NVLink throws performance in the bin.&lt;/p>
&lt;p>&lt;strong>Stretching TP over the network.&lt;/strong> TP=8 crossing two nodes over InfiniBand because &amp;ldquo;there is bandwidth&amp;rdquo; ignores that the per-layer all-reduce now pays network latency ×160 per token. To cross nodes, pipeline parallel (which communicates once per micro-batch, not per layer) almost always wins. The communication pattern, not just the bandwidth, decides.&lt;/p>
&lt;p>&lt;strong>Ignoring the NVLink error counters.&lt;/strong> A degraded link does not raise an exception: the system works, it is just slow. Without watching &lt;code>nvlink -e&lt;/code> and ECC, you chase a performance ghost that a counter would have pointed out in five minutes.&lt;/p>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>Tensor parallelism sells a simple promise, split the model, multiply the VRAM, serve models that do not fit in one GPU, but the small print is that every layer forces the GPUs to come together and add up, twice, dozens of times per token. That all-reduce is the real hidden protagonist of performance, and it lives in the cable: NVLink does it on the shared bench of the NVSwitch at 900 GB/s, or PCIe drags it through the CPU&amp;rsquo;s reception desk 14× slower. Of the ten knobs, the first one, &lt;strong>looking with &lt;code>NCCL_DEBUG&lt;/code> at what is really happening&lt;/strong>, solves half the problems, because half of the &amp;ldquo;NVLink is slow&amp;rdquo; cases are &amp;ldquo;NVLink is not being used&amp;rdquo;. The rest are refinements that only mean something if you know &lt;strong>which phase&lt;/strong> you are in: prefill wants bandwidth (NVLS, Simple, channels, buffer), decode wants latency (LL, vLLM&amp;rsquo;s custom kernel, batching). And above all, an idea that reorders the intuition: in on-premise inference, the interconnect is not plumbing you install and forget, it is a hot path, a capacity parameter and, when it degrades silently, the root cause that no API dashboard will point out to you unless you look at the counters of the cable itself.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pcie-topology-gpudirect-p2p-acs-security-guard/">The corridors and the guard: PCIe, GPUDirect P2P and ACS&lt;/a> — the &lt;em>other&lt;/em> bus in the node; what does not fit on the NVLink bench (disk, network, KV between nodes) travels over PCIe, and ACS decides whether GPUDirect goes straight through or bounces via the root complex.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/anatomy-on-premise-llm-inference-stack-seven-layers/">The on-premise LLM inference stack in seven layers&lt;/a> — the complete building where the interconnect is the foundation the seven layers rest on; here that foundation is opened up.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/one-big-replica-or-many-small-ones-platform-decision/">One big replica or many small ones: TP and replicas&lt;/a> — the decision of how many GPUs and how to split the model; this post explains &lt;em>why&lt;/em> the NVLink limit draws that boundary.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode separated&lt;/a> — moving the KV cache between pools is another consumer of the same interconnect that competes with the all-reduces.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching&lt;/a> — the deep reason batching speeds up decode is that it amortises the fixed all-reduce latency over more tokens.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/optimising-decode-vllm-squeezing-every-token-small-hardware/">Decode optimisations in vLLM&lt;/a> — the latency-bound phase where vLLM&amp;rsquo;s custom all-reduce and the LL protocol decide the TPS per sequence.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE in inference&lt;/a> — expert parallelism adds an even more demanding &lt;code>all-to-all&lt;/code> over the same cable.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability with DCGM&lt;/a> — where the NVLink and NVSwitch counters land to answer &amp;ldquo;is the interconnect healthy and saturated?&amp;rdquo;.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Capacity planning for on-premise inference&lt;/a> — why &amp;ldquo;TP scales almost linearly&amp;rdquo; is only true inside the NVLink domain, and how the cable enters the capacity model.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mixed-nvidia-intel-environments-llm-inference/">Mixed NVIDIA + Intel environments&lt;/a> — when you cross the node boundary, GPUDirect RDMA over InfiniBand/RoCE replaces NVLink as the medium of the collective.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/">The kitchen door the maître never looked at: network NUMA, Cilium eBPF and DRANET&lt;/a> — making that GPUDirect RDMA take the NUMA-local path (GPU and NIC on the same PCIe root) is exactly what DRA/DRANET co-schedules; +60% NCCL bus bandwidth when it is aligned.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/sms-cuda-streams-cuda-graphs-inference/">SM, CUDA streams and CUDA graphs&lt;/a> — between the compute kernels the TP all-reduces are interleaved; vLLM&amp;rsquo;s custom all-reduce is integrated into the same CUDA graph so as not to break the sequence with a CPU synchronisation.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>NVIDIA, &lt;em>NVIDIA Hopper Architecture In-Depth&lt;/em> (NVLink 4, 900 GB/s): &lt;a href="https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/">https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>Introducing NVIDIA HGX H100&lt;/em> (4× NVSwitch, all-to-all): &lt;a href="https://developer.nvidia.com/blog/introducing-nvidia-hgx-h100-an-accelerated-server-platform-for-ai-and-high-performance-computing/">https://developer.nvidia.com/blog/introducing-nvidia-hgx-h100-an-accelerated-server-platform-for-ai-and-high-performance-computing/&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>NCCL Environment Variables&lt;/em> (all the knobs in this post): &lt;a href="https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/env.html">https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/env.html&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>The NVLink-Network Switch&lt;/em> (Hot Chips 2022, NVLink SHARP): &lt;a href="https://hc34.hotchips.org/">https://hc34.hotchips.org/&lt;/a>.&lt;/li>
&lt;li>vLLM, &lt;em>Why does vLLM use a custom all-reduce method?&lt;/em> (discussion #6159) and &lt;code>custom_all_reduce.py&lt;/code>: &lt;a href="https://github.com/vllm-project/vllm/discussions/6159">https://github.com/vllm-project/vllm/discussions/6159&lt;/a>.&lt;/li>
&lt;li>NVIDIA, &lt;em>NCCL Multi-Node NVLink Tuning Guide&lt;/em>: &lt;a href="https://docs.nvidia.com/multi-node-nvlink-systems/multi-node-tuning-guide/nccl.html">https://docs.nvidia.com/multi-node-nvlink-systems/multi-node-tuning-guide/nccl.html&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>Anatomy of the twelve DCGM and five vLLM metrics: analogies, documented anomalies and real cases 2024-2026</title><link>https://blog.lo0.es/en/posts/anatomy-dcgm-vllm-metrics-analogies-documented-anomalies/</link><pubDate>Tue, 02 Jun 2026 04:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/anatomy-dcgm-vllm-metrics-analogies-documented-anomalies/</guid><description>&lt;blockquote>
&lt;p>This post goes deeper into the list of metrics presented in &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability for LLM inference&lt;/a>. There each metric got its G/A/R threshold and PromQL query; here each one gets its explanatory analogy and the anomaly documented in production with a referenced public case. It is the post worth having open when an alert fires and you still do not know what to do with it; the &lt;a href="https://blog.lo0.es/en/posts/incident-response-runbooks-llm-inference-kafka-keep/">next post on runbooks&lt;/a> translates each anomaly into concrete action.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The twelve DCGM metrics (compute, memory, thermal-power, health) and the five vLLM engine metrics (concurrency, KV pool, SLO latencies) covered in the previous post paint the cluster&amp;rsquo;s cockpit, but a list without context does not teach you to diagnose. Each metric has a &lt;strong>recurring anomalous pattern&lt;/strong> documented in the public literature (academic papers, GitHub issues, OEM KBs, operator blogs) that the veteran operator recognises instantly and the junior one does not. This post develops each metric with an &lt;strong>analogy of its own&lt;/strong> that pins down which question it answers, and with the &lt;strong>statistically relevant anomaly&lt;/strong> backed by figures from documented incidents. Three examples of the calibre involved: &lt;strong>Meta&lt;/strong> published that during the training of Llama 3 405B on 16,384 H100s there were &lt;strong>419 unplanned failures in 54 days&lt;/strong>, one every 3 hours, with GPU + HBM3 accounting for 47 % of the total; the paper &lt;em>Story of Two GPUs&lt;/em> (arXiv 2503.11901) quantifies that &lt;strong>the H100 has 3.2× worse MTBE from uncorrectable ECC than the A100&lt;/strong>, attributable to the higher density of HBM3; issue &lt;strong>vllm#16300&lt;/strong> documents that on a cluster of 8×A100 80 GB &lt;strong>TP=8 delivers worse throughput than TP=4&lt;/strong> because NVLink saturation kills the partition speedup. The KBs &lt;strong>Dell 000220508&lt;/strong> and &lt;strong>Lenovo HT514380&lt;/strong> formalise the recurring &lt;em>HW Power Brake&lt;/em> case in H100 racks overcommitted at PDU level. Issue &lt;strong>vllm#25677&lt;/strong> showed &lt;em>chunked prefill&lt;/em> 10× slower than without it on Qwen3-30B-A3B (bad calibration of &lt;code>max_num_batched_tokens&lt;/code>). Issue &lt;strong>vllm#11912&lt;/strong> documents a TPOT regression from 15.7 ms to 25.7 ms crossing version 0.6.4. Each case includes a verifiable URL. The operational rule: when an alert arrives, look first at the anomalous pattern associated with the metric that fired, &lt;strong>before&lt;/strong> opening the request&amp;rsquo;s trace; 80 % of degradations match one of the documented patterns.&lt;/p>
&lt;h2 id="you-are-here-observe--the-diagnosis-layer">You are here: OBSERVE — the diagnosis layer&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Observe, diagnosis layer">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#c9a8e9;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#anm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#anm)}&lt;/style>
&lt;defs>&lt;marker id="anm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: OBSERVE · each metric is a question with a typical anomaly attached&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box active"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="family-1--compute">Family 1 — Compute&lt;/h2>
&lt;h3 id="dcgm_fi_prof_sm_occupancy--is-there-parallel-work-in-the-engines">&lt;code>DCGM_FI_PROF_SM_OCCUPANCY&lt;/code> — is there parallel work in the engines?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> An industrial kitchen with 32 hobs and a single chef. The metric answers &lt;em>&amp;ldquo;how many hobs have a pan on them right now?&amp;rdquo;&lt;/em>. If half are empty, the kitchen is under-used: the orders come out one after another because the chef does not open up parallelism. If all of them are occupied but the chef is standing still watching a stopwatch, the hobs are on but nothing is being cooked (a pathological kernel saturating SMs without doing useful work).&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The best-known trap: &lt;strong>high SM occupancy does not imply real throughput&lt;/strong>. The article &lt;em>&amp;ldquo;GPU Utilization Is a Counter, Not a Cause&amp;rdquo;&lt;/em> (Ingero, May 2026) put it in one exact sentence: &lt;em>&amp;ldquo;a kernel running at 5 % of peak FLOPS for 100 ms still reads 100 % on SM_ACTIVE&amp;rdquo;&lt;/em>. In MoE workloads the effect turns pathological: overloaded experts produce the &lt;strong>Straggler Effect&lt;/strong> (paper arXiv 2503.05066). The SMs look busy while waiting for the saturated expert, and the utilisation dashboard paints green while latency goes through the roof.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Do not trust sizing or autoscaling to SM occupancy alone. Always combine it with &lt;code>PIPE_TENSOR_ACTIVE&lt;/code> (is there useful compute?) and &lt;code>DRAM_ACTIVE&lt;/code> (is memory the bottleneck?). The normal LLM decode regime is 30–55 %, not 99 %; seeing a sustained 99 % with high TPOT is a symptom of a kernel bug or an MoE straggler.&lt;/p>
&lt;h3 id="dcgm_fi_prof_pipe_tensor_active--are-the-tensor-cores-producing">&lt;code>DCGM_FI_PROF_PIPE_TENSOR_ACTIVE&lt;/code> — are the tensor cores producing?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> A factory with two lines: the manual one (CUDA cores) and the automated one (tensor cores). The metric answers &lt;em>&amp;ldquo;what percentage of the time is the automated line active?&amp;rdquo;&lt;/em>. If you buy an H100 for its tensor cores and the automated line is at 5 %, you have paid for a Ferrari to do bicycle courier work.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Issue &lt;strong>vllm#20783&lt;/strong> (July 2025) was titled literally &lt;em>&amp;ldquo;Performance Anomaly: compressed-tensors shows no speedup over BF16 on H100&amp;rdquo;&lt;/em>. The operator expected 1.5–2× with FP8 quantisation and got parity with BF16; the &lt;code>PIPE_TENSOR_ACTIVE&lt;/code> metric revealed that the FP8 path was not running on the HMMA units (the tensor unit for FP16/BF16/FP8) and was falling back to CUDA cores. Issue &lt;strong>vllm#31475&lt;/strong> documented the parallel case on MI300X: FP8 slower than BF16 because of a regression in the ROCm path. DCGM exposes separate counters per unit (&lt;code>HMMA&lt;/code> for FP16/BF16/FP8, &lt;code>IMMA&lt;/code> for INT8, &lt;code>DMMA&lt;/code> for TF32/FP32); if &lt;code>HMMA&lt;/code> is low even though the model is BF16, the engine is not using tensor cores.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Check &lt;code>PIPE_TENSOR_ACTIVE&lt;/code> after every change of quantisation or engine version; a supposedly neutral change may have disabled the optimised path. For prefill expect 50–80 %; for decode 15–30 % is normal (decode is memory-bound, not compute-bound). A figure below 5 % in prefill means the engine is not using tensor cores.&lt;/p>
&lt;h3 id="dcgm_fi_prof_dram_active--is-the-hbm-saturated">&lt;code>DCGM_FI_PROF_DRAM_ACTIVE&lt;/code> — is the HBM saturated?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> A motorway with N lanes. The metric answers &lt;em>&amp;ldquo;what percentage of the time are all the lanes occupied moving cars?&amp;rdquo;&lt;/em>. When the tensor cores ask for data faster than the HBM delivers it, the motorway is at 95 % and the engines wait. In decode, this is the normal regime: you walk the model weights and the KV cache through for every token.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The paper &lt;em>&amp;ldquo;Mind the Memory Gap: Unveiling GPU Bottlenecks in Large-Batch LLM Inference&amp;rdquo;&lt;/em> (arXiv 2503.08311) quantifies that at contexts ≥ 128k, reading the KV cache &lt;strong>dominates the total decode time&lt;/strong> and saturates the HBM3 (3.35 TB/s on the H100). The distinctive pattern: &lt;code>DRAM_ACTIVE&lt;/code> &amp;gt; 80 % with &lt;code>PIPE_TENSOR_ACTIVE&lt;/code> around 10–20 %. Raising the batch no longer helps: the bottleneck is not FLOPS, it is bandwidth. The useful lever is compressing the KV, see &lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantisation&lt;/a> for &lt;code>--kv-cache-dtype=fp8&lt;/code>, which cuts the KV footprint by roughly 50 %.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> If &lt;code>DRAM_ACTIVE &amp;gt; 95 %&lt;/code> is sustained and &lt;code>gpu_cache_usage_perc &amp;lt; 70 %&lt;/code>, &lt;strong>something other than your engine is asking for HBM&lt;/strong> (a leak in a library, another process sharing the GPU without MIG). Investigate immediately with &lt;code>nvidia-smi&lt;/code> and &lt;code>fuser /dev/nvidia*&lt;/code>.&lt;/p>
&lt;h2 id="family-2--memory">Family 2 — Memory&lt;/h2>
&lt;h3 id="dcgm_fi_dev_fb_used--how-much-vram-has-been-consumed">&lt;code>DCGM_FI_DEV_FB_USED&lt;/code> — how much VRAM has been consumed?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The fuel level in an aircraft&amp;rsquo;s tank in flight: the pilot needs to know how much is left &lt;strong>and at what rate it is being consumed&lt;/strong>, not just the instantaneous figure. An H100 at 88 % FB used and &lt;strong>stable&lt;/strong> can operate calmly; the same figure &lt;strong>rising 2 %/min&lt;/strong> announces OOM in 7 minutes.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Issue &lt;strong>dcgm-exporter#512&lt;/strong> documents a surprise relevant to MIG clusters: &lt;strong>&lt;code>DCGM_FI_DEV_FB_USED&lt;/code> and &lt;code>DCGM_FI_DEV_FB_FREE&lt;/code> are absent on H100 GPU instances with MIG enabled&lt;/strong>, present on A100 and B200, but an exporter bug hides them on H100-MIG. Operators who assume the dashboard covers everything discover the blind spot on the day of the first OOM. Issue &lt;strong>dcgm-exporter#271&lt;/strong> documents another detail: &lt;code>FB_USED + FB_FREE&lt;/code> &lt;strong>does not always add up to a constant&lt;/strong> because there is driver-reserved overhead that shows up in the delta. The original &lt;strong>PagedAttention/vLLM&lt;/strong> paper estimated that pre-PagedAttention serving frameworks wasted &lt;strong>60–80 %&lt;/strong> of the KV cache to fragmentation; PagedAttention brought it down to under 4 %.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> On H100 MIG clusters, check that &lt;code>DCGM_FI_DEV_FB_USED&lt;/code> appears per instance before trusting alerts; if it is absent, monitor through &lt;code>nvidia-smi --query-gpu=memory.used&lt;/code> directly. Operational rule: alert on the &lt;strong>delta&lt;/strong> (a sustained rise), not just an absolute threshold.&lt;/p>
&lt;h3 id="dcgm_fi_dev_fb_free--the-absolute-complement">&lt;code>DCGM_FI_DEV_FB_FREE&lt;/code> — the absolute complement&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The &amp;ldquo;range remaining&amp;rdquo; indicator in a modern car: it complements the percentage with an absolute figure that is directly actionable.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> When an aggressive PagedAttention pool leaves &lt;code>FB_FREE&lt;/code> at small absolute values (&amp;lt; 2 GiB), any normal allocation of transient buffers (the activations of a large prefill) can push you into OOM. The classic pattern: a &amp;ldquo;green&amp;rdquo; percentage (87 %) but a &amp;ldquo;red&amp;rdquo; absolute (&amp;lt; 4 GiB free on an 80 GB H100).&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> A complementary alert with an absolute threshold: &lt;code>DCGM_FI_DEV_FB_FREE &amp;lt; 4096&lt;/code> (MiB). It is the safety net for the cases where the percentage misleads because the engine is configured with a very high &lt;code>gpu_memory_utilization&lt;/code>.&lt;/p>
&lt;h3 id="dcgm_fi_dev_nvlink_bandwidth_total--does-the-internal-bus-hold-up">&lt;code>DCGM_FI_DEV_NVLINK_BANDWIDTH_TOTAL&lt;/code> — does the internal bus hold up?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> An interstate motorway between four cities. Every car that crosses to do a tensor parallel all-reduce pays a toll and consumes width. When there are more cars than the motorway supports, the latency to reach the destination shoots up, even if each individual car is fast.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Issue &lt;strong>vllm#16300&lt;/strong> (April 2025) was titled &lt;em>&amp;ldquo;Performance degradation with tp=8 compared to tp=4 on 8×A100(80G)&amp;rdquo;&lt;/em> and documented &lt;strong>TP=8 delivering worse throughput than TP=4&lt;/strong> on the same cluster, same model, same quantisation. Root cause: tensor parallelism requires an all-reduce after each attention and MLP block; at TP=8, the communication cost between 8 GPUs (even over NVSwitch) grows faster than the speedup of partitioning the compute. The practical rule that emerges: &lt;strong>TP=4 + 2 replicas&lt;/strong> usually delivers better latency/throughput than &lt;strong>TP=8 + 1 replica&lt;/strong>, except for extremely long contexts (≥128k) where you need the aggregate VRAM. Theoretical NVLink 4.0 capacity on the H100 SXM: around 450 GB/s per GPU; typical sustained TP=4 regime: 50–150 GB/s.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> If &lt;code>NVLINK_BANDWIDTH_TOTAL &amp;gt; 90 %&lt;/code> of capacity is sustained, this is not a problem &lt;em>solvable by raising parallelism&lt;/em>. The opposite: &lt;strong>lower TP&lt;/strong>. The metric is orthogonal to the sizing from &lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">capacity planning&lt;/a>: the ceiling is not only VRAM/time, it is also the bus.&lt;/p>
&lt;h2 id="family-3--thermal-and-power">Family 3 — Thermal and power&lt;/h2>
&lt;h3 id="dcgm_fi_dev_gpu_temp--is-the-gpu-breathing">&lt;code>DCGM_FI_DEV_GPU_TEMP&lt;/code> — is the GPU breathing?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The body temperature of an elite athlete under full effort. 36–37 °C is normal; 38 °C is sustainable stress; above 39 °C the body activates protective mechanisms (sweating, slowing down) that &lt;strong>degrade performance&lt;/strong>. The GPU does the same: above a thermal threshold, it reduces its clock automatically. If it did not, it would break.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The H100 SXM5 with its 700 W TDP has thermal thresholds that are not entirely public (NVIDIA does not publish them exhaustively in the datasheet), but the behaviour is well known: above roughly 85 °C edge or roughly 95 °C HBM, the bit &lt;code>0x40 HW_THERMAL&lt;/code> appears in the clock throttle reasons. Operators on the NVIDIA developer forum report that with a &lt;strong>rack inlet temperature above 27 °C&lt;/strong>, throttling is routine. The NVIDIA HGX Platform paper states that the minimum recommended air flow is &lt;strong>&amp;gt; 1000 CFM/kW&lt;/strong>; densities above 30 kW/rack at 700 W TDP demand mandatory liquid cooling because forced air does not get there.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> If &lt;code>GPU_TEMP &amp;gt; 83 °C&lt;/code> is sustained, look first at &lt;code>CLOCK_THROTTLE_REASONS&lt;/code> (bit 0x40) and at the rack inlet temperature: this is not an engine problem, it is an air flow one. For legacy air-cooled racks, consider redistributing thermal load or installing a rear-door HX.&lt;/p>
&lt;h3 id="dcgm_fi_dev_power_usage--how-much-is-it-asking-of-the-socket">&lt;code>DCGM_FI_DEV_POWER_USAGE&lt;/code> — how much is it asking of the socket?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The instantaneous draw of an industrial appliance plugged into a three-phase outlet with a sized breaker. If the washing machine starts at 9 kW and the breaker is 10 kW, you live on the edge; if the washing machine &amp;ldquo;gets along&amp;rdquo; with the breaker it is because somebody sized it consciously.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> A published real measurement: an H100 SXM5 with vLLM running Llama 3.1 405B at batch=4 draws &lt;strong>around 697 W at-wall&lt;/strong> sustained (NVIDIA TDP 700 W). Now the interesting operational lever: &lt;strong>lowering &lt;code>nvidia-smi -pl&lt;/code> from 700 W to 500 W&lt;/strong> delivers around 30 % energy savings with only around 20 % loss of throughput. A cluster of 4 nodes × 8 H100 at 700 W equals around 22 kW of GPU alone; at 500 W, around 16 kW. The difference pays an entire quarter&amp;rsquo;s electricity bill in clusters operated around the clock. A three-phase 415 VAC PDU branch at 60–80 A supports around 32 kW, roughly 4 DGX H100. Legacy 208 V does not support H100 density; reference: NVIDIA DGX SuperPOD Electrical Specifications.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> A useful metric for three things: (1) detecting anomalously low workloads (unexpected idle), (2) computing per-tenant showback of real energy cost (not estimates), (3) alerting if the draw approaches the PDU branch limit. Keep &lt;strong>GPU → PDU branch → breaker&lt;/strong> mapped in the CMDB.&lt;/p>
&lt;h3 id="dcgm_fi_dev_clock_throttle_reasons--who-is-stepping-on-the-brake">&lt;code>DCGM_FI_DEV_CLOCK_THROTTLE_REASONS&lt;/code> — who is stepping on the brake?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The &amp;ldquo;limited mode&amp;rdquo; warning light on the dashboard of a modern car. When it lights up, the car reduces its performance automatically, but &lt;strong>it does not tell you why&lt;/strong> unless you know how to read the combination of letters. The bits of the bitmap are those letters.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> A public case formally acknowledged by two different OEMs: &lt;strong>Dell KB 000220508&lt;/strong> and &lt;strong>Lenovo HT514380&lt;/strong> address the same phenomenon: &lt;em>HW Power Brake Slowdown active&lt;/em> (bit &lt;code>0x80&lt;/code>) on the H100 SXM. The cause is not the GPU: it is the chassis PDU sending an electrical power-brake signal because the rack branch is close to the breaker limit. The operator sees throughput down 30–50 % with no XID and no ECC, and the inference engine &amp;ldquo;is healthy&amp;rdquo;; the problem is in the electrics. The NVIDIA developer forum thread on &lt;em>&amp;ldquo;HW Power Brake Slowdown&amp;rdquo;&lt;/em> corroborates the pattern. Bit &lt;code>0x40 HW_THERMAL&lt;/code> appears in badly ventilated racks; bit &lt;code>0x04 SW_POWER_CAP&lt;/code> appears if somebody left &lt;code>nvidia-smi -pl 500&lt;/code> set and nobody reverts it.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Any bit other than 0 or &lt;code>Idle&lt;/code> (bit 0x01) sustained &lt;strong>is an immediate alert&lt;/strong>. The recommended decoding: record the complete bitmap value in the log plus the attribute &lt;code>throttle.reasons.decoded=[&amp;quot;HW_THERMAL&amp;quot;, &amp;quot;HW_POWER_BRAKE&amp;quot;]&lt;/code> on the OTel span. Without that, incident response does not know what to do.&lt;/p>
&lt;h2 id="family-4--health-the-catastrophic-reports">Family 4 — Health (the catastrophic reports)&lt;/h2>
&lt;h3 id="dcgm_fi_dev_xid_errors--the-drivers-red-codes">&lt;code>DCGM_FI_DEV_XID_ERRORS&lt;/code> — the driver&amp;rsquo;s red codes&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The critical alarm lights in a nuclear control room. They do not climb gradually; they either appear or they do not. Each XID is a predefined code (XID 13 = graphics engine exception; XID 31 = MMU fault; XID 43 = stopped channel; XID 79 = GPU fallen off the bus; XID 95 = uncontained ECC), and each one has its documented procedure.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The most studied public case: &lt;strong>Meta&lt;/strong> published that during the training of Llama 3 405B on &lt;strong>16,384 H100s over 54 days&lt;/strong> there were &lt;strong>419 unplanned failures&lt;/strong>, one every 3 hours at cluster scale. GPUs accounted for 148 (35 %) plus HBM3 for 72 (17 %), almost half of all failures. The paper &lt;em>&amp;ldquo;Story of Two GPUs: Characterizing the Resilience of Hopper H100 and Ampere A100&amp;rdquo;&lt;/em> (arXiv 2503.11901) quantifies with a different dataset (2.1M GPU-hours) that the H100 has &lt;strong>3.2× worse MTBE for uncorrectable ECC than the A100&lt;/strong>. The ByteDance MegaScale paper reports that XID 79 (&amp;ldquo;GPU fallen off the bus&amp;rdquo;) co-occurs with PCIe errors in &lt;strong>43 % of cases&lt;/strong>. The NVIDIA developer forum documents persistent cases of XID 31 (MMU fault) that &lt;strong>follow the GPU when it is moved to a different PCIe slot&lt;/strong>, a hardware bug in the module, not in the backplane.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> &lt;strong>Any increment of the counter is an immediate alert&lt;/strong>: many XIDs demand a node reset or an RMA of the GPU. The XID-by-XID distinction matters: XID 13/43 is usually a software bug if it coincides with a recent change; XID 31/48/79/94/95 is usually hardware. Keep a canonical &lt;code>xid → procedure&lt;/code> table. See &lt;a href="https://blog.lo0.es/en/posts/incident-response-runbooks-llm-inference-kafka-keep/">the runbooks&lt;/a> for the translation into concrete action.&lt;/p>
&lt;h3 id="dcgm_fi_dev_ecc_dbe_vol_total--the-errors-that-corrupt-data">&lt;code>DCGM_FI_DEV_ECC_DBE_VOL_TOTAL&lt;/code> — the errors that corrupt data&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> An accounting ledger where sometimes someone erases an entry and rewrites it (corrected single-bit ECC: note a change in the margin and carry on) and sometimes someone burns two pages at once (double-bit: the information is lost, the audit has to stop).&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The paper &lt;em>&amp;ldquo;Characterizing GPU Resilience&amp;rdquo;&lt;/em> quantifies for the H100 that when XID 48 (DBE) appears, &lt;strong>the job in flight dies with 100 % probability&lt;/strong> (5 out of 5 in the dataset studied). The documented recovery: drain the node, reset, complete the row remap, equalling &lt;strong>around 19 hours of node downtime&lt;/strong>. HBM3 density explains the worse MTBE against HBM2e: there are more cells per unit area, and therefore a higher statistical probability of degradation. In Llama 3, HBM3 caused 72 of the 419 interruptions (17 %).&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Any value &amp;gt; 0 is a critical alert. The GPU must be &lt;strong>drained immediately&lt;/strong>, removed from the scheduler, fully reset, validated for row remap with &lt;code>nvidia-smi -q -d ROW_REMAPPER&lt;/code> (&lt;code>Pending: No&lt;/code>), and given an extensive smoke test before returning to the pool. If the row remap uses more than 4–8 spare pages on one GPU, plan a replacement in the next window: the degradation is progressive.&lt;/p>
&lt;h3 id="dcgm_fi_dev_retired_dbe--the-pages-marked-for-retirement">&lt;code>DCGM_FI_DEV_RETIRED_DBE&lt;/code> — the pages marked for retirement&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The tiles a museum restorer marks with yellow tape because they are damaged. They pose no immediate danger (the room stays open), but the accumulation says the floor is degrading structurally and the full replacement has to be planned.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> NVIDIA documents up to &lt;strong>512 spare pages per HBM bank&lt;/strong> on the H100; the &lt;code>RETIRED_DBE&lt;/code> counter indicates how many have been used. Operators on NVIDIA forums report that above &lt;strong>4–8 retired pages on a specific GPU&lt;/strong>, the frequency of XID 48 rises. The pattern: a GPU with 6 retired pages today becomes 12 in a month, a first XID 48 two months later, and a forced drain.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> A trend metric, not an immediate alert. Record the value per GPU and review it monthly; GPUs with rising values go into the proactive replacement plan before the catastrophic failure.&lt;/p>
&lt;h2 id="the-five-vllm-engine-metrics">The five vLLM engine metrics&lt;/h2>
&lt;h3 id="vllmnum_requests_running--how-many-requests-fit-in-the-batch">&lt;code>vllm:num_requests_running&lt;/code> — how many requests fit in the batch?&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The number of cars a toll booth lets through at once. If the barrier opens for N at a time, car N+1 waits in the queue. Saturation shows up because the line does not get shorter.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Reaching the configured &lt;code>--max-num-seqs&lt;/code> and staying there is the typical symptom of a &lt;strong>cluster below its sizing&lt;/strong>; the engine admits up to the ceiling and no further. The query &lt;code>vllm:num_requests_running == max_num_seqs&lt;/code> for more than 5 minutes indicates firm saturation.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Combine it with &lt;code>num_requests_waiting&lt;/code>: if running is at the ceiling AND waiting &amp;gt; 0, you have to scale. If running is at the ceiling and waiting is 0, you are in the optimal regime (cluster used to the maximum with no queue).&lt;/p>
&lt;h3 id="vllmnum_requests_waiting--the-primary-saturation-indicator">&lt;code>vllm:num_requests_waiting&lt;/code> — the primary saturation indicator&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The visible queue in front of the toll booth. As long as it is empty, the system flows; the moment a sustained queue forms, drivers start arriving late at their destination, and TTFT goes through the roof.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> A public case in &lt;em>&amp;ldquo;11-Second Time to First Token on a Healthy vLLM Server&amp;rdquo;&lt;/em> (Medium, Ingero, 2026): a server with no XIDs, no preemption, DCGM metrics all green, but &lt;code>num_requests_waiting&lt;/code> sustained above 0 and a TTFT of &lt;strong>11 seconds&lt;/strong>. Issue &lt;strong>vllm#16985&lt;/strong> documents progressive degradation in long sessions: the queue grows slowly over hours without any other indicator moving. The root cause is not hardware, it is &lt;strong>admission control&lt;/strong>: the arrival rate exceeds the completion rate and the system does not enqueue any more, it leaves requests in &lt;code>WAITING&lt;/code>. Red Hat designates it as &lt;strong>the primary saturation metric&lt;/strong> in its tutorial &lt;em>&amp;ldquo;5 steps to triage vLLM performance&amp;rdquo;&lt;/em>.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> The primary HPA metric in KEDA, see &lt;a href="https://blog.lo0.es/en/posts/llm-inference-autoscaling-kubernetes-hpa-keda/">Autoscaling LLM on Kubernetes&lt;/a>. Typical threshold: alert if &lt;code>avg_over_time(vllm:num_requests_waiting[5m]) &amp;gt; 5&lt;/code>. For canaries: if the queue only forms in the v2 pool, it is a regression of the new model, not cluster load.&lt;/p>
&lt;h3 id="vllmgpu_cache_usage_perc--the-kv-cache-pool">&lt;code>vllm:gpu_cache_usage_perc&lt;/code> — the KV cache pool&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The capacity of an events hall where each guest takes up a variable amount of space. The maître d&amp;rsquo; admits guests up to capacity; when a new guest arrives and there is no room, he &lt;strong>throws out the guest who has been there longest&lt;/strong> to make space for the newcomer. That is vLLM&amp;rsquo;s preempt-on-OOM.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Issue &lt;strong>vllm#5051&lt;/strong> &lt;em>&amp;ldquo;Add num_requests_preempted metric&amp;rdquo;&lt;/em> was born exactly out of operators observing degradation with no direct metric telling them how many requests were being thrown out. The official vLLM documentation confirms: &lt;em>&amp;ldquo;sustained &lt;code>gpu_cache_usage_perc&lt;/code> above 90 % indicates the server is approaching its KV cache limit and will begin preempting sequences&amp;rdquo;&lt;/em> (oldest-first). The distinctive visual pattern: a &lt;strong>sawtooth near 100 %&lt;/strong> with preemption spikes. In &lt;code>swap&lt;/code> mode, the latency of the preempted request explodes because there is a host↔device PCIe copy; in &lt;code>recompute&lt;/code> mode (the default in V1), the preempted request redoes its prefill from scratch, which pushes its TTFT to double or triple.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> If &lt;code>gpu_cache_usage_perc &amp;gt; 92 %&lt;/code> is sustained, there are &lt;strong>two levers&lt;/strong>: lower &lt;code>max_num_seqs&lt;/code> (admit less concurrency, but none of it gets preempted) or raise &lt;code>gpu_memory_utilization&lt;/code> (more pool, less VRAM for transient activations, a different risk). The choice depends on the workload. The metric that is directly missing, a preempted counter, is exported from vLLM v1.0 onwards as &lt;code>vllm:num_preemptions_total&lt;/code> (see issue #5051).&lt;/p>
&lt;h3 id="vllmtime_to_first_token_seconds--the-latency-the-client-sees">&lt;code>vllm:time_to_first_token_seconds&lt;/code> — the latency the client sees&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The time from a customer walking into a restaurant to receiving the first piece of bread at the table. Too long and the customer thinks they have been forgotten, even if the main course is going to arrive perfect.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> Three documented patterns of recurring TTFT spikes:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Badly calibrated chunked prefill.&lt;/strong> Issue &lt;strong>vllm#25677&lt;/strong> (Qwen3-30B-A3B) reported &lt;strong>prefill 10–11× slower with chunked prefill enabled&lt;/strong> than without it. Cause: a very low &lt;code>max_num_batched_tokens&lt;/code> forces small chunks that do not fill the kernels. Issue &lt;strong>vllm#7604&lt;/strong> documents an equivalent regression on Llama-3-70B v0.5.4. The lever: raise &lt;code>max_num_batched_tokens&lt;/code> to 4096–8192 for typical prompts above 2k.&lt;/li>
&lt;li>&lt;strong>Regression between engine versions.&lt;/strong> Issue &lt;strong>vllm#8819&lt;/strong> documents a regression of &lt;code>vllm:time_to_first_token_seconds_sum&lt;/code> between minor versions. Issue &lt;strong>vllm#11912&lt;/strong> reports that with a prompt of around 8000 tokens, TPOT rose from &lt;strong>15.7 ms → 25.7 ms&lt;/strong> from v0.6.4.post1 onwards with no config change, a regression confirmed and trackable only with the metric.&lt;/li>
&lt;li>&lt;strong>Long-context prefill blocking decodes.&lt;/strong> The &lt;em>&amp;ldquo;11s TTFT on healthy server&amp;rdquo;&lt;/em> case cited above: a 30k-token prefill monopolises the GPU for several seconds and the active decodes freeze. Fix: well-calibrated chunked prefill, or disaggregated serving (see &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a>).&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Operational implication.&lt;/strong> Do not alert only on the absolute P95; alert also on the &lt;strong>v2/v1 ratio&lt;/strong> when there is a canary (&lt;code>histogram_quantile(0.95, ..., version=&amp;quot;v2&amp;quot;) / histogram_quantile(0.95, ..., version=&amp;quot;v1&amp;quot;) &amp;gt; 1.10&lt;/code>). If TTFT grows and the queue is stable, the bottleneck is prefill: not solvable by adding replicas, but there are levers in quantisation or chunked prefill.&lt;/p>
&lt;h3 id="vllmtime_per_output_token_seconds--streaming-smoothness">&lt;code>vllm:time_per_output_token_seconds&lt;/code> — streaming smoothness&lt;/h3>
&lt;p>&lt;strong>The analogy.&lt;/strong> The speed at which the waiter brings the courses one after another after the first. If the next one takes a while, the diner notices something is wrong even though the first course arrived on time.&lt;/p>
&lt;p>&lt;strong>The documented anomaly.&lt;/strong> The distinctive pattern is the &lt;strong>abrupt step when &lt;code>gpu_cache_usage_perc&lt;/code> crosses roughly 85 %&lt;/strong>: TPOT jumps from 35 ms to 80 ms in a few seconds because the engine starts competing for the HBM with its own evictions. Issue &lt;strong>vllm#35387&lt;/strong> documents another anomalous case: &lt;strong>MTP (speculative decoding) causing a 76 % latency regression&lt;/strong> on Qwen3-Next-80B-A3B-Instruct-FP8. The TPOT metric caught it before any client complaints were filed.&lt;/p>
&lt;p>&lt;strong>Operational implication.&lt;/strong> The difference from TTFT: if TTFT grows and Queue Time is stable, you are prefill bound; if TPOT grows at a steady rate, there is pressure on the HBM (KV cache pool or swap enabled). A secondary alert on the TPOT SLO, but also watch the &lt;strong>derivative&lt;/strong>: TPOT rising 1 ms every 10 minutes is a latent regression that does not break the SLO yet but will.&lt;/p>
&lt;h2 id="the-operational-rule-read-metrics-by-family-not-in-isolation">The operational rule: read metrics by family, not in isolation&lt;/h2>
&lt;div class="diagram" style="max-width:820px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 820 280" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="combined reading of metrics by family">
&lt;style>.b{stroke:#333;stroke-width:1.4;rx:6}.c{fill:#dfe9f5;stroke:#356}.m{fill:#eef0d0;stroke:#7a3}.t{fill:#f4e3cf;stroke:#a63}.s{fill:#f6e2e2;stroke:#a33}.title{font:600 13px sans-serif;fill:#222}.h{font:700 12px sans-serif;fill:#222}.l{font:11px sans-serif;fill:#222}.n{font:italic 10px sans-serif;fill:#444}&lt;/style>
&lt;text x="410" y="20" text-anchor="middle" class="title">Combinations that diagnose (each family on its own misleads)&lt;/text>
&lt;rect x="20" y="40" width="380" height="100" class="b c"/>
&lt;text x="30" y="62" class="h">COMPUTE saturated BUT memory free&lt;/text>
&lt;text x="30" y="80" class="l">SM_OCCUPANCY 95% + TENSOR_ACTIVE 75% + DRAM_ACTIVE 50%&lt;/text>
&lt;text x="30" y="98" class="l">+ FB_USED 60%&lt;/text>
&lt;text x="30" y="120" class="n">→ Prefill bound. Lever: speculative decoding,&lt;/text>
&lt;text x="30" y="134" class="n"> chunked prefill, disaggregated serving.&lt;/text>
&lt;rect x="420" y="40" width="380" height="100" class="b m"/>
&lt;text x="430" y="62" class="h">MEMORY saturated BUT compute slack&lt;/text>
&lt;text x="430" y="80" class="l">SM_OCCUPANCY 35% + TENSOR_ACTIVE 18% + DRAM_ACTIVE 92%&lt;/text>
&lt;text x="430" y="98" class="l">+ gpu_cache_usage_perc 88%&lt;/text>
&lt;text x="430" y="120" class="n">→ Decode bound + KV cache under pressure.&lt;/text>
&lt;text x="430" y="134" class="n"> Lever: FP8 KV cache, shorter context.&lt;/text>
&lt;rect x="20" y="150" width="380" height="120" class="b t"/>
&lt;text x="30" y="172" class="h">High TPOT WITHOUT saturating compute or memory&lt;/text>
&lt;text x="30" y="190" class="l">DRAM_ACTIVE 65% + FB_USED 70% + temp 78°C&lt;/text>
&lt;text x="30" y="208" class="l">+ THROTTLE_REASONS = 0x40 (HW_THERMAL)&lt;/text>
&lt;text x="30" y="230" class="n">→ Silent thermal throttle.&lt;/text>
&lt;text x="30" y="244" class="n"> Lever: check rack ventilation, not the engine.&lt;/text>
&lt;text x="30" y="258" class="n"> Classic Dell/Lenovo KB case.&lt;/text>
&lt;rect x="420" y="150" width="380" height="120" class="b s"/>
&lt;text x="430" y="172" class="h">High TTFT P95 WITHOUT throttle or queue&lt;/text>
&lt;text x="430" y="190" class="l">num_requests_waiting 0 + throttle 0 + DRAM_ACTIVE 70%&lt;/text>
&lt;text x="430" y="208" class="l">+ v2/v1 ratio = 1.4 (canary live)&lt;/text>
&lt;text x="430" y="230" class="n">→ v2 model regression in prefill.&lt;/text>
&lt;text x="430" y="244" class="n"> Lever: roll back the canary,&lt;/text>
&lt;text x="430" y="258" class="n"> review the v2 engine config.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="three-anti-patterns-of-the-novice-operator">Three anti-patterns of the novice operator&lt;/h2>
&lt;p>&lt;strong>Anti-pattern 1 — alerting only on absolute thresholds.&lt;/strong> An H100 at 87 % FB is not necessarily an alarm; an H100 at 87 % rising 2 %/min is. Alerts that fire on a fixed threshold without looking at the derivative produce twice the noise and half the value. Rule: for metrics with known dynamics (KV cache, FB, queue), alert on a &lt;strong>sustained delta&lt;/strong>, not just on the level.&lt;/p>
&lt;p>&lt;strong>Anti-pattern 2 — confusing SBE with DBE.&lt;/strong> The &lt;code>DCGM_FI_DEV_ECC_SBE_VOL_TOTAL&lt;/code> counter (single-bit, correctable) grows &lt;strong>continuously&lt;/strong> on any HBM under load; it is not an alarm, it is physics. The one that matters is &lt;code>DCGM_FI_DEV_ECC_DBE_VOL_TOTAL&lt;/code> (double-bit, uncorrectable). Confusing them yields false negatives (not alerting on a real DBE) or false positives (alerting on a harmless SBE).&lt;/p>
&lt;p>&lt;strong>Anti-pattern 3 — treating SM_OCCUPANCY at 99 % as &amp;ldquo;saturated&amp;rdquo;.&lt;/strong> The LLM decode regime is memory-bound, not compute-bound; high SM occupancy with low TENSOR_ACTIVE and high DRAM_ACTIVE &lt;strong>is normal&lt;/strong>. Sizing for &amp;ldquo;GPU at 60 %&amp;rdquo; and asking for more hardware when the cluster is saturated in HBM (not in SMs) means buying twice the GPUs without gaining throughput. Rule: always read SM_OCCUPANCY together with TENSOR_ACTIVE and DRAM_ACTIVE; on its own it means nothing.&lt;/p>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>For a generic cluster of &lt;strong>4 nodes × 4×H100 SXM 80 GB with intra-node NVLink&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>DCGM Exporter&lt;/strong> per node (a GPU Operator DaemonSet) emitting every 15 s; cardinality per GPU is around 80 series. A 16-GPU cluster gives roughly 1.3k base series, around 85k samples/min with a 15 s scrape.&lt;/li>
&lt;li>&lt;strong>vLLM /metrics&lt;/strong> per inference pod; each replica emits around 50 base series. For 16 replicas, around 800 additional series, around 3k samples/min.&lt;/li>
&lt;li>&lt;strong>Prometheus retention&lt;/strong>: 30 days at high resolution plus 1 year downsampled through a Thanos sidecar or Mimir. Estimated volume: 25–35 GB/day.&lt;/li>
&lt;li>&lt;strong>Alertmanager&lt;/strong>: the 6 critical alerts from the &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">previous post&lt;/a> plus derived alerts (delta, v2/v1 ratio, decoded throttle bitmap).&lt;/li>
&lt;/ul>
&lt;p>Each metric is worth exposing also as an &lt;strong>OTel attribute&lt;/strong> on the spans of the &lt;a href="https://blog.lo0.es/en/posts/llm-tracing-opentelemetry-genai/">GenAI tracing&lt;/a>: &lt;code>gpu.fb_used_pct&lt;/code>, &lt;code>gpu.dram_active&lt;/code>, &lt;code>gpu.throttle_reasons.decoded&lt;/code>. That lets you correlate a slow request with the state of the GPU at that instant, without jumping between dashboards.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Per-alert runbooks&lt;/strong> — the translation of each anomalous metric into concrete action (drain, reset, RMA, scaling, rollback) in the next post: &lt;a href="https://blog.lo0.es/en/posts/incident-response-runbooks-llm-inference-kafka-keep/">Incident response runbooks&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Tail sampling for metric ↔ trace correlation&lt;/strong> — what is preserved when an alert fires, for post-mortem investigation.&lt;/li>
&lt;li>&lt;strong>Per-tenant showback&lt;/strong> combining &lt;code>vllm:request_success_total&lt;/code> × &lt;code>gen_ai.usage.*&lt;/code> × &lt;code>DCGM_FI_DEV_POWER_USAGE&lt;/code> to bill real energy cost.&lt;/li>
&lt;li>&lt;strong>Multi-tenant fairness metrics&lt;/strong> — when a tenant hogs the KV cache pool and how to detect it.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability for LLM inference&lt;/a> — the compact list that this post goes deeper into.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/incident-response-runbooks-llm-inference-kafka-keep/">Incident response runbooks for LLM with Keep + Kafka&lt;/a> — the translation of each anomaly into action.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-tracing-opentelemetry-genai/">LLM tracing with OpenTelemetry GenAI&lt;/a> — the other half of observability.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-inference-autoscaling-kubernetes-hpa-keda/">Autoscaling LLM on Kubernetes&lt;/a> — &lt;code>num_requests_waiting&lt;/code> and &lt;code>gpu_cache_usage_perc&lt;/code> as primary HPA metrics.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Capacity planning for on-premise LLM inference&lt;/a> — how the thresholds relate to the sizing.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/canary-blue-green-shadow-llm-models/">Canary, blue-green and shadow&lt;/a> — the v2/v1 TTFT ratio as a gate.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching&lt;/a> — explains preempt-on-OOM and the KV pool sawtooth.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> — underpins the calculation of &lt;code>gpu_cache_usage_perc&lt;/code>.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Meta — &lt;em>Faulty Nvidia H100 GPUs and HBM3 memory caused half of failures during Llama 3 training&lt;/em> (Tom&amp;rsquo;s Hardware, 2024). &lt;a href="https://www.tomshardware.com/tech-industry/artificial-intelligence/faulty-nvidia-h100-gpus-and-hbm3-memory-caused-half-of-the-failures-during-llama-3-training-one-failure-every-three-hours-for-metas-16384-gpu-training-cluster">tomshardware.com&lt;/a>&lt;/li>
&lt;li>&lt;em>Story of Two GPUs: Characterizing the Resilience of Hopper H100 and Ampere A100&lt;/em>. arXiv 2503.11901. &lt;a href="https://arxiv.org/html/2503.11901v3">https://arxiv.org/html/2503.11901v3&lt;/a>&lt;/li>
&lt;li>ByteDance — &lt;em>Robust LLM Training Infrastructure at ByteDance&lt;/em>. arXiv 2509.16293. &lt;a href="https://arxiv.org/pdf/2509.16293">https://arxiv.org/pdf/2509.16293&lt;/a>&lt;/li>
&lt;li>&lt;em>Mind the Memory Gap: Unveiling GPU Bottlenecks in Large-Batch LLM Inference&lt;/em>. arXiv 2503.08311.&lt;/li>
&lt;li>&lt;em>Capacity-Aware Inference: Mitigating the Straggler Effect in Mixture of Experts&lt;/em>. arXiv 2503.05066.&lt;/li>
&lt;li>NVIDIA — &lt;em>Analyzing Xid Errors with the Xid Catalog&lt;/em> and &lt;em>Memory Error Management&lt;/em> (docs.nvidia.com/deploy).&lt;/li>
&lt;li>Dell — &lt;em>PowerEdge XE8640 with H100 - GPU Performance Issue HW Power Brake Slowdown - Active&lt;/em> (KB 000220508).&lt;/li>
&lt;li>Lenovo — &lt;em>Power brake reporting on H100 GPU&lt;/em> (HT514380).&lt;/li>
&lt;li>vLLM project — issues #5051 (preempted metric), #7604 and #25677 (chunked prefill regression), #11912 (long-prompt regression), #16300 (TP=8 worse than TP=4), #16985 (long-running degradation), #20783 (compressed-tensors no speedup), #35387 (MTP regression).&lt;/li>
&lt;li>Red Hat — &lt;em>5 steps to triage vLLM performance&lt;/em>. &lt;a href="https://developers.redhat.com/articles/2026/03/09/5-steps-triage-vllm-performance">https://developers.redhat.com/articles/2026/03/09/5-steps-triage-vllm-performance&lt;/a>&lt;/li>
&lt;li>AI21 — &lt;em>Go big or go OOM: the art of scaling vLLM&lt;/em>. &lt;a href="https://www.ai21.com/blog/scaling-vllm-without-oom/">https://www.ai21.com/blog/scaling-vllm-without-oom/&lt;/a>&lt;/li>
&lt;li>&lt;em>11-Second Time to First Token on a Healthy vLLM Server&lt;/em> (Medium, Ingero, 2026).&lt;/li>
&lt;li>NVIDIA — &lt;em>DGX SuperPOD Electrical Specifications&lt;/em> (docs.nvidia.com/dgx-superpod).&lt;/li>
&lt;/ul>
&lt;p>Sources: the full URLs are linked inline on each reference.&lt;/p></description></item></channel></rss>