Exercises — Multicore vs manycore designs
6.1.4 · D4· Hardware › Parallelism & Multicore › Multicore vs manycore designs
Yeh page ek self-testing ladder hai. Har rung pichle se mushkil hai. Solution ko cover karo, problem try karo, phir reveal karo. Yeh page apne aap mein complete hai — har symbol jo yahan use hota hai, woh pehle define kiya gaya hai.

Figure s01 — woh map jis par har problem rehti hai. Yeh picture pehle padho aur baar baar isko dekho. Horizontal axis core count hai (log scale, taaki aur ek hi plot share kar sakein), aur vertical axis aggregate throughput GIPS mein hai (billions of instructions/sec poore chip ke liye — jitna zyada utna better). Teen points marked hain:
- Orange dot (low-left) multicore hai: sirf cores hain, isliye yeh far left mein hai, aur uska total throughput ( GIPS) modest hai — lekin un cores mein se har ek ek sprinter hai, single thread par sabse fast.
- Teal dot (far right, high) manycore hai: cores ise right push karte hain aur uska aggregate throughput GIPS tak le jaate hain — lekin har core ek slow walker hai.
- Plum diamond (middle) ek heterogeneous chip hai: kuch fast cores plus kai slow ones, deliberately dono extremes ke beech mein baitha hua. Poori page poochti hai is map par mera workload kahan rehna chahta hai? — L2.3 do labelled dots ko compute aur place karta hai, L3 unke beech crossover dhundta hai, L4 position ko transistor aur power budgets se jodta hai, aur L5 middle mein plum diamond banata hai.
Level 1 — Recognition
Kya tum philosophy ka naam le sakte ho aur definitions padh sakte ho?
Recall Solution L1.1
Manycore. Deciding features:
- Bahut zyada core count (6912, multicore ke 2–16 range se bahut upar).
- Simple in-order cores 1 IPC aur tiny caches / koi L2 nahi ke saath — parent ke manycore checklist se exactly match. Yeh NVIDIA A100 profile hai parent ke Example 2 se. Figure s01 ke map par, yeh chip far right par teal dot hai.
Recall Solution L1.2
Cores (aur cores add karna). Transistor budget fixed hai, isliye per-core complexity aur cores ki sankhya direct competition mein hain. Yeh parent note ka central sentence hai.
Recall Solution L1.3
- (a) → Manycore. Fully data-parallel, har output element independent hai.
- (b) → Multicore. Pointer chasing = unpredictable branches + latency-sensitive, simple cores ke liye bahut bura.
- (c) → Multicore. Ek bada serial fraction matlab fast individual cores core count se kahin zyada matter karte hain.
Level 2 — Application
Kya tum dono models mein numbers plug kar sakte ho?
Recall Solution L2.1
Step 1 — tool choose karo. Kyun Amdahl aur throughput nahi? Sawaal poochh raha hai ek job kitni tezi se khatam hoti hai, jo ek speedup (latency) ka sawaal hai — yahi exactly Amdahl's Law measure karta hai. Throughput ek alag sawaal answer karta (total work/sec). Step 2 — plug in karo. Kyun yeh numbers waahan? parallel slice hai, un-shrinkable serial slice hai, aur hai kitne cores parallel slice ko split karte hain: Iska matlab: 16 cores tak double karne se bhi muskil se fark padta hai — serial term dominate karta hai. Isliye multicore har core ko fast rakhta hai instead of cores add karne ke.
Recall Solution L2.2
Step 1 — serial term set karo. Kyun yeh vanish hota hai? matlab kuch bhi serial nahi hai, isliye : koi un-shrinkable part nahi hai jo speedup ko strangle kare. Step 2 — poori job ko se divide karo. Kyun denominator sirf hai? Serial term gone hone ke saath, poora runtime parallel part hai jo sabhi cores mein split hota hai: Yeh kaisa lagta hai: perfect parallelism speedup ko ke saath linearly badhata hai — yahi main reason hai ki manycore chips cores pile on karte hain. (Real hardware ~4000× hit karta hai kyunki memory bandwidth, cores nahi, limit ban jaati hai.)
Recall Solution L2.3
Step 1 — throughput choose karo, speedup nahi. Kyun? Sawaal poochh raha hai ki poora chip sabhi threads mein total work per second kitna karta hai — yeh throughput hai, isliye hum definition box ke chaar factors multiply karte hain. Aggregate throughput chaar factors multiply karta hai: Ratio: . Manycore throughput mein jeetta hai ~4.7× se — yeh Figure s01 par do dots place karta hai (orange multicore neeche, teal manycore upar). Step 2 — single-thread speed: units straight rakho. Kyun drop hota hai? Ek single thread ek core par run karta hai, isliye core count uske liye irrelevant hai — sirf per-core factors survive karte hain.
- Work per cycle per core sirf hai: multicore vs manycore ⇒ har clock mein 4× zyada work.
- Throughput per core hai: multicore GIPS/core vs manycore GIPS/core ⇒ per core faster jab clock include ho. Toh manycore aggregate work mein 4.7× se jeetta hai lekin single-thread work mein per cycle 4× se haarta hai (≈per second 10.7×). Yeh ulta pull exactly Figure s01 mein two-axis tension hai.
Level 3 — Analysis
Kya tum break-even points dhundh sakte ho aur limits ke baare mein reason kar sakte ho?
Recall Solution L3.1
Step 1 — ceiling dhundho. Kyun dekhte hain? Kyunki yeh runtime ke us hisse ko isolate karta hai jo koi bhi parallelism nahi chhu sakti — serial fraction. Jab , parallel term (ek fixed amount of work ko ever more cores mein divide karne se woh kuch nahi ki taraf shrink ho jaata hai), sirf bachta hai: Step 2 — 90% target set karo. Kyun 20 ka 90%, yaani 18? Hum woh core count chahte hain jahan hum achievable gain ka zyaadatar hissa capture kar lein, isliye hum poochhte hain "kaun sa speedup deta hai?" Full formula ko 18 ke barabar set karo: Step 3 — invert karo. Kyun invert? Unknown denominator ke andar phansa hua hai; dono sides flip karne se woh free hota hai. Dono sides ke reciprocals lete hain: Step 4 — isolate karo. Serial term subtract karo, phir divide karo: Toh 20× limit ka 90% reach karne ke liye ~171 cores chahiye. Insight: us ke baad, extra cores almost waste hain — serial 5% woh wall hai.
Recall Solution L3.2
Do Amdahl speedups ko equal set karo: Numerators match karte hain, isliye equality ke liye chahiye, jo sirf par hold karta hai. Kisi bhi ke liye, manycore denominator chhota hai (kyunki ), isliye manycore ka Amdahl speedup hamesha ≥ multicore ka hai har ke liye, aur jab bhi hota hai strictly greater hota hai. Catch: yeh pure-Amdahl view per-core speed ignore karta hai. Jab tum factor in karo ki har manycore core per clock bahut slow hai (L2.3 se), toh multicore chhote ke liye jeetta hai — jo exactly L3.3 hai.
Recall Solution L3.3
Step 1 — score banao. Kyun per-core work ko speedup se multiply karte hain? Amdahl speedup har chip ke apne baseline ke relative hai, isliye yeh hide karta hai ki ek multicore core intrinsically 16× stronger hai. Per-core weight se multiply karna dono chips ko ek common absolute yardstick par laata hai:
- Multicore: , .
- Manycore: , . Step 2 — equal set karo. Kyun equal? Crossover exact woh hai jahan koi nahi jeetta — solve karo aur tum jaanoge ki har chip kis side dominate karti hai: Step 3 — cross-multiply karo. Kyun? Yeh ek move mein dono fractions clear karta hai, equation ko plain polynomial arithmetic mein convert karta hai: Step 4 — dono sides expand karo. Distribute karo aur fractions ko decimals mein convert karo (, ): Step 5 — like terms collect karo. Constants left mein gather karo, -terms right mein: Step 6 — solve karo. Toh manycore tabhi overtake karta hai jab — tumhe slow cores ki bheed se few fast cores ko beat karne ke liye 99% se zyada parallel code chahiye. Yeh single number chapter ki poori story hai.
Level 4 — Synthesis
Kya tum transistor budget ko performance ke saath combine kar sakte ho?
Recall Solution L4.1
Ratio . Tum 1 complex core ke badle 50 simple cores trade karte ho — parent ke tradeoff derivation se matching.
Recall Solution L4.2
Absolute score with . Complex (w=16, N=40): Simple (w=1, N=2000): Complex layout jeetta hai ( vs , lagbhag ). 98% parallel par bhi, 2% serial part plus 16× per-core weight fast cores ko aage rakhta hai. Flip karne ke liye ~99.4% chahiye (L3.3 logic).
Recall Solution L4.3
- Complex: W — 200 W se bahut zyada. Max cores jo fit honge: cores. drop karo.
- Simple: W — 200 W se zyada. Max: cores. drop karo. Lesson: area ab real limit nahi hai — power hai. Die mein kahin zyada cores fit hote hain jitne tum afford karke switch on kar sako. Yeh "dark silicon" ki reality hai jo Heterogeneous Computing ke peeche hai.
Level 5 — Mastery
Kya tum khud tradeoff design kar sakte ho?
Recall Solution L5.1
Normalization convention (pehle define karo). ko poori job ka runtime ek single complex core par running at per-core work 1 maano — ek reference stopwatch jo hum set karte hain. Given percentages se split karte hue: serial control loop us unit ka leta hai aur parallel kernel . Neeche ka har runtime inhi units mein measured hai, toh chhota = faster. Strategy: serial loop ko ek fast complex core par daalo, aur baaki power budget parallel kernel ke liye simple cores par kharch karo — yeh Heterogeneous Computing idea hai. 1 complex core reserve karo: 30 W. Remaining power W. Simple cores: cores.
- Heterogeneous chip: serial complex core par run karta hai, 16× faster ⇒ . Parallel 425 simple cores par run karta hai (har ek 1× work) ⇒ . Total .
- Pure complex, 6 cores: serial . Parallel 6 complex cores par (har ek 16× work, 6 parallel) ⇒ . Total . Heterogeneous vs pure-complex ka speedup , yaani ~8.4% faster, jabki dono same 200 W cap obey karte hain. Synthesis insight: serial loop ko ek fast core chahiye (16× serial work mein 425 slow cores se beat karta hai — kyunki simple cores koi serial speedup nahi dete), jabki parallel kernel swarm ko reward karta hai. Dono mix karna isliye real chips (Heterogeneous Computing, big.LITTLE, CPU+GPU) kisi bhi single philosophy se better hote hain.
Recall Solution L5.2
Ek manycore core lambi memory stalls ko thread-level parallelism se hide karta hai: jab ek thread memory ka wait karte karte stall karta hai (100+ cycles), hardware scheduler instantly doosra ready thread swap in karta hai, isliye pipeline busy rehti hai bina ek bade cache ke jo stall avoid kare ya branch predictor ke jo usse guess kare. Kyunki hamesha aur threads wait kar rahe hote hain, latency tolerate ki jaati hai rather than eliminate ki, jo transistor budget ko aur zyada cores par kharach karne ki freedom deta hai instead of deep Memory Hierarchy par. Ek multicore core bilkul ulti situation face karta hai: yeh often ek single latency-critical thread run karta hai bina koi spare threads ke swap karne ke liye, isliye ek memory stall ya ek mispredicted branch poori job stall kar deta hai. Isliye use large Memory Hierarchy (bada private L1/L2) mein invest karna padta hai data ko paas rakhne ke liye aur branch prediction mein pipeline full rakhne ke liye. Ek line mein: bahut saare threads latency tolerate karne dete hain, isliye tum core ko bare kar sakte ho; kuch threads latency eliminate karne par majboor karte hain, isliye caches aur prediction ke liye pay karna padta hai — yahi exactly reason hai ki do philosophies transistor budget ko opposite directions mein split karti hain.
Recall Self-test summary
Kaun sa single number capture karta hai "code ko kitna parallel hona chahiye manycore ke multicore per-die se beat karne se pehle"? ::: Lagbhag — 99% se zyada parallel (L3.3). Modern chips mein core count kya bind karta hai, area ya power? ::: Power (L4.3) — die mein kahin zyada cores fit hote hain jitne power cap allow karta hai. Kyun manycore branch prediction skip kar sakta hai? ::: Thread-level parallelism stalls hide karta hai; ek stalled thread ko ek ready wale se swap kiya jaata hai (L5.2).