Exercises — NVLink and GPU interconnects
6.3.4 · D4· Hardware › Interconnects, Buses & SoC › NVLink and GPU interconnects
Shuru karne se pehle, ek master reminder jo neeche ke saare arithmetic pe laagu hota hai:
Level 1 — Recognition
L1.1 — Kaun sa link, kaun si speed?
NVLink 2.0 ke liye usable payload bandwidth per direction batao, diya hua hai: 8 lanes, 25 GT/s per lane, 8b/10b encoding.
Recall Solution
KYA karte hain: transfers-per-second ko payload bytes-per-second mein convert karte hain. KYUN: wire symbols (transfers) bhejti hai; har symbol ka sirf hi real data hota hai.
Per lane: .
Saare 8 lanes: .
Bits → bytes convert karo: .
L1.2 — Bidirectional vs unidirectional
NVLink 2.0 full duplex hai. Per link bidirectional payload kya hai, aur "full duplex" physically kya matlab hai?
Recall Solution
Full duplex = har direction ke liye alag wires hoti hain, isliye dono directions ek saath full speed pe chalti hain — koi time-sharing nahi.
.
L1.3 — Spec-sheet trap number
NVIDIA ka datasheet NVLink 2.0 ke liye "50 GB/s per link" kehta hai. Yeh quantity kaunsi hai, aur honest payload kya hai?
Recall Solution
, raw 25 GT/s line rate ko 25 GB/s treat karke — 8b/10b overhead hatane se pehle. Honest payload bidirectional (line rate ko se multiply karo).
Level 2 — Application
L2.1 — Aggregate per-GPU bandwidth
Ek NVLink 2.0 GPU ke paas 6 NVLink ports hain. Iska total bidirectional payload aggregate compute karo.
Recall Solution
Har port: bidirectional. . Yahi number ek single PCIe Gen3 x16 slot () se compare karne ka hai.
L2.2 — PCIe ke upar speedup
L2.1 ka vs PCIe Gen3 x16 at , improvement ka factor compute karo.
Recall Solution
.
L2.3 — NVLink 4.0 payload from scratch
NVLink 4.0 (H100): 9 lanes, 26.56 GT/s, PAM4 (2 bits per symbol), 128b/130b encoding. Per direction payload compute karo.
Recall Solution
KYUN PAM4 formula ko change karta hai: har transfer ab 2 bits carry karta hai (4 voltage levels), 1 nahi. Toh hum 2 se multiply karte hain.
.
(NVIDIA isko round/derate karke headline deta hai depend karta hai kaise count karte hain; method important hai.)
Level 3 — Analysis
L3.1 — Ring pe all-reduce time
8× V100, model = weights. Ek ring all-reduce steps leta hai; har step ek link pe move karta hai, saare links parallel mein busy. Total communication time compute karo.
Recall Solution
Per step: . Saat steps: .
KYUN 8 GPUs ke liye 7 steps: ek ring har chunk ko circle ke around pass karta hai; hand-offs ke baad har GPU ne har contribution dekh li hoti hai. Zyada GPUs = zyada steps, lekin per-step data chunk-sized rehta hai, toh yeh gracefully scale hota hai.
L3.2 — Bandwidth–delay product & buffer sizing
Link: , one-way latency . (a) Bandwidth–delay product (BDP) compute karo. (b) Receiver ke paas sirf buffer hai. Har round ka stall time aur link efficiency nikalo.

Recall Solution
(a) BDP = data "in flight" = bandwidth latency: Figure dekho: credits poore in-flight region (shaded tube) ko cover karni chahiye ya sender pehli ack aane se pehle dry ho jaata hai.
(b) buffer ke saath sender credits exhaust karta hai ke baad. Pehli ack pe hi aati hai, toh sender se tak idle rehta hai: Efficiency . Design fix: buffer BDP → → ack draining se pehle aati hai → 100% efficiency.
Level 4 — Synthesis
L4.1 — Kya training run communication-bound hai?
Ek 8× V100 job ka compute time per iteration hai. Do interconnect options:
- PCIe Gen3, effective after CPU serialization, aur naive scheme 7 peers mein se har ek ko serially bhejta hai.
- NVLink ring all-reduce L3.1 se ().
Har option ke liye communication time compute karo aur decide karo ki iteration compute-bound hai ya communication-bound.
Recall Solution
PCIe naive: . compute se compare karo → communication-bound by . GPUs iteration ka zyaada time idle rehte hain.
NVLink: comm vs compute → abhi bhi communication-bound, lekin sirf . Agar compute aur comm overlap ho (pipelined), toh effective iteration hoga ki jagah.
Synthesis takeaway: NVLink magically tumhe compute-bound nahi banata yahan — yeh comm wall ko se tak shrink karta hai (), ek hopeless run ko ek merely-comm-limited run mein badal deta hai jise overlap hide kar sakta hai.
L4.2 — Deadline hit karne ke liye generation choose karo
Tumhe same model, 8 GPUs, ring (7 steps) ke liye per-iteration all-reduce comm se kam rakhna hai. Kaun si slowest NVLink generation kaafi hai: 1.0 (), 2.0 (), ya 4.0 ( GB/s per direction)?
Recall Solution
Comm time seconds, chahiye , toh
- 1.0 (): — too slow.
- 2.0 (): — too slow.
- 4.0 (): ✅.
Required 1.0 aur 2.0 ko exclude karta hai. Answer: NVLink 4.0 sabse slow listed generation hai jo deadline meet karti hai.
Level 5 — Mastery
L5.1 — Ek target se interconnect design karo
Tum ek naya NVLink generation spec kar rahe ho. Requirements: payload per direction per link, aur tum sirf lane count (integer) aur signaling rate (GT/s) choose kar sakte ho. Tum PAM4 (2 bits/symbol) aur 128b/130b encoding pe locked ho. Silicon signaling ko per lane aur lanes tak limit karta hai. Ek valid pair dhundho aur prove karo ki yeh target meet karta hai.
Recall Solution
Payload per direction (bytes/s): Constraint ke liye solve karo: Toh humein lanes rate chahiye. choose karo: chahiye . choose karo ( ✅). Check karo: ✅. Ek valid design: 9 lanes at 28 GT/s. (Kaafi saare pairs kaam karte hain; e.g. 12 lanes at 21 GT/s deta hai .)
L5.2 — Ek faster future link ke liye Buffer + BDP
Tumhara L5.1 link pe chal raha hai aur, longer traces ki wajah se, one-way latency tak badh jaati hai. Minimum receiver buffer kya rakhoge jo efficiency 100% rakhe? KB mein express karo.
Recall Solution
Buffer BDP chahiye: Insight: faster + longer-latency links ko bigger buffers chahiye. Bandwidth ya latency double karne se credits double ho jaate hain jo tumhe on-chip hold karne padte hain — yeh ek real silicon-area cost hai jo bound karti hai ki interconnects kitni fast grow kar sakte hain.
L5.3 — NVLink invent karne ki jagah PCIe ko wider kyun nahi banaya?
Ek paragraph mein (bina calculator ke), parent note ki physics se argue karo ki NVIDIA ne ek point-to-point mesh kyun banaya rather than sab kuch ek wider PCIe tree se push karne ke.
Recall Solution
PCIe ek tree hai jo CPU se root hoti hai: har GPU-to-GPU byte ko root complex tak chadhna padhta hai aur wapas neeche aana padhta hai, toh saare GPU pairs CPU ke finite lanes share karte hain aur latency ke hops add hote hain. PCIe ko wider karna trunk bandwidth badhata hai lekin trunk abhi bhi shared aur CPU-serialized rehta hai — 8 GPUs gradients synchronize karte hue abhi bhi wahan collide karte hain. NVLink iske bajaye har GPU ko ek mesh mein dedicated point-to-point links deta hai, toh pairs parallel mein communicate karte hain bina CPU path ke; aggregate bandwidth links ki number ke saath scale hoti hai, ek shared root ke saath nahi. Differential signaling (noise se cancel hota hai) add karo per-lane rates ko shared bus se bahut upar push karne ke liye, aur tumhein woh jump milta hai jo parent note report karta hai.
Recall Self-test cloze recap
NVLink 2.0 payload per direction 20 GB/s hai. Woh factor jo 8b/10b overhead hatata hai woh hai 8/10 (0.8). PAM4 payload ko 2 se multiply karta hai kyunki yeh 2 bits per symbol carry karta hai. Ek receiver buffer kam se kam bandwidth–delay product (BDP) hona chahiye 100% efficiency ke liye. GPUs mein ring all-reduce ==== steps leta hai.