Foundations — Neural processing units (NPUs)
6.5.8 · D1· Hardware › Advanced & Emerging Architectures › Neural processing units (NPUs)
Parent note padhne se pehle, tumhe us har symbol ko apna banana hoga jo woh use karta hai. Yeh page har ek ko zero se build karta hai — pehle plain words mein, phir ek picture, phir why the topic needs it. Upar se neeche padho; har block sirf wahi cheezein use karta hai jo uske upar define ki gayi hain.
1. Ek number, aur unhe multiply karna
Bilkul flat se shuru karte hain. Ek number bas ek quantity hai — jaise ya . Jab hum do numbers ke beech likhte hain, hum multiply karte hain: .
Why the topic needs it: ek neural network multiplications se bana hai. Do neurons ke beech har connection ek signal ko ek strength se multiply karta hai. Isliye hardware ka sabse chhota useful piece sabse pehle multiply kar sakna chahiye.
2. Running total, aur "accumulate" ka idea
Ab maan lo tumhare paas numbers ki ek list hai aur tum unka total chahte ho. Tum ek running total rakhte ho — ek box jo se shuru hota hai aur jaise-jaise tum numbers daalo, badhta jaata hai.
Arrow ka matlab hai "ban jaata hai": box ki nayi value uski purani value plus nayi number hai. Yeh accumulation hai — step by step sum build karna.
Why the topic needs it: poora NPU is ek operation ki hazaaron copies hai. Agar tum MAC samajh gaye, tum woh atom samajh gaye jisse machine bani hai.
3. Numbers ki lists: vector, aur dot product
Ek vector bas numbers ki ek ordered list hai, jaise . Ise labelled boxes ki ek row samjho.
Ab do vectors lo jo same length ke hon. Unhe position by position multiply karo, phir woh saare products add kar do. Yahi dot product hai:
Why the topic needs it: neural-network layer ka har ek output number ek dot product hai. Parent ki line ek chhupa hua dot product hai — us ko hum aage unpack karte hain.
4. Summation symbol
Bada Greek letter (sigma, "S" for "Sum") ka shorthand hai "ek series of terms add karo."
Ise zor se padho: "sum, jaise se tak jaata hai, ka."
- ke neeche wala letter () counter hai aur uski starting value hai.
- Upar wala letter () woh hai jahan counter rukta hai.
- har term ki recipe hai — ek template jisme tum current plug in karte ho.
Why the topic needs it: the compact way hai yeh kehne ka ki "har ke liye MAC karo aur total rakho." Parent ka dot product precisely ek -step MAC chain hai. Counter hardware ko batata hai ki ek output ke liye kitne multiply-adds chahiye.
5. Numbers ki grids: matrix, aur subscripts
Ek matrix numbers ka ek rectangle hai — rows aur columns, jaise ek spreadsheet. Ise ek capital letter se name karte hain, jaise , aur ek single cell ko do subscripts se point karte hain:
Why the topic needs it: parent weights ko aur inputs ko likhta hai. Row/column convention ke bina, gibberish hai. Iske saath, tum formula dekh sakte ho: yeh ki row ke column ko ke column ke row ke saath chalata hai.
6. Matrix multiply
Matrix (size ) ko matrix (size ) se multiply karne ke liye, tum har output cell ko ek dot product ke roop mein compute karte ho: ki row aur ke column ka dot product.
Shapes ko beech mein match karna chahiye: mein columns hain aur mein rows — yeh shared har dot product ki length hai. Result ka hai.
Why the topic needs it: matrix multiply neural inference ka ~90% hai. Poora NPU sirf yeh ek cheez fast karne ke liye exist karta hai. Iske teen dimensions decide karte hain ki PEs ki grid kitni bhari hui hai (utilisation, parent note mein).
7. Processing element (PE) aur grid
Ek PE (Processing Element) chip par ek physical MAC unit hai: hardware jo har clock cycle mein karta hai.
Kai PEs ko rows aur columns ki 2-D grid mein rakho aur numbers ko neighbours ke beech flow karne do — yahi systolic array hai. Saare PEs har tick fire karte hain, toh grid har cycle mein MACs karta hai.
8. Reuse, aur memory kyun dushman hai
Har woh number jo ek PE multiply karta hai memory se aana chahiye. Do types hain:
- DRAM — bada, door, slow, energy-hungry (ek read ~ lagta hai).
- On-chip SRAM / scratchpad — chhota, paas, sasta.
Ek MAC khud sirf ~ lagta hai. Toh number fetch karna ~1000× zyada mahenga ho sakta hai usse use karne se.
Why the topic needs it: parent kehta hai "data reuse hi poora game hai." Ab tum jaante ho kyun: arithmetic almost free hai; data move karna expensive hai.
9. Precision: ek number kitne bits use karta hai
Hardware mein ek number fixed number of bits (0/1 switches) mein store hota hai. Zyada bits = zyada fine detail lekin bade, zyada hungry circuits.
- fp32 — 32-bit floating point, bahut precise.
- fp16 / bfloat16 — 16-bit, half the bits.
- int8 — 8-bit integer, coarse lekin tiny.
Why the topic needs it: "low precision wins" parent ka ek headline claim hai. scaling hi iska reason hai.
Prerequisite map
Har woh box jo tum ab samajhte ho seedha parent topic mein feed hota hai, Neural processing units (NPUs). Grid idea Systolic arrays ki taraf jaata hai; reuse idea Dataflow and data reuse ki taraf; memory-vs-math cost Energy per operation aur Roofline model ki taraf; aur bit-width idea Quantization and int8 inference ki taraf. "Special chip kyun at all" thread Domain-specific architectures se connect hota hai, aur comparisons GPUs and SIMT aur Tensor cores mein milte hain.
Equipment checklist
Khud test karo — right side cover karo aur reveal karne se pehle answer do.