Pidoku

Cluster and Capacity Management

Module 21 Lesson 21.l 1h Difficulty 3/5

Prerequisites 4.g, 21.c, 21.e, 22.d, 23.b


Before you start: words you need#

WordPlain meaning
CordonMark a Kubernetes node so no new pods are scheduled on it. Running pods stay until drained.
DrainMove the running pods off a node gracefully, respecting their shutdown time.
TaintA label on a node that keeps pods away unless they explicitly tolerate it.
XidA numbered error event the NVIDIA driver writes to the kernel log (4.g). Some mean “your program crashed”, some mean “this GPU is broken”.
ECC errorA memory bit error. Correctable ones are fixed silently; uncorrectable ones corrupt data or kill the process.
DCGMNVIDIA Data Center GPU Manager: health checks, diagnostics and metrics for data-centre GPUs.
Lead timeTime from deciding to buy GPUs to their serving traffic (23.b).
FragmentationFree GPUs scattered across nodes so that no node has enough for a new deployment (21.e).

1. What is it?#

Cluster management is the day-to-day operation of a GPU fleet: keeping nodes healthy, keeping capacity allocated sensibly and knowing when to buy more. It runs at four speeds:

CONTINUOUS   health checks, automatic cordon and repair of bad hardware
DAILY        capacity and utilisation dashboard, rejected and queued requests
WEEKLY       placement review, fragmentation, tenant growth
MONTHLY      capacity review against the plan, cost per token trend
QUARTERLY    procurement, hardware refresh, which generation to buy

The method for computing how many GPUs you need is 23.b; how replicas are placed is 21.e. This lesson is about running the fleet those produce.

Facts checked on 13 November 2026.


2. Why does it matter?#

  • GPUs fail far more often than CPUs. Large fleets see memory errors, NVLink faults and GPUs dropping off the PCIe bus every day. A bad GPU in a tensor-parallel group slows or breaks the whole replica.
  • Degraded hardware hides. A GPU running at half its PCIe width or with a weak NVLink link still serves requests, just slower, and looks like a software performance bug for days.
  • Capacity takes months to arrive. Ordering when headroom runs out means months of rejected requests.
  • GPUs are the bill. Idle or fragmented capacity is the platform team’s largest waste.

3. Simple analogy#

A taxi fleet. Every car gets an inspection before it carries passengers (validation). Cars with warning lights go to the garage automatically, not when a driver feels like reporting it (automatic cordoning). The dispatcher watches how many cars are busy and how long customers wait (dashboard). New cars take months to deliver, so the manager orders them from a forecast, not from today’s queue, and first asks whether better routing could carry more passengers with the cars already on the road (efficiency versus procurement).


4. Tiny example: when to order#

Section 6’s program takes a fleet at 70% of capacity at peak, demand growing 6% a month, a 5-month lead time and a 20% headroom target:

headroom falls below 20% in 2.3 months
with a 5-month lead time: the order is already 2.7 months late

after a 30% efficiency gain: below 20% in 6.8 months; order within 1.8 months

A fleet with 30% headroom feels comfortable and is already late. A software efficiency gain (quantization, prefix-aware routing, better batching) is the only lever that acts faster than procurement.


5. Technical explanation#

The node lifecycle#

PROVISIONED → VALIDATED → READY → SERVING → DRAINING → CORDONED → REPAIRED ─┐
                            ▲                                                 │
                            └──────────────── re-validate ◄──────────────────┘

A node is not ready because Kubernetes says so; it is ready when it has passed validation.

Validation before a node serves#

Shell
#!/bin/bash
# node-validation.sh — run on every new or repaired node before it joins a pool.
set -euo pipefail
fail() { echo "VALIDATION FAILED: $*" >&2; exit 1; }
EXPECTED_GPUS=8   # 4 on a GB200/GB300 compute tray

# 1. All GPUs present, no uncorrectable memory errors
[ "$(nvidia-smi -L | wc -l)" -eq "$EXPECTED_GPUS" ] || fail "expected $EXPECTED_GPUS GPUs"
nvidia-smi --query-gpu=ecc.errors.uncorrected.aggregate.total --format=csv,noheader \
  | grep -qv '^0$' && fail "uncorrectable ECC errors recorded"

# 2. NVIDIA's own diagnostics: level 3 adds memory, PCIe and stress tests (takes minutes)
dcgmi diag -r 3 || fail "DCGM diagnostics"

# 3. Collective bandwidth across all GPUs in the node, against your known-good baseline
all_reduce_perf -b 1G -e 1G -g "$EXPECTED_GPUS" | tee /tmp/nccl.txt
./check_busbw.sh /tmp/nccl.txt "$MIN_BUSBW_GBPS" || fail "NCCL bus bandwidth"

# 4. Host: model cache volume present and writable
[ -w /var/cache/models ] || fail "model cache not writable"
echo "VALIDATION PASSED"

The thresholds (MIN_BUSBW_GBPS and the like) must come from your own known-good nodes of the same type: what NCCL achieves differs between H100, H200, B200 and GB200 systems (9.f). Run the script on every node, every time it comes back from repair, and after driver upgrades. A node with a degraded PCIe link or a missing NVLink connection will otherwise underperform silently (22.k).

Health monitoring and automatic cordoning#

SIGNAL                                   USUAL RESPONSE
Xid with a recovery action               follow it: GPU reset, node reboot, or drain and
(Xid 154 names it on recent drivers)     reset; repeat offenders → replace
"GPU has fallen off the bus" (Xid 79)    cordon, drain, reboot; if it repeats, hardware
uncorrectable ECC, row-remap failure     cordon now; replace if remapping is exhausted
correctable ECC rising                   schedule maintenance
NVLink errors                            cordon (often a cable, connector or switch tray)
thermal or power throttling, sustained   check cooling and power; may affect a whole rack
application Xids (e.g. 13, 31, 43)       usually the program, not the GPU: restart the pod,
                                         investigate if one GPU sees them far more often

Automate the response. The 2026 open tools:

  • DCGM and dcgm-exporter (installed by the GPU Operator, 21.c) for health watches and metrics such as DCGM_FI_DEV_XID_ERROR and the row-remap counters (22.j).
  • NVSentinel (NVIDIA, open source, v1.31.0): detects GPU, NIC and system faults from DCGM, syslog and cloud maintenance events, then cordons, drains and remediates with a GPU reset or reboot. It ships with only monitoring on; cordoning and remediation are switched on step by step.
  • node-problem-detector (Kubernetes, v1.37.0) for kernel and host problems.
AUTOMATIC RESPONSE, in order
  taint the node   gpu-health=unhealthy:NoSchedule
  drain its pods   respecting terminationGracePeriodSeconds (engine drains, 20.h)
  remediate        reset or reboot; re-validate; untaint only on a pass
  record           a ticket with the diagnostic output, per node and per GPU serial
  alert            if more than ~2% of nodes are out, or one rack has several

Automate the cordon. A manual response means a bad node keeps taking traffic until someone notices the pattern. Cap the automation too: a bug in a health check must not cordon half the fleet at once.

The capacity dashboard#

FLEET          GPUs by type: serving / free / cordoned / in repair
               allocation by model and by tenant
UTILISATION    DRAM_ACTIVE and SM activity from DCGM, not nvidia-smi "utilization" (22.d)
               running batch size and KV cache use per model
DEMAND         requests and tokens per second by model and tenant; 7- and 30-day trend;
               peak-to-average ratio
HEALTH         headroom at peak; hours above 80% of capacity this week;
               rejection rate; queue wait p95
COST           $/hour, $/million tokens by model and tenant (23.c)
               cost trend versus demand trend

Cost trend versus demand trend is the platform team’s summary metric. Demand up 40% and cost up 40%: standing still. Cost up 15%: getting more efficient.

Fragmentation and consolidation#

SYMPTOM   free GPUs exist, but a new 4-GPU deployment cannot be placed

WEEKLY    compute the placement current demand would produce from scratch;
          if it needs ≥ 10% fewer nodes than today's, plan a consolidation

PROCEDURE during low traffic: move one replica of a model at a time, wait for
          readiness and warm caches before the next, abort if latency degrades

Consolidation is disruptive; prevent the need with standard GPU counts per model and a bin-packing scheduler policy (21.e).

Heterogeneous fleets#

Real fleets mix generations: A100, H100, H200, B200, B300, RTX PRO 6000, sometimes AMD MI355X. Label nodes by GPU type (the GPU Operator’s feature discovery does this, nvidia.com/gpu.product), let models declare acceptable and preferred types in the registry (21.b), and match workloads to what they are bound by:

decode-heavy, latency-sensitive, large KV   → most memory bandwidth and capacity (H200, B300)
prefill-heavy, compute-bound                → most FLOPs per dollar
small models, moderate traffic              → cheaper inference GPUs
batch, offline, evaluation                  → the oldest hardware, or spot capacity

Measure dollars per million tokens per GPU type per workload (23.c) rather than trusting spec sheets, and route accordingly (8.e covers choosing hardware).


6. Under the hood: efficiency versus procurement#

Go
// procurement.go — when must you order GPUs, and what does an efficiency win buy you?
// Peak demand grows by a fixed share each month; new capacity arrives a fixed time after
// the order. Order when the forecast says headroom will fall below target on arrival.
package main

import (
	"fmt"
	"math"
)

const (
	capacity     = 1000.0 // tokens/s the fleet can serve at its SLO, in thousands (= 1M tok/s)
	peakNow      = 700.0  // today's peak demand, same units
	growth       = 0.06   // 6% more peak demand every month
	leadMonths   = 5.0    // order → in service: approval, delivery, racking, validation
	minHeadroom  = 0.20   // keep at least 20% spare at peak
	efficiencyUp = 1.30   // a 30% throughput gain from software (quantization, routing, ...)
)

// monthsUntil returns when peak demand reaches cap × (1 − minHeadroom).
func monthsUntil(cap float64) float64 {
	limit := cap * (1 - minHeadroom)
	return math.Log(limit/peakNow) / math.Log(1+growth)
}

func orderBy(m float64) string {
	if m < 0 {
		return fmt.Sprintf("the order is already %.1f months late", -m)
	}
	return fmt.Sprintf("order within %.1f months", m)
}

func main() {
	fmt.Printf("headroom today: %.0f%%\n\n", 100*(1-peakNow/capacity))
	fmt.Println("month  peak demand  headroom")
	for m := 0; m <= 12; m += 2 {
		peak := peakNow * math.Pow(1+growth, float64(m))
		fmt.Printf("%5d  %11.0f  %7.0f%%\n", m, peak, 100*(1-peak/capacity))
	}

	hit := monthsUntil(capacity)
	fmt.Printf("\nheadroom falls below %.0f%% in %.1f months\n", 100*minHeadroom, hit)
	fmt.Printf("with a %.0f-month lead time: %s\n", leadMonths, orderBy(hit-leadMonths))

	hit2 := monthsUntil(capacity * efficiencyUp)
	fmt.Printf("\nafter a %.0f%% efficiency gain: below %.0f%% in %.1f months; %s\n",
		100*(efficiencyUp-1), 100*minHeadroom, hit2, orderBy(hit2-leadMonths))
}

Output:

headroom today: 30%

month  peak demand  headroom
    0          700       30%
    2          787       21%
    4          884       12%
    6          993        1%
    8         1116      -12%
   10         1254      -25%
   12         1409      -41%

headroom falls below 20% in 2.3 months
with a 5-month lead time: the order is already 2.7 months late

after a 30% efficiency gain: below 20% in 6.8 months; order within 1.8 months

The arithmetic is 23.b’s: headroom must cover growth over the lead time. The platform-team lesson is the comparison: a 30% efficiency gain moves the deadline by about 4.5 months, longer than most hardware lead times, and it is permanent. Ask “what would make the fleet we have serve more?” before “how many GPUs do we buy?”, and usually do both.


7. Performance implications#

  • One slow GPU slows its whole replica. Tensor-parallel and expert-parallel groups run at the pace of the slowest member, so a throttling or degraded GPU costs the throughput of 4–8 GPUs. Compare per-GPU metrics within a replica, not just fleet averages.
  • Validation baselines catch silent degradation. Keep a per-node record of NCCL bus bandwidth and diagnostic results; a node drifting 10% below its siblings is worth a look.
  • Consolidation and draining cost cache warmth. Moved replicas start with empty prefix caches (21.h); schedule moves for low traffic.

8. Production implications#

  • Validate every node before it serves, after every repair and every driver upgrade.
  • Automate cordon, drain and remediation, with a cap on how many nodes automation may take out at once.
  • Track utilisation with DCGM profiling metrics, not nvidia-smi utilisation (22.d).
  • Review capacity monthly against the plan; start procurement from the forecast (23.b).
  • Weigh efficiency work against procurement every time.
  • Standardise GPU counts per model to prevent fragmentation.
  • Match hardware to workload by measured cost per token.
  • Keep a per-GPU history (by serial number): repeat offenders should be replaced, not rebooted forever.

9. Common mistakes#

  1. No node validation. Degraded hardware silently underperforms.
  2. Manual response to hardware faults. The same bad node causes repeated incidents.
  3. Treating every Xid as a hardware fault, or none of them.
  4. Unbounded automation. A bad health check cordons the fleet.
  5. Tracking nvidia-smi utilisation. It reads high on a mostly idle GPU (22.d).
  6. Ordering when headroom runs out. Months too late.
  7. Treating all GPUs as interchangeable.
  8. Frequent consolidation instead of preventing fragmentation.

10. Hands-on exercise#

  1. Run procurement.go with your own fleet’s numbers. How late or early are you? How big an efficiency gain would remove the need to order this quarter?
  2. Adapt the validation script to a node you can use. Record its NCCL bus bandwidth and DCGM diagnostic result as the baseline for that node type.
  3. Read the Xid log. On a GPU node, run dmesg | grep -i xid (or check your logging system for the fleet) and classify each event as application or hardware.
  4. Build the dashboard. Implement the panels in section 5 from DCGM and engine metrics. Which number surprised you?
  5. Install NVSentinel in monitor-only mode on a test cluster and compare what it reports with what your current alerts catch.

11. Interview questions#

  1. What would you check on a new GPU node before it serves traffic?
  2. How should a platform respond to an Xid error, automatically?
  3. Why must automated cordoning be capped?
  4. What is the right utilisation metric for a GPU fleet, and why not nvidia-smi?
  5. When should you order GPUs, and what can you do instead?
  6. How do you manage a fleet of mixed GPU generations?
  7. What one metric tells you whether the platform team is improving?

12. Further reading#

Checked on 13 November 2026.

↑↓ navigate↵ openesc close

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