SNNAP: Approximate Computing
- n Programmable SoCs
via Neural Acceleration
Thierry Moreau Mark Wyse Jacob Nelson Adrian Sampson Hadi Esmaeilzadeh Luis Ceze Mark Oskin
SNNAP: Approximate Computing on Programmable SoCs via Neural - - PowerPoint PPT Presentation
SNNAP: Approximate Computing on Programmable SoCs via Neural Acceleration Thierry Moreau Hadi Esmaeilzadeh Mark Wyse Luis Ceze Jacob Nelson Mark Oskin Adrian Sampson Approximate Computing Expose quality-performance trade-offs
Thierry Moreau Mark Wyse Jacob Nelson Adrian Sampson Hadi Esmaeilzadeh Luis Ceze Mark Oskin
Expose quality-performance trade-offs
Expose quality-performance trade-offs ❌ Approximate ✅ Cheap ✅ Accurate ❌ Expensive
Expose quality-performance trade-offs
Domains include image processing, machine learning, search, physical simulation, multimedia etc.
✅ Approximate ✅ Cheap ✅ Accurate ❌ Expensive
float foo (float a, float b) { … return val; }
approximation acceleration
AR M
F P G
NPU
float foo (float a, float b) { … return val; }
approximation acceleration
AR M
F P G
NPU
CPU
F P G A
SNNAP Esmaeilzadeh et al. [MICRO 2012]
CPU F D X I M C
NPU
Programmable SoCs 3.8x speedup and 2.8x efficiency gains
A neural processing unit on off-the-shelf
float foo (float a, float b) { … return val; }
approximation acceleration
AR M
F P G
NPU
Introduction Programming model SNNAP design:
Evaluation & Comparison with HLS
code annotation
[training.data]
back prop. & topology search
region detection & program instrumentation
binary generation
CPU
SNNAP
sobel
float ¡sobel ¡(float* ¡p); ¡ . ¡. ¡. ¡ ¡ Image ¡src; ¡ Image ¡dst; ¡ while ¡(true) ¡{ ¡ ¡ ¡ ¡src ¡= ¡read_from_camera(); ¡ ¡ ¡ ¡for ¡(y=0; ¡y ¡< ¡h; ¡++y) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡(x=0; ¡x ¡< ¡w; ¡++x) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡dst.p[y][x] ¡= ¡sobel(& ¡src.p[y][x]); ¡ ¡ ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡display(dst); ¡ } ¡
APPROX ¡float ¡sobel ¡(APPROX ¡float* ¡p); ¡ . ¡. ¡. ¡ ¡ APPROX ¡Image ¡src; ¡ APPROX ¡Image ¡dst; ¡ while ¡(true) ¡{ ¡ ¡ ¡ ¡src ¡= ¡read_from_camera(); ¡ ¡ ¡ ¡for ¡(y=0; ¡y ¡< ¡h; ¡++y) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡(x=0; ¡x ¡< ¡w; ¡++x) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡dst.p[y][x] ¡= ¡sobel(& ¡src.p[y][x]); ¡ ¡ ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡display(dst); ¡ } ¡
✅ no side effects ✅ executes often sobel ACCEPT: compilation framework for approximate programs
Introduction Programming model SNNAP design:
Evaluation & Comparison with HLS
x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 y0 y1 Input Layer Hidden Layer 0 Hidden Layer 1 Output w47 w57 w67
∑
i=4 6
wi7•xi
!
x7
neural network computing a single layer activation function f
x6 x5 x4 x7 x8 x9
= ([
f
w67 w57 w47 w68 w58 w48 w69 w59 w49
systolic array computing a single layer
x6 x5 x4 x7 x8 x9
= ([
f
w67 w57 w47 w68 w58 w48 w69 w59 w49
x6 x5 x4 x7 x8 x9
systolic array
w67 w68 w69 w57 w58 w59 w47 w49 w48
f
x6 x5 x4 x7 x8 x9
systolic array
w67 w68 w69 w57 w58 w59 w47 w49 w48
f
PU control PE
f
PE PE PE Storage
processing unit
1 - processing elements in DSP logic 2 - local storage for synaptic weights 3 - sigmoid unit implements non- linear activation functions 4 - vertically micro-coded sequencer
PU control PE
f
PE PE PE Storage PU control PE
f
PE PE PE Storage PU control PE
f
PE PE PE Storage PU control PE
f
PE PE PE Storage bus scheduler AXI Master
Introduction Programming model SNNAP design:
Evaluation & Comparison with HLS
CPU
$L1 $L2
PU PU PU PU
bus
scheduler
SEV WFE
DMA master
ACP
Interface requirements:
CPU
$L1 $L2
PU PU PU PU
bus
scheduler
SEV WFE
DMA master
ACP
coherent reads & writes with accelerator coherency port
Interface requirements:
CPU
$L1 $L2
PU PU PU PU
bus
scheduler
SEV WFE
DMA master
ACP
custom mastering interface coherent reads & writes with accelerator coherency port
Interface requirements:
CPU
$L1 $L2
PU PU PU PU
bus
scheduler
SEV WFE
DMA master
ACP
custom mastering interface coherent reads & writes with accelerator coherency port
low-latency event signaling, sleep & wakeup
Interface requirements:
Introduction Programming model SNNAP design:
Evaluation & Comparison with HLS
Neural acceleration on SNNAP (8x8 configuration, clocked at 1/4 of fCPU) vs. precise CPU execution
Neural acceleration on SNNAP (8x8 configuration, clocked at 1/4 of fCPU) vs. precise CPU execution
application domain error metric blackscholes
MSE fft DSP MSE inversek2j robotics MSE jmeint 3D-modeling miss rate jpeg compression image diff kmeans ML image diff sobel vision image diff
Whole Application Speedup 0.00 1.00 2.00 3.00 4.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
3.8 2.4 1.3 2.3 1.5 38.1 2.7 10.8
Factors:
Whole Application Speedup 0.00 1.00 2.00 3.00 4.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
3.8 2.4 1.3 2.3 1.5 38.1 2.7 10.8
Factors:
inversek2j kmeans Amdahl’s Speedup >100x 1.47x CPU cost 1660 cycles 29 cycles NN hidden layers 1 2
Energy Savings 0.00 1.00 2.00 3.00 4.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
2.8 1.8 .9 1.7 1.1 28.0 2.2 7.8
Energy = Power
(DRAM + SoC) * Runtime +36%
Neural Acceleration with SNNAP
which one should you use?
High Level Synthesis Compilers vs.
HLS
x x√
HLS
compiled down netlist
neural transform
SNNAP executes compiled down NN FPGA design
Resource-normalized throughput:
HLS
x x√
HLS
compiled down netlist
neural transform
SNNAP executes compiled down NN FPGA design
Normalized Throughput Improvement over HLS 0.10 1.00 10.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
1.6 .5 .2 43.7 7.9 1.3 .4 1.6
HLS is better Neural Acceleration is better
Normalized Throughput Improvement over HLS 0.10 1.00 10.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
1.6 .5 .2 43.7 7.9 1.3 .4 1.6
Neural Accel. HLS Precision Virtualization Performance Programmability
✅ ✅
Normalized Throughput Improvement over HLS 0.10 1.00 10.00 b s c h
e s f f t i n v e r s e k 2 j j m e i n t j p e g k m e a n s s
e l G E O M E A N
1.6 .5 .2 43.7 7.9 1.3 .4 1.6
Neural Accel. HLS Precision Virtualization Performance Programmability
✅ ✅ ✅ ~ ~
3.8x speedup & 2.8x energy savings
neural acceleration is a viable alternative to HLS SNNAP: apply approximate computing on programmable SoCs through neural acceleration
float foo (float a, float b) { … return r; }Mark Wyse Jacob Nelson Adrian Sampson
Hadi Esmaeilzadeh Luis Ceze Mark Oskin
http://sampa.cs.washington.edu/
Thierry Moreau: moreau@uw.edu