<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rdma on lo0 — Tech Blog</title><link>https://blog.lo0.es/en/tags/rdma/</link><description>Recent content in Rdma 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/rdma/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 kitchen door the maître d' never looked at: network NUMA, Cilium eBPF and DRANET, the fourth leg of pinning</title><link>https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/</link><pubDate>Sat, 06 Jun 2026 12:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/network-numa-cilium-ebpf-dranet-fourth-leg-pinning/</guid><description>&lt;blockquote>
&lt;p>Fourth instalment, a coda, of &amp;ldquo;under the engine&amp;rdquo;. The series closed with three legs of locality: the &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">cable between GPUs&lt;/a>, the &lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">host by hand&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">declarative orchestration of the kubelet&lt;/a>. But the maître d&amp;rsquo; of the last post seated the group looking at CPU, memory and GPU, and never asked &lt;strong>which door the dishes come through&lt;/strong>. That door is the NIC. Here is the fourth leg.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">Topology Manager&lt;/a> admits a pod under &lt;code>single-numa-node&lt;/code> if its CPUs, its memory and its GPU fit on the &lt;strong>same&lt;/strong> NUMA node. The &lt;strong>NIC is not part of that count&lt;/strong>: the kubelet has no Hint Provider for the network card. On an inference node with the network at 200/400 Gb/s, the case of &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>, where the KV-cache travels over RDMA between the prefill pool and the decode pool, a NIC on the wrong socket makes &lt;strong>every packet cross the UPI/QPI&lt;/strong>, exactly the &amp;ldquo;remote NUMA&amp;rdquo; the series fights on the compute side, but coming in through the network door. And there is a second front: the &lt;strong>softirq&lt;/strong> (&lt;code>NET_RX&lt;/code>) that processes the datapath runs on the CPU that services the NIC&amp;rsquo;s IRQ; if that CPU is one of the cores &lt;code>isolcpus&lt;/code>/&lt;code>reserved-cpus&lt;/code> gave exclusively to vLLM, the softirq steals cycles from it and injects jitter into the p99 tail. &lt;strong>Cilium eBPF&lt;/strong> replaces two RKE2 pieces, &lt;code>kube-proxy&lt;/code> (with eBPF/XDP load balancing) and the default CNI &lt;strong>Canal&lt;/strong> (with a native datapath), and its own tuning guide tells you to &lt;strong>kill &lt;code>irqbalance&lt;/code> and pin the NIC IRQs&lt;/strong>: a &lt;strong>fourth list&lt;/strong> to align alongside &lt;code>isolcpus&lt;/code> and &lt;code>reserved-cpus&lt;/code>. The 2026 state of the art closes the gap from above: &lt;strong>netkit&lt;/strong> (kernel ≥6.8, zero namespace overhead), &lt;strong>BIG TCP&lt;/strong> (192k super-packets for 100Gb/s+), &lt;strong>host-routing&lt;/strong> (iptables bypass), and above all &lt;strong>DRA/DRANET&lt;/strong>, the network driver that finally co-schedules &lt;strong>NUMA-local GPU and NIC on the same PCIe root&lt;/strong>, enabling GPUDirect RDMA with &lt;strong>+59.6% bus bandwidth in &lt;code>all_gather&lt;/code> and +58.1% in &lt;code>all_reduce&lt;/code>&lt;/strong>. On a generic RKE2 cluster with 4×H100 SXM nodes.&lt;/p>
&lt;h2 id="where-you-are-the-network-plane-the-trilogy-did-not-open">Where you are: the network plane the trilogy did not open&lt;/h2>
&lt;div class="diagram" style="max-width:560px;margin:1.2rem auto;">
&lt;svg viewBox="0 0 560 340" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="The fourth leg: the network plane under the same NUMA as CPU, memory and GPU">
&lt;text x="280" y="24" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="700" fill="currentColor">The vertical stack · the fourth leg of locality&lt;/text>
&lt;rect x="120" y="40" width="320" height="38" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="64" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Engine · vLLM pod (TP, batching, KV-cache)&lt;/text>
&lt;rect x="120" y="84" width="320" height="38" rx="6" fill="#eef3fb" stroke="#4a6fa5" stroke-width="1.4"/>
&lt;text x="280" y="108" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Orchestration · kubelet: CPU/Mem/Topology Mgr (post 3)&lt;/text>
&lt;rect x="120" y="128" width="320" height="58" rx="6" fill="#dceede" stroke="#3c8c54" stroke-width="3"/>
&lt;text x="280" y="152" text-anchor="middle" font-family="sans-serif" font-size="12.5" font-weight="700" fill="#1f5c34">YOU ARE HERE · network plane: Cilium eBPF + DRA/NIC&lt;/text>
&lt;text x="280" y="170" text-anchor="middle" font-family="sans-serif" font-size="10.5" fill="#2c6b42">NIC NUMA locality · IRQ · GPUDirect RDMA&lt;/text>
&lt;rect x="120" y="192" width="320" height="38" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="216" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Host · NUMA, hugepages, isolcpus (post 2)&lt;/text>
&lt;rect x="120" y="236" width="320" height="38" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="260" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">CUDA + NCCL + NVLink (post 1)&lt;/text>
&lt;rect x="120" y="280" width="320" height="38" rx="6" fill="#f4f4f4" stroke="#888" stroke-width="1.3"/>
&lt;text x="280" y="304" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">Hardware · 2 sockets, 4×H100 SXM, 400 Gb/s NIC&lt;/text>
&lt;text x="280" y="332" text-anchor="middle" font-family="sans-serif" font-size="10.5" font-style="italic" fill="#777">CPU+memory+GPU are pinned by the kubelet; the NIC, until 2026, was pinned by nobody&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-the-door-the-dishes-come-through">The analogy: the door the dishes come through&lt;/h2>
&lt;p>Go back to the restaurant of the &lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">previous post&lt;/a>. The maître d&amp;rsquo;, the Topology Manager, seated the party of eight at a single table (one NUMA node) because the diners (CPUs), the cutlery (memory) and the reserved bottle (the GPU) all fitted. A perfect table. But the maître d&amp;rsquo; &lt;strong>never looked at where the kitchen pass is&lt;/strong>: the door every dish comes in and goes out through.&lt;/p>
&lt;p>That door is the &lt;strong>NIC&lt;/strong>. The prompt comes in there, the tokens go out there, and, in disaggregated serving, the KV-cache that the prefill pool sends to the decode pool circulates there. If the table is in the left-hand room (socket 0) but the kitchen pass is in the right-hand one (socket 1), &lt;strong>every dish crosses the entire restaurant&lt;/strong> (the UPI/QPI), over and over, however impeccably the table is laid. The diner does not notice the perfect table: they notice the dish arriving late and cold.&lt;/p>
&lt;p>And there is a finer detail: the waiter who crosses the room with the dishes (the &lt;strong>softirq&lt;/strong> that processes the packets) is &lt;strong>one of the seated diners&lt;/strong>. If the maître d&amp;rsquo; gave them a chair of their own so they could eat in peace (a core isolated with &lt;code>isolcpus&lt;/code> for vLLM) but the restaurant also has them waiting on the far door, that diner does not eat: they spend the whole dinner crossing the room. The jitter shows up exactly where you thought you had bought calm.&lt;/p>
&lt;p>The trilogy levelled three legs of the table: the cable, the host and the orchestration. The fourth, &lt;strong>which door the dishes come through and who carries them&lt;/strong>, is levelled by no kubelet manager. Until 2026.&lt;/p>
&lt;h2 id="the-gap-why-the-topology-manager-does-not-look-at-the-nic">The gap: why the Topology Manager does not look at the NIC&lt;/h2>
&lt;p>The mechanism of &lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">post 3&lt;/a> is a coordinator (Topology Manager) that consults three &lt;strong>Hint Providers&lt;/strong>: CPU Manager, Memory Manager and Device Manager (the GPU plugin). Each says on which NUMA node it can satisfy its part; the coordinator computes the intersection and admits or rejects.&lt;/p>
&lt;p>The problem is one of &lt;strong>census&lt;/strong>: the classic NIC is not a Device Manager &amp;ldquo;device&amp;rdquo;. A standard Ethernet/InfiniBand card is managed by the CNI and the kernel, it is not requested in the pod&amp;rsquo;s &lt;code>resources:&lt;/code> like &lt;code>nvidia.com/gpu&lt;/code>, and therefore &lt;strong>it emits no NUMA hint&lt;/strong>. The Topology Manager aligns CPU+memory+GPU and leaves the NIC wherever the hardware put it, which may be the other socket. The maître d&amp;rsquo; has three assistants and is missing the fourth: the one who knows which door the dishes come through.&lt;/p>
&lt;p>This did not matter when a node&amp;rsquo;s network was 10/25 Gb/s and the bottleneck was elsewhere. It matters &lt;strong>now&lt;/strong>, with two workloads that saturate the node&amp;rsquo;s network:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Disaggregated serving.&lt;/strong> The &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">KV-cache that travels between the prefill pool and the decode pool&lt;/a> moves over RDMA. These are large transfers, sensitive to latency and bandwidth, which in multi-node setups go out through the NIC.&lt;/li>
&lt;li>&lt;strong>Multi-node NCCL collectives.&lt;/strong> When &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">tensor/pipeline parallelism crosses the node boundary&lt;/a>, the &lt;code>all-reduce&lt;/code>/&lt;code>all-gather&lt;/code> operations no longer go over NVLink but over GPUDirect RDMA on the NIC.&lt;/li>
&lt;/ul>
&lt;p>In both, &lt;strong>where the NIC sits relative to the GPU and to the pod&amp;rsquo;s cores&lt;/strong> decides performance. And the kubelet, on its own, does not coordinate that.&lt;/p>
&lt;h2 id="the-network-datapath-under-numa-irq-softirq-and-dma">The network datapath under NUMA: IRQ, softirq and DMA&lt;/h2>
&lt;p>To see why NIC locality carries weight, you have to look at the path of an incoming packet:&lt;/p>
&lt;div class="diagram" style="max-width:820px;margin:1.2rem auto;">
&lt;svg viewBox="0 0 820 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Path of a packet: NIC, IRQ, softirq and cross-NUMA DMA">
&lt;defs>&lt;marker id="nm" 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="410" y="22" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="700" fill="currentColor">Socket 0 (NIC here) vs Socket 1 (vLLM pod here): the crossing you do not see&lt;/text>
&lt;!-- Socket 0 -->
&lt;rect x="30" y="46" width="360" height="240" rx="10" fill="none" stroke="#4a6fa5" stroke-width="1.6" stroke-dasharray="5 3"/>
&lt;text x="210" y="66" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#4a6fa5">NUMA node 0 · PCIe root with the NIC&lt;/text>
&lt;rect x="60" y="80" width="120" height="44" rx="7" fill="#eef3fb" stroke="#4a6fa5" stroke-width="1.6"/>
&lt;text x="120" y="100" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">NIC 400 Gb/s&lt;/text>
&lt;text x="120" y="115" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#444">multi-queue, RSS&lt;/text>
&lt;rect x="60" y="150" width="120" height="44" rx="7" fill="#f7efda" stroke="#c79a32" stroke-width="1.6"/>
&lt;text x="120" y="170" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">IRQ + softirq&lt;/text>
&lt;text x="120" y="185" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#444">NET_RX on core 0..&lt;/text>
&lt;rect x="60" y="220" width="120" height="44" rx="7" fill="#dceede" stroke="#3c8c54" stroke-width="1.6"/>
&lt;text x="120" y="240" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">RAM node 0&lt;/text>
&lt;text x="120" y="255" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#444">packet DMA&lt;/text>
&lt;path d="M120,124 L120,150" fill="none" stroke="#666" stroke-width="1.4" marker-end="url(#nm)"/>
&lt;path d="M120,194 L120,220" fill="none" stroke="#666" stroke-width="1.4" marker-end="url(#nm)"/>
&lt;!-- Socket 1 -->
&lt;rect x="430" y="46" width="360" height="240" rx="10" fill="none" stroke="#a85454" stroke-width="1.6" stroke-dasharray="5 3"/>
&lt;text x="610" y="66" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#a85454">NUMA node 1 · the kubelet pinned the pod here&lt;/text>
&lt;rect x="550" y="150" width="160" height="44" rx="7" fill="#dceede" stroke="#3c8c54" stroke-width="2.2"/>
&lt;text x="630" y="170" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#222">vLLM pod + GPU&lt;/text>
&lt;text x="630" y="185" text-anchor="middle" font-family="sans-serif" font-size="9" fill="#444">exclusive CPUs node 1&lt;/text>
&lt;!-- cross-numa arrow -->
&lt;path d="M180,242 C320,242 470,172 550,172" fill="none" stroke="#a85454" stroke-width="2.4" marker-end="url(#nm)"/>
&lt;text x="370" y="225" text-anchor="middle" font-family="sans-serif" font-size="11" font-weight="700" fill="#a85454">every packet crosses the UPI/QPI&lt;/text>
&lt;text x="370" y="240" text-anchor="middle" font-family="sans-serif" font-size="9" font-style="italic" fill="#a85454">+latency, +load on the inter-socket link&lt;/text>
&lt;text x="410" y="306" text-anchor="middle" font-family="sans-serif" font-size="10" font-style="italic" fill="#777">The Topology Manager did its job on node 1; the NIC stayed on node 0. Nobody aligned the two.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>Three kernel facts the analogy compresses:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>The IRQ has affinity.&lt;/strong> Each NIC queue raises an interrupt that the kernel services on a specific CPU (&lt;code>/proc/irq/&amp;lt;n&amp;gt;/smp_affinity&lt;/code>). The heavy processing is deferred to a &lt;strong>softirq&lt;/strong> (&lt;code>NET_RX&lt;/code>/&lt;code>NET_TX&lt;/code>), which runs on &lt;strong>that same CPU&lt;/strong>. If &lt;code>irqbalance&lt;/code> is left loose, it migrates them non-deterministically, poison for the p99.&lt;/li>
&lt;li>&lt;strong>The softirq competes with the pod.&lt;/strong> If the IRQ lands on a core that &lt;code>isolcpus&lt;/code> reserved for vLLM, that queue&amp;rsquo;s &lt;code>NET_RX&lt;/code> steals cycles from the model. The signal in &lt;code>/proc/softirqs&lt;/code>: a &lt;code>NET_RX&lt;/code> column that spikes on a single CPU. It is the same jitter from &lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">post 2&lt;/a>, coming in through the network.&lt;/li>
&lt;li>&lt;strong>DMA has a NUMA origin.&lt;/strong> The NIC writes the packet by DMA into the RAM of the socket of its PCIe root. If the consumer (the pod&amp;rsquo;s thread) is on the other socket, it reads across the UPI/QPI. RFS (Receive Flow Steering) tries to bring the processing to the consumer&amp;rsquo;s CPU, but it cannot teleport the NIC to the other socket.&lt;/li>
&lt;/ol>
&lt;h3 id="one-number-with-its-caveat">One number, with its caveat&lt;/h3>
&lt;p>Take a 2-socket node, a &lt;strong>400 Gb/s = 50 GB/s&lt;/strong> NIC on the PCIe root of socket 0, and a decode pod pinned to socket 1. If the NIC saturates, those ~50 GB/s of receive traffic &lt;strong>cross the UPI&lt;/strong> towards socket 1. A UPI 2.0 link runs at around &lt;strong>20–40 GB/s&lt;/strong> per direction and link depending on generation; even with several links, 50 GB/s of network traffic &lt;strong>going against the grain&lt;/strong> eats a far from negligible fraction of the inter-socket budget, the same budget already contended by the pod&amp;rsquo;s remote memory accesses and, if there is multi-node traffic, the &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">KV-cache of the disaggregation&lt;/a>. I am not giving a firm &amp;ldquo;X% degradation&amp;rdquo; because it depends on CPU generation, number of UPI links, MTU and traffic pattern; without that methodology, any exact figure is marketing.&lt;/p>
&lt;p>What &lt;strong>is&lt;/strong> measured with public methodology is the aggregate effect of aligning GPU and NIC: the &lt;strong>DRANET&lt;/strong> project reports &lt;strong>+59.6% bus bandwidth in &lt;code>all_gather&lt;/code> and +58.1% in &lt;code>all_reduce&lt;/code>&lt;/strong> (NCCL collectives) when the assigned NIC is &lt;strong>NUMA-local to the GPU&lt;/strong> rather than not. That is the size of the gap the Topology Manager was leaving open.&lt;/p>
&lt;h2 id="what-rke2s-cilium-ebpf-replaces-and-why-it-touches-this-story">What RKE2&amp;rsquo;s Cilium eBPF replaces (and why it touches this story)&lt;/h2>
&lt;p>RKE2 ships &lt;strong>Canal&lt;/strong> (Flannel + Calico) by default as the CNI and &lt;strong>&lt;code>kube-proxy&lt;/code>&lt;/strong> (iptables/IPVS rules) for Service balancing. Switching to Cilium (&lt;code>cni: cilium&lt;/code> in &lt;code>/etc/rancher/rke2/config.yaml&lt;/code>) replaces both pieces with an eBPF datapath:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>RKE2 piece&lt;/th>
&lt;th>What it does&lt;/th>
&lt;th>What Cilium eBPF puts in&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>kube-proxy&lt;/code> (iptables/IPVS)&lt;/td>
&lt;td>Service balancing&lt;/td>
&lt;td>LB in eBPF; with &lt;code>kubeProxyReplacement=true&lt;/code>, and acceleration in &lt;strong>XDP&lt;/strong> (driver layer)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Canal (Flannel+Calico)&lt;/td>
&lt;td>VXLAN overlay + NetworkPolicy&lt;/td>
&lt;td>native datapath (&lt;code>routingMode=native&lt;/code>), L3/L4 and L7 NetworkPolicy in eBPF&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>veth per pod&lt;/td>
&lt;td>namespace interface pair&lt;/td>
&lt;td>&lt;strong>netkit&lt;/strong> (kernel ≥6.8): namespace overhead ~0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>host iptables traversal&lt;/td>
&lt;td>netfilter hooks&lt;/td>
&lt;td>eBPF &lt;strong>host-routing&lt;/strong>: bypasses iptables and the upper part of the stack&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Up to here this is pure networking and it &lt;strong>does not touch&lt;/strong> the kubelet&amp;rsquo;s resource managers: Cilium does not assign exclusive CPUs nor emit compute NUMA hints. The ten knobs of &lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">post 3&lt;/a> stay identical whether you run Canal or Cilium.&lt;/p>
&lt;p>&lt;strong>But&lt;/strong> Cilium does enter the fourth leg through two doors. The first: its own &lt;a href="https://docs.cilium.io/en/stable/operations/performance/tuning/">tuning guide&lt;/a> recommends, literally, &lt;em>&amp;ldquo;kill &lt;code>irqbalance&lt;/code> and pin the NIC IRQs to specific CPUs for maximum workload isolation&amp;rdquo;&lt;/em>, along with the &lt;code>tuned network-latency&lt;/code> profile, the &lt;code>performance&lt;/code> governor and &lt;code>CONFIG_PREEMPT_NONE&lt;/code>. In other words: the eBPF datapath only really performs &lt;strong>if you coordinate IRQ affinity&lt;/strong>, and that affinity has to point at the &lt;strong>housekeeping&lt;/strong> cores (&lt;code>reserved-cpus&lt;/code>), never at the isolated ones. So a &lt;strong>fourth list&lt;/strong> appears that must be kept consistent with &lt;code>isolcpus&lt;/code> and &lt;code>reserved-cpus&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">isolcpus = 2-31,34-63 # cores exclusive to vLLM (host, post 2)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">reserved-cpus = 0-1,32-33 # kubelet housekeeping (post 3)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">IRQ affinity = 0-1,32-33 # NIC IRQs → housekeeping ONLY (this post)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> # never 2-31: there the softirq would steal from the model
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The second door: &lt;strong>netkit + host-routing + BIG TCP&lt;/strong> reduce how many times the packet crosses the stack and the namespace, which &lt;strong>cushions&lt;/strong> (does not eliminate) the cost of the NUMA crossing. BIG TCP assembles super-packets of up to 192k (against 64k) for 100Gb/s+; fewer stack traversals means less softirq work on the core, and therefore less pressure on the inter-socket budget. It is the &lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">continuous batching&lt;/a> analogy applied to the network stack: amortising a fixed cost over larger batches.&lt;/p>
&lt;h3 id="cilium-performance-profile-state-119-kernel-68">Cilium performance profile (state 1.19, kernel ≥6.8)&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="c1"># Helm, recommended performance profile (summary of the tuning guide)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">helm install cilium cilium/cilium --version 1.19.4 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --namespace kube-system &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set &lt;span class="nv">routingMode&lt;/span>&lt;span class="o">=&lt;/span>native &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set bpf.datapathMode&lt;span class="o">=&lt;/span>netkit &lt;span class="se">\ &lt;/span> &lt;span class="c1"># namespace overhead ~0 (kernel &amp;gt;=6.8)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> --set bpf.masquerade&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set &lt;span class="nv">kubeProxyReplacement&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\ &lt;/span> &lt;span class="c1"># replaces RKE2&amp;#39;s kube-proxy&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> --set &lt;span class="nv">enableIPv4BIGTCP&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\ &lt;/span> &lt;span class="c1"># 192k super-packets (mlx5/ice NIC)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> --set &lt;span class="nv">enableIPv6BIGTCP&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set bpf.distributedLRU.enabled&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\#&lt;/span> per-CPU BPF maps: less spinlock contention
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> --set bpf.mapDynamicSizeRatio&lt;span class="o">=&lt;/span>0.08 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set &lt;span class="nv">bpfClockProbe&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Verification inside a Cilium pod:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">cilium status --verbose &lt;span class="p">|&lt;/span> grep -E &lt;span class="s2">&amp;#34;Device Mode|Host Routing|BIG TCP|XDP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Device Mode: netkit · Host Routing: BPF · IPv4 BIG TCP: enabled · XDP Acceleration: Native&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Sceptical caveat: netkit and BIG TCP are &lt;strong>beta&lt;/strong> and require kernel ≥6.8 and specific NICs (mlx4/mlx5/ice). They are not in-place: they change datapath fundamentals and force you to restart pods or, better, to apply them by &lt;em>per-node config&lt;/em> only on new nodes. For an ENS cluster in production, that is a maintenance window, not a blind &lt;code>helm upgrade&lt;/code>.&lt;/p>
&lt;h2 id="the-2026-state-of-the-art-dra-and-dranet-the-maître-d-who-finally-looks-at-the-door">The 2026 state of the art: DRA and DRANET, the maître d&amp;rsquo; who finally looks at the door&lt;/h2>
&lt;p>What closes the gap at the root is not Cilium, it is the &lt;strong>admission mechanism&lt;/strong> the kubelet did not have for the NIC: &lt;strong>Dynamic Resource Allocation (DRA)&lt;/strong>, beta since Kubernetes 1.32 and with advances in every release up to 1.36 (May 2026). DRA generalises the &amp;ldquo;devices&amp;rdquo; model beyond the GPU: a driver discovers the hardware, publishes &lt;code>ResourceSlices&lt;/code> with its attributes, including the &lt;strong>NUMA topology and the PCIe root&lt;/strong>, and the scheduler resolves &lt;code>ResourceClaims&lt;/code> that can demand affinity between devices.&lt;/p>
&lt;p>&lt;strong>DRANET&lt;/strong> (a &lt;code>kubernetes-sigs&lt;/code> project) is the network DRA driver. It discovers the NICs (including the RDMA-capable ones), advertises them as &lt;code>ResourceSlices&lt;/code>, and via &lt;strong>NRI&lt;/strong> injects them into the pod&amp;rsquo;s namespace, compatible with whatever CNI you already have, Cilium included. The key piece for this story: combined with the &lt;strong>NVIDIA GPU DRA driver&lt;/strong>, it allows &lt;strong>co-scheduling GPU and NIC that share a PCIe root&lt;/strong> (the relationship NVIDIA calls &lt;code>NODE&lt;/code>), which is exactly the condition for &lt;strong>GPUDirect RDMA&lt;/strong>. The maître d&amp;rsquo; finally has a fourth assistant: &lt;em>&amp;ldquo;is there a NIC NUMA-local to this GPU?&amp;rdquo;&lt;/em>.&lt;/p>
&lt;p>The &lt;code>ResourceClaimTemplate&lt;/code> uses CEL selectors to request exactly that alignment:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># Request an RDMA NIC NUMA-local to the assigned GPU (illustrative DRANET/DRA schema)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">resource.k8s.io/v1beta1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ResourceClaimTemplate&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">gpu-nic-numa-aligned&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">devices&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requests&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">rdma-nic&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">deviceClassName&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">dra.net &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># NICs published by DRANET&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">constraints&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">requests&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;rdma-nic&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">matchAttribute&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;dra.net/pcieRoot&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># same PCIe root as the GPU&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c"># → enables GPUDirect RDMA over a NUMA-local path&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Why it matters for inference, not for abstract &amp;ldquo;AI training&amp;rdquo;: in &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>, RDMA is what moves the KV-cache between the prefill pool and the decode pool with the latency that &lt;a href="https://blog.lo0.es/en/posts/optimising-prefill-vllm-knobs-ttft-will-not-forgive/">TTFT&lt;/a> demands; and in multi-node, GPUDirect RDMA replaces &lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">NVLink&lt;/a> as the medium of the collective. Aligning GPU+NIC on the same PCIe root is what turns an &amp;ldquo;RDMA that works&amp;rdquo; into an &amp;ldquo;RDMA that performs&amp;rdquo;, the +60% bus bandwidth from DRANET.&lt;/p>
&lt;p>Status and caveats: DRA is &lt;strong>beta&lt;/strong> (gates to enable by hand), DRANET is young (a SIG project, still evolving) and the managed offering exists mostly in cloud (GKE managed DRANET in preview, AKS for RDMA). For on-premise ENS it is a &lt;strong>path, not a finished product&lt;/strong>: the value today is understanding that the fourth leg already has a standard OSS mechanism, and starting to pilot it on a lab node, not putting it into critical production this quarter.&lt;/p>
&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 the host (post 2).&lt;/strong> The NIC&amp;rsquo;s IRQ affinity is a &lt;strong>third list&lt;/strong> to marry with &lt;code>isolcpus&lt;/code> and &lt;code>reserved-cpus&lt;/code>. The IRQs go to housekeeping; the isolated cores, untouched. Uncoordinating them lets in through the network door the jitter that &lt;code>isolcpus&lt;/code> threw out through the compute one.&lt;/p>
&lt;p>&lt;strong>With the orchestration (post 3).&lt;/strong> DRA is the natural extension of the Topology Manager: the same &amp;ldquo;admit only if it fits on the NUMA node&amp;rdquo; principle carried over to the NIC. Where the Device Manager left the network out of the census, DRANET puts it in.&lt;/p>
&lt;p>&lt;strong>With the interconnect (post 1).&lt;/strong> Inside the node NVLink rules; on crossing the node boundary, GPUDirect RDMA over the NIC is the medium of the collective. The kubelet&amp;rsquo;s NUMA policy guarantees that GPU and CPUs share a socket; &lt;strong>DRANET adds that the NIC does too&lt;/strong>, and only then does the RDMA take the short path.&lt;/p>
&lt;p>&lt;strong>With disaggregated serving.&lt;/strong> The prefill→decode KV-cache is the traffic that punishes a badly placed NIC hardest. The fourth leg is what stops &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">separating prefill and decode&lt;/a> from being paid for in transfer latency.&lt;/p>
&lt;p>&lt;strong>With capacity planning.&lt;/strong> &lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Sizing&lt;/a> gains a dimension: &amp;ldquo;GPUs per node and cores per NUMA node&amp;rdquo; is not enough; you have to count &lt;strong>how many NICs NUMA-local to a GPU&lt;/strong> the chassis has. A node with 4 GPUs and a single NIC on socket 0 has two GPUs &amp;ldquo;far from the door&amp;rdquo;.&lt;/p>
&lt;p>&lt;strong>With observability.&lt;/strong> What confirms that the fourth leg is properly set is not an application dashboard: it is &lt;code>/proc/softirqs&lt;/code> (is &lt;code>NET_RX&lt;/code> concentrated on housekeeping?), &lt;code>nvidia-smi topo -m&lt;/code> (is the GPU↔NIC relationship &lt;code>NODE&lt;/code>/&lt;code>PHB&lt;/code>?) and the NIC counters. It fits with &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability with DCGM&lt;/a>: the GPU &amp;ldquo;at 60% for no reason&amp;rdquo; may be the host waiting for packets that cross the socket.&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>Believing that switching to Cilium &amp;ldquo;already optimises the network&amp;rdquo;.&lt;/strong> Cilium eBPF replaces kube-proxy and Canal and performs better out of the box, but the default deployment prioritises compatibility, not performance. Without &lt;code>irqbalance&lt;/code> disabled, without IRQs pinned to housekeeping and without netkit/host-routing, you leave most of the improvement on the table. Cilium&amp;rsquo;s docs say so; plenty of people do not read the tuning guide.&lt;/p>
&lt;p>&lt;strong>Pinning the NIC IRQs to isolated cores.&lt;/strong> The symmetric mistake to knob 6 of post 3: if you set IRQ affinity over &lt;code>isolcpus&lt;/code>, the &lt;code>NET_RX&lt;/code> softirq steals cycles from vLLM on exactly the cores you isolated so nobody would disturb it. The IRQs go to &lt;code>reserved-cpus&lt;/code>, always.&lt;/p>
&lt;p>&lt;strong>Assuming the Topology Manager already aligns the NIC.&lt;/strong> It does not: the classic NIC is not a Hint Provider. If you need NIC↔GPU locality, today the mechanism is DRA/DRANET, not a kubelet policy. Waiting for &lt;code>single-numa-node&lt;/code> to solve it is waiting for something that is not in its design.&lt;/p>
&lt;p>&lt;strong>Putting DRA/DRANET into ENS production this quarter.&lt;/strong> It is beta and young. The sensible move is to pilot it on a lab node, measure &lt;code>all_reduce&lt;/code>/&lt;code>all_gather&lt;/code> with and without alignment, and decide with data. The +60% figure is from a specific environment; reproduce it in yours before promising it.&lt;/p>
&lt;p>&lt;strong>BIG TCP / netkit without reading the requirements.&lt;/strong> Kernel ≥6.8, mlx4/mlx5/ice NICs, no tunnel or encryption for BIG TCP, and nothing in-place: it forces pod restarts or per-node config. On a cluster with IPsec or with unsupported NICs, part of this does not apply. Check &lt;code>cilium status --verbose&lt;/code> before taking for granted that it is active.&lt;/p>
&lt;p>&lt;strong>Confusing the eBPF datapath (kernel) with the Cilium agent (pod).&lt;/strong> &lt;code>cilium-agent&lt;/code> is a &lt;code>Burstable&lt;/code> DaemonSet that should live on housekeeping (covered by &lt;code>system-reserved&lt;/code>). But datapath processing runs in &lt;strong>softirq&lt;/strong>, governed by the host&amp;rsquo;s IRQ affinity, &lt;strong>not&lt;/strong> by &lt;code>reserved-cpus&lt;/code>. They are two different things; pinning the pod well does not pin the softirq.&lt;/p>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>The &amp;ldquo;under the engine&amp;rdquo; series chased one idea: performance that looks like an engine problem (vLLM is slow) or a model problem (quantisation) is, far too often, a &lt;strong>locality&lt;/strong> problem one layer down. The trilogy covered three: the cable (NVLink not used), the host (remote NUMA, jitter) and the orchestration (pinning that never happened). The fourth was miss&lt;strong>ing&lt;/strong>: &lt;strong>the network&lt;/strong>. The Topology Manager seats the pod at a perfect NUMA table and never asks which door the dishes come through nor who carries them. On a node at 25 Gb/s it made no difference; on one at 400 Gb/s with the KV-cache crossing over RDMA, that door decides TTFT and the collective&amp;rsquo;s bandwidth. &lt;strong>Cilium eBPF&lt;/strong> replaces kube-proxy and Canal with a datapath that performs, if you coordinate IRQ affinity with &lt;code>isolcpus&lt;/code>/&lt;code>reserved-cpus&lt;/code>, a fourth list to align, and &lt;strong>DRA/DRANET&lt;/strong> finally provides the census that was missing: co-scheduling NUMA-local GPU and NIC on the same PCIe root, with an improvement of a size (+60% NCCL bus bandwidth) that measures how big the gap was. Going down a level is not snobbery: it is that the root cause lived, once again, one layer below where the dashboard looks.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/hardening-secrets-sovereign-llm-stack-defence-in-depth/">Hardening and secrets in the sovereign LLM stack: defence in depth&lt;/a> — the default-deny NetworkPolicies and mTLS with Cilium in the hardening of the stack.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&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 GPUDirect RDMA that DRANET places NUMA-locally is broken by ACS if it forces traffic through the root complex; the bus beneath NIC↔GPU locality.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/cpu-memory-topology-manager-rke2/">The maître d&amp;rsquo; who only seats you if you all fit at one table: resource managers on RKE2&lt;/a> — post 3, the direct parent of this one: the Topology Manager pins CPU+memory+GPU but not the NIC; here that fourth leg is opened.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/numa-hugepages-cpu-isolation-gpu-waits-kernel/">NUMA, hugepages and CPU isolation&lt;/a> — post 2; the NIC&amp;rsquo;s IRQ affinity is a third list to marry with &lt;code>isolcpus&lt;/code> and &lt;code>reserved-cpus&lt;/code>, and the &lt;code>NET_RX&lt;/code> softirq is the same jitter coming in through the network.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/nvlink-nvswitch-nccl-cable-every-token-crosses/">NVLink, NVSwitch and NCCL&lt;/a> — post 1; on crossing the node, GPUDirect RDMA over the NIC replaces NVLink, and DRANET is what guarantees that RDMA takes the NUMA-local path.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode separated&lt;/a> — the case that punishes a badly placed NIC hardest: the prefill→decode KV-cache travels over RDMA and pays for every socket crossing.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&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; the network is the plane that holds up multi-node inference.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/llm-inference-autoscaling-kubernetes-hpa-keda/">Autoscaling LLMs on Kubernetes with KEDA&lt;/a> — every new replica does not only go through the kubelet&amp;rsquo;s NUMA admission; with DRA, also through the NIC &lt;code>ResourceClaim&lt;/code>&amp;rsquo;s.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Capacity planning for on-premise inference&lt;/a> — sizing gains a dimension: how many NICs NUMA-local to a GPU the chassis has, not just how many GPUs.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/mixed-nvidia-intel-environments-llm-inference/">Mixed NVIDIA + Intel environments&lt;/a> — NIC↔accelerator NUMA affinity gets complicated when the node mixes GPUs, accelerators and heterogeneous NICs.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability with DCGM&lt;/a> — how to confirm, metric in hand, that the &amp;ldquo;GPU at 60%&amp;rdquo; is not the host waiting for packets crossing the socket.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&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 and model loading&lt;/a> — the same &amp;ldquo;get the CPU out of the way&amp;rdquo; principle that GPUDirect RDMA gives here, applied to disk with GPUDirect Storage to load weights straight from NVMe to HBM.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/sms-cuda-streams-cuda-graphs-inference/">SM, CUDA streams and CUDA graphs&lt;/a> — one floor further down: once the data is in HBM, what happens in the silicon that executes it and why decode becomes launch-bound.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/isolating-ai-agents-workstation-to-cluster/">The contractor with the master key: isolating AI agents from the workstation to the cluster&lt;/a> — the other use of this same kernel layer: on top of Cilium&amp;rsquo;s eBPF datapath, Tetragon hooks its kprobes to observe and kill what an AI agent does in the cluster. Its &lt;a href="https://blog.lo0.es/en/posts/runbook-caging-ai-agent-bubblewrap-tetragon/">runbook&lt;/a> brings the concrete &lt;code>TracingPolicy&lt;/code> objects.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Cilium, &lt;em>Tuning Guide&lt;/em> (netkit, host-routing, BIG TCP, XDP, pin the IRQs and kill irqbalance): &lt;a href="https://docs.cilium.io/en/stable/operations/performance/tuning/">https://docs.cilium.io/en/stable/operations/performance/tuning/&lt;/a>.&lt;/li>
&lt;li>Cilium 1.19 (February 2026), &lt;em>Cilium at Ten Years&lt;/em> — hardening of encryption, policies and observability: &lt;a href="https://www.infoq.com/news/2026/02/cilium-119/">https://www.infoq.com/news/2026/02/cilium-119/&lt;/a>.&lt;/li>
&lt;li>Isovalent, &lt;em>Cilium 1.18&lt;/em> (IPv6, encrypted overlay, ingress bandwidth, policy perf): &lt;a href="https://isovalent.com/blog/post/cilium-1-18/">https://isovalent.com/blog/post/cilium-1-18/&lt;/a>.&lt;/li>
&lt;li>RKE2, &lt;em>Network Options&lt;/em> (Canal by default; Cilium with kube-proxy replacement): &lt;a href="https://docs.rke2.io/networking/basic_network_options">https://docs.rke2.io/networking/basic_network_options&lt;/a>.&lt;/li>
&lt;li>Kubernetes, &lt;em>Dynamic Resource Allocation&lt;/em>: &lt;a href="https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/">https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/&lt;/a>.&lt;/li>
&lt;li>Kubernetes blog, &lt;em>v1.36: More Drivers, New Features, and the Next Era of DRA&lt;/em> (May 2026): &lt;a href="https://kubernetes.io/blog/2026/05/07/kubernetes-v1-36-dra-136-updates/">https://kubernetes.io/blog/2026/05/07/kubernetes-v1-36-dra-136-updates/&lt;/a>.&lt;/li>
&lt;li>DRANET (kubernetes-sigs), the network DRA driver and the paper &lt;em>The Kubernetes Network Driver Model&lt;/em> (+59.6% all_gather / +58.1% all_reduce): &lt;a href="https://github.com/kubernetes-sigs/dranet">https://github.com/kubernetes-sigs/dranet&lt;/a>.&lt;/li>
&lt;li>AKS Engineering, &lt;em>Optimizing RDMA performance for AI workloads on AKS with DRANET&lt;/em> (April 2026): &lt;a href="https://blog.aks.azure.com/2026/04/01/dranet-rdma-optimization-for-ai-on-aks">https://blog.aks.azure.com/2026/04/01/dranet-rdma-optimization-for-ai-on-aks&lt;/a>.&lt;/li>
&lt;li>Linux network tuning — IRQ affinity, RSS/RPS/RFS and NUMA softirq: &lt;a href="https://andreaskaris.github.io/blog/networking/rss-irq-affinity-and-rps/">https://andreaskaris.github.io/blog/networking/rss-irq-affinity-and-rps/&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></channel></rss>