6.5.16 · D4 · HinglishAdvanced & Emerging Architectures

ExercisesApproximate computing techniques

3,038 words14 min read↑ Read in English

6.5.16 · D4 · Hardware › Advanced & Emerging Architectures › Approximate computing techniques

Shuru karne se pehle, ek 30-second symbol refresher taaki koi bhi naya symbol achanak saamne na aaye:


Level 1 — Recognition

L1.1

Har technique ke liye, batao yeh stack ke kis layer mein hai (circuit / arithmetic / software-loop / memory / voltage): (a) loop perforation, (b) truncated multiplier, (c) DRAM refresh rate kam karna, (d) safe voltage se neeche run karna.

Recall Solution L1.1
  • (a) Software-loop — hum loop iterations skip karte hain; koi hardware change nahi chahiye.
  • (b) Arithmetic circuit — hum multiplier ko redesign karte hain taaki low-order partial products drop ho jaayein.
  • (c) Memory — kam refreshes se kuch DRAM cells decay karte hain → stored data mein bit flips. Dekho DRAM Refresh and Memory Reliability.
  • (d) Voltage — voltage overscaling (VOS); sabse slow paths par rare timing errors.

L1.2

Inme se kaunsa approximate karna safe hai, aur kaunsa exact rehna chahiye? (a) ek pixel colour ke mantissa ke least-significant bits, (b) ek loop-bound counter, (c) ek FP32 number ka exponent, (d) ek summed sensor reading.

Recall Solution L1.2
  • (a) Safe — pixel ke LSBs perceptually invisible hote hain.
  • (b) Exact — ek corrupted loop bound loop ko forever chala sakta hai ya crash kar sakta hai. Control flow critical hai.
  • (c) Exact — exponent magnitude set karta hai. Ek bit flip karo aur number factor se jump kar sakta hai. Dekho Precision and Number Formats (FP32, FP16, INT8).
  • (d) Safe — aggregation per-reading error ko absorb kar leti hai.

Level 2 — Application

L2.1

Ek array multiplier ko se replace kiya gaya hai (precision se tak half ho gayi). use karte hue fixed par, multiplier energy kis factor se girti hai?

Pehle, multiplier energy ki tarah kyun badhti hai? Neeche diye figure ko dekho. Ek array multiplier do -bit numbers ko multiply karta hai AND gates aur full-adder cells ka ek grid bichhaake: ek operand ke bits mein se har ek doosre ke bits mein se har ek ke saath combine hota hai, partial-product cells ka ek array banata hai. Yeh literally hardware ka ek -by- square hai — rows columns cells. Kyunki har cell roughly same switching energy burn karta hai, poora multiplier burn karta hai. Yeh law ke peeche geometric reason hai (dekho Ripple-Carry vs Array Multipliers).

Figure — Approximate computing techniques
Recall Solution L2.1

Energy ratio Toh energy one quarter ho jaati hai — ek saving. kyun, sirf kyun nahi? Cell count ek square ka area hai, isliye half karne se area quarter ho jaata hai (jaise ek square ki side half karne se area quarter ho jaati hai). Isliye bit-width half karna itna powerful lever hai.

L2.2

Dynamic power hai . Hum voltage se tak overscale karte hain, fixed rakhte hue. Original power ka kitna fraction hum bachate hain?

Recall Solution L2.2

Power ke saath scale karta hai, isliye Saving . Baaki hum abhi bhi pay karte hain.

L2.3

aur multiply karo. Exact product ke liye kuch fractional bits chahiye; hum 3 fractional bits tak truncate karte hain ( resolution). Truncated value, absolute error, aur relative error nikalo.

Recall Solution L2.3
  • Exact: .
  • ke multiples tak truncate karo (tail drop karo, neeche round karo): (kyunki , aur isliye 3rd fractional bit set nahi hai).
  • Absolute error .
  • Relative error .

Level 3 — Analysis

L3.1

Tum numbers sum karte ho, jinka mean hai (refresher se yaad karo: har summand ka average value hai, injected wobble ka typical size hai). Do approximation schemes:

  • Scheme U (unbiased): har addition independent zero-mean error add karta hai standard deviation ke saath.
  • Scheme B (biased): har addition hamesha ek fixed lose karta hai (systematic).

Har ek ke under final sum ki relative error estimate karo. Kaunsa jeetatA hai aur kyun?

Recall Solution L3.1

Signal (true sum) .

Scheme U — errors quadrature mein add hote hain (variances sum hoti hain): Relative error .

Scheme B — biases linearly add hoti hain (sab ek hi direction mein hain): Relative error .

Unbiased se jeetta hai. Neeche diya figure dikhata hai kyun: random (zero-mean) errors partly cancel hote hain aur sirf ki tarah badhte hain (teal curve), jabki ek bias kabhi cancel nahi hota aur ki tarah badhta hai (orange curve).

Figure — Approximate computing techniques

Figure padhna: horizontal axis hai, accumulated operations ki sankhya; vertical axis total error magnitude hai. Orange line biased drift hai — ek seedhi line jo relentlessly badhti hai. Teal curve unbiased spread hai — yeh bend karke flatten hoti hai kyunki har naya random error utna hi cancel karne ki probability rakhta hai jitna add karne ki. Dashed marker par () gap hai vs : purely biased hone ki penalty.

L3.2

Do multiplier designs target image quality PSNR dB meet karte hain (yaad karo: PSNR hamara image-quality metric hai — higher dB = kam visible error):

  • Design X: lower 6 partial-product rows truncate karta hai, measured PSNR dB.
  • Design Y: lower 8 rows truncate karta hai, measured PSNR dB.

Array multiplier ke saved cells (rows dropped) . Kaunsa design ship karoge, aur kyun "zyada truncation" automatically better nahi hai?

Recall Solution L3.2

Design X ship karo. Design Y zyada truncate karta hai ( cells drop vs cells — zyada energy saved) lekin PSNR quality bound fail karta hai. Ek violated constraint ek rejected product hai; extra savings jo tum use hi nahi kar sakte worthless hain. Sahi rule: sabse aggressive design choose karo jo still bound satisfy kare — yahan woh X hai.


Level 4 — Synthesis

L4.1

Tum ek INT8 neural-network accelerator design kar rahe ho (dekho Neural Network Quantization). Energy budget hit karne ke liye do techniques combine karo: precision scaling (FP32 → INT8) aur voltage overscaling ( ko V se V tak drop karo). FP32, V baseline ke relative combined multiplier-energy factor estimate karo. ( use karo; FP32 mantissa multiply ko , INT8 ko maano.)

Recall Solution L4.1

Do independent factors multiply karo.

Precision factor:

Voltage factor:

Combined: Toh multiplier energy FP32 baseline ka lagbhag 8% ho jaati hai — roughly ek reduction. Yeh stacking (precision × voltage) energy-efficient design mein ek standard recipe hai; dekho Dark Silicon and Energy-Efficient Architectures.

L4.2

Tumhare accelerator ke weights DRAM mein hain. Tum refresh power bachane ke liye refresh rate low karte ho (approximate memory), lekin yeh occasionally bits flip karta hai. Ek partition scheme design karo: kaunsa data low-refresh (lossy) region mein jaata hai aur kaunsa reliable region mein rehta hai? Criticality principle se justify karo.

Recall Solution L4.2
  • Reliable region (normal refresh): exponents / scale factors, loop counters, pointers, critical weights ke top few mantissa bits, aur koi bhi ECC-protected control data. Inhe flip karne se magnitude blow-ups ya crashes hote hain.
  • Lossy region (low refresh): large weight/activation tensors ke low-order mantissa bits, aur cached intermediate feature maps. Ek flipped LSB ek weight ko thodi si fraction se nudge karta hai — network ki statistical aggregation absorb kar leti hai.
  • Justification: approximation criticality follow karni chahiye. Jis bits ka flip answer ki magnitude change karta hai woh exact rehti hain; jis bits ka flip sirf last decimal change karta hai woh lossy jaati hain. Yeh parent note ke rule ko mirror karta hai "kabhi exponents / control flow approximate mat karo."

Level 5 — Mastery

L5.1

Ek video decoder PSNR dB satisfy karna chahiye (higher dB = better picture; matlab "looks flawless"). Ek bit-width sweep deta hai:

PSNR (dB) relative multiplier energy
12 52
10 46
8 41
6 33

Constraint ke subject energy minimise karne ke liye choose karo, phir design ke saath energy saving batao aur "quality cliff" explain karo.

Recall Solution L5.1

Feasible choices (PSNR ): (52), (46), (41). deta hai infeasible. Feasible mein se, energy minimize karo: sabse chhota hai (energy ). se saving: energy saved.

Quality cliff: () se () tak PSNR sirf fewer bits ke liye dB drop karta hai — ek sudden collapse. Neeche diya figure PSNR ko ke against plot karta hai: curve high par gentle hai lekin ke baad dB line ke neeche plunge karta hai. Woh knee quality cliff hai; bilkul iske edge par baitha hai — sabse chhota bit-width jo abhi bhi bound ke upar hai, yaani woh 80/20 sweet spot jo parent note describe karta hai.

Figure — Approximate computing techniques

L5.2

Tumhara final design ek feedback / iterative filter run karta hai (har output agla input ban jaata hai). Per-operation relative error ek tiny hai. Ek colleague kehta hai " negligible hai, ship karo." Woh kis condition mein galat hai, aur tumhe kya check karna chahiye?

Pehle, loop gain kya hai? Ek feedback loop ko ek block diagram ki tarah picture karo (neeche diya figure): ek input enter hota hai, process hota hai, aur output back feed hota hai aur agle step par re-process hota hai. Loop gain woh factor hai jis se us loop ke ek trip mein ek signal (aur uske saath koi bhi error) multiply hoti hai. Agar , toh har lap error ko tak shrink karta hai; agar , toh har lap use tak grow karta hai.

Figure — Approximate computing techniques
Recall Solution L5.2

Woh galat hai jab loop mein error path par gain ho. Ek recurrence mein, step par error , step par ban jaati hai; steps ke baad yeh ho jaati hai. Agar toh yeh exponentially grow karti hai, isliye ek per-step error kuch dozen iterations mein output ko dominate kar sakti hai. Kya check karna hai: per-op error nahi, stability check karo. Verify karo ki loop gain hai (errors decay karte hain) ya system otherwise error-contracting hai. Per-operation smallness zaruri hai lekin feedback systems mein sufficient nahi — exactly parent note ki fourth mistake.


Recall Poori ladder ki one-line summary

Recognition (technique aur uski layer ka naam lo) → Application ( mein plug in karo) → Analysis (bias vs unbiased, constraint-first) → Synthesis (techniques aur unki errors stack karo) → Mastery (quality cliff dhundho aur feedback stability check karo).