Visual walkthrough — NUMA architectures
6.1.7 · D2· Hardware › Parallelism & Multicore › NUMA architectures
Yeh page parent note ka headline result — NUMA factor aur average-latency formula — rebuild karta hai, ek single memory request aur ek stopwatch se shuru karke. Hum assume karte hain ki aapko sirf itna pata hai ki ek processor kabhi-kabhi memory se koi number maangta hai. Baaki sab kuch draw kiya gaya hai.
Agar koi word yahan heavy lage, toh parent NUMA architectures note mein wider context hai; caches aur coherence ke prerequisite ideas memory consistency models aur multicore synchronization mein hain.
Step 1 — "Memory access time" ka matlab kya hai
KYA HAI. Ek processor ek aisi machine hai jo, har second mein kayi billions baar kehti hai "mujhe address par stored number do." Maangne aur milne ke beech ka time ek memory access hai. Hum us duration ko ek naam dete hain: , nanoseconds (ns) mein measure kiya jaata hai — second ka arb-waaan hissa.
YE KYUN shuru karein. Baad ke har symbol ko stopwatch readings se banaya gaya hai. Agar hum kabhi nail nahi karte "hum kya time kar rahe hain," toh jaisi ratios meaningless hain. Toh sabse pehla object ek single arrow hai ek core se ek memory bank tak, uspe clock laga hua.
PICTURE. Ek core, ek memory bank, ek request jaati hui aur data wapas aata hua. Green bar stopwatch par elapsed time hai.

Step 2 — Do tarah ke requests: local aur remote
KYA HAI. Ek NUMA machine mein memory ko nodes mein kaata jaata hai. Har node ek core-group hai jo apni nearby memory bank se chipka hua hai. Ek request aapke apne node mein ja sakti hai (chhota safar) ya kisi aur ke node mein (interconnect wire ke paar lamba safar). Same operation, do bahut alag distances.
DO naam kyun. Ek single symbol ab reality describe nahi kar sakta, kyunki same core alag-alag times dekhta hai is baat par depend karte hue ki data kahaan rakha hai. Jis moment ek number do outcomes mein split ho jaata hai, hum har outcome ko apna naam dete hain — warna hum unhe compare nahi kar sakte.
- — core se memory controller tak chhoti hop, jo same node mein baitha hai.
- — DRAM chips se bits nikalne ka physical time. Unavoidable, har jagah same.
- — apna node chhodne ka extra toll: interconnect par (QPI / Infinity Fabric), door node ke controller tak, aur data ka return trip. Yeh term local access ke liye zero hai aur remote ke liye positive.
PICTURE. Same core se do arrows: ek chhota green waala apne bank mein, ek lamba red waala interconnect ke paar neighbour ke bank mein. Red arrow visibly lamba hai — woh length hi hai.

Step 3 — "Kitna slow hai" ko ek clean number mein badalna:
KYA HAI. Hum raw nanoseconds ki utni parwah nahi karte jitni ratio ki: remote trip local se kitne times slow hai? ko se divide karo aur result ko ek naam do.
- Bar ka matlab divide hai. Remote upar hai aur local neeche, taaki answer padha jaaye "remote itne-many times ek local access hai."
- Agar remote local, toh fraction hai. Toh matlab "bilkul koi penalty nahi" — ek plain UMA machine.
- Agar remote double slow hai ( vs ), toh .
RATIO kyun, subtraction nahi? Hum likh sakte the, lekin woh ek raw duration hai jo ek machine ki clock speed se bandi hai. Ek ratio unit-free hoti hai — woh alag-alag machines mein survive karti hai aur hume kehne deti hai "is box ka NUMA factor 1.8 hai" ek single portable quality score ke roop mein. Yahi woh exact sawaal hai jiska hume jawaab chahiye: yahan remote kitna bura hai?
PICTURE. Latencies ki ek number line jisme local mark par hai aur remote marks dahine taraf push hue hain; horizontal gap, ek multiplier ke roop mein expressed, hai.

Step 4 — Real programs dono ko mix karte hain: fraction introduce karo
KYA HAI. Ek running program lakhs accesses karta hai. Kuch local memory hit karte hain, kuch remote jaate hain. ko woh fraction maano jo remote jaate hain — aur ke beech ki ek number.
- → har access local hai (perfect locality, sapna).
- → har access remote hai (worst case).
- → paanch mein se ek access interconnect cross karta hai (parent note ka 80/20 example: 80% local, toh ).
FRACTION kyun? Kyunki reality ek mixture hai, sab-local ya sab-remote nahi. Poore program ka time predict karne ke liye hume jaanna hai ki kitni baar har tarah ka hota hai. Ek single fraction "meri locality kitni leaky hai" ko ek dial mein capture karta hai jise hum ghuma sakte hain.
PICTURE. 100 tick marks ki ek bar; unka ek fraction red (remote) rang ka, baaki green (local). slide karo aur bar recolour ho jaata hai.

Step 5 — Averaging: weighted mean jo deta hai
KYA HAI. Agar fraction accesses cost karte hain aur fraction , toh typical access time unka weighted average hai — har cost ko kitni baar hota hai ussse multiply karo, phir add karo:
WEIGHTING kyun, plain average nahi? Plain average pretend karta ki dono equally often hote hain. Hote nahi — aapke paas 95% local aur 5% remote ho sakta hai. Har cost ko uski actual frequency se weight karna long-run mean paane ka ek hi honest tarika hai.
Ab substitute karo Step-2 ka fact (jo sirf Step 3 ko rearrange kiya hai) sab kuch mein collect karne ke liye:
- — local slice, har ek pay karta hai.
- — remote slice, har ek pay karta hai.
- — factor out front taaki bracket ek pure multiplier ho jo bataye ki kitne local-latencies ek average access costs karta hai.
PICTURE. Ek see-saw / weighted-beam: local weight par aur remote weight par, balance point bracket ki value par land karta hua.

Step 6 — Speedup: locality aapko kitna buy karti hai
KYA HAI. Apne mixed program ko disaster baseline se compare karo jahan har access remote hai, . Speedup kitne times faster mixed program hai:
Upar aur neeche ka cancel ho jaata hai (ek common factor divide ho jaata hai), ek clean, machine-independent expression reh jaata hai:
- Numerator — all-remote kitna bura hai.
- Denominator — Step 5 ka bracket — aap actually kitne bure hain.
- Bada = aapki locality ki mehnat worst case ke relative mein rang layi.
ALL-REMOTE case se kyun divide karein? Kyunki yeh locality ki value ko hi isolate karta hai. Yeh jawaab deta hai "ek NUMA-oblivious program ke comparison mein jo interconnect par bhatakta rehta hai, data ko local rakhne se mujhe kitna mila?"
PICTURE. ka curve versus : par curve par baitha hai (aap hi baseline hain); jaise woh ki taraf climb karta hai (all-local poora factor faster hai).

Step 7 — Edge cases (reader ko kabhi stranded mat chhhodo)
KYA HAI & KYU. Ek formula jis par aap trust karte ho use apne extremes mein survive karna chahiye. aur ko unki limits tak push karte hain aur confirm karte hain ki har jawaab sane hai.
| Case | Plug in | Result | Meaning |
|---|---|---|---|
| Perfect UMA () | kisi bhi ke liye | Koi penalty exist nahi karti, toh locality help nahi kar sakti — sahi hai. | |
| All local () | Aap all-remote baseline ko poore factor se beat karte ho. | ||
| All remote () | Aap hi baseline ho — koi speedup nahi, jaisa expected tha. | ||
| Extreme NUMA () | Speedup aapke remote fraction se cap hoti hai — ek hard Amdahl-style ceiling. |
- ceiling punchline hai: infinitely fast local memory bhi aapko rescue nahi kar sakti agar fraction accesses ab bhi interconnect par crawl karte hain. Aapka remote traffic anchor hai.
PICTURE. Speedup curve phir se, is baar ceiling ek dashed line ke roop mein draw ki hui jiske against curve press karti hai jaise badhta hai.

Ek-picture summary
Upar wala sab kuch, ek canvas par: ek request local (green, ) aur remote (red, ) mein split hoti hai; fraction unhe ek weighted beam par mix karke banata hai; all-remote baseline ko se divide karne par speedup curve milti hai apni ceiling ke saath.

Recall Feynman retelling — plain words mein wapas bolein
Ek computer kabhi-kabhi numbers fetch karta hai memory se jo uske bilkul paas hai (fast) aur kabhi-kabhi memory se jo ek wire ke paar doosre kamre mein hai (slow). Hum ek fetch time karte hain aur use kehte hain. Kyunki same core ko do alag times dikhte hain, hum ko aur mein split karte hain, jahan remote sirf local plus wire cross karne ka toll hai. "Remote kitna worse hai" ko ek portable number mein describe karne ke liye hum unhe divide karte hain: . Ek real program mixture karta hai, toh hum track karte hain, un fetches ka share jo remote jaate hain. Typical fetch time do costs ka weighted average hai is hisaab se ki har ek kitni baar hota hai — woh weighted average, tidy karke, hai. Ise ek aisi program se compare karna jo har baar remote jaati hai ek speedup deta hai . Extremes test karne se pata chalta hai yeh theek behave karta hai: koi penalty nahi matlab koi speedup nahi, all-local matlab full speedup, aur — key lesson — infinitely fast local memory bhi aapko par cap karta hai. Toh poora game ghatana hai: apna data wahan raho jahan aapka thread rehta hai.
Recall Quick self-test
ka kya matlab hai, aur "80% local" use kya value deta hai? ::: un accesses ka fraction hai jo remote hain; 80% local ka matlab hai. ratio kyun use karein difference ki jagah? ::: Ratio unit-free aur machines mein portable hai; difference ek machine ki clock se bandi hai. , ke saath speedup kya hai? ::: . Jab , speedup ceiling kya hai? ::: — aapka remote fraction hard limit hai.