Cs231n lecture 15 appendices

Appendix 1: **Algorithms for Efficient Inference** **

Appendix 1.1 ** **Deep Compression (aka, Pruning, Quantization, and Huffman Encoding)

Screenshot 2020-03-28 at 1.37.35 PM.png

Screenshot 2020-03-28 at 1.37.45 PM.png

Screenshot 2020-03-28 at 1.40.40 PM.png

Pruning + Weight Sharing (Trained Quantization)

Screenshot 2020-03-28 at 2.05.42 PM.png

Screenshot 2020-03-28 at 2.07.39 PM.png

Screenshot 2020-03-28 at 2.07.53 PM.png

Screenshot 2020-03-28 at 2.09.52 PM.png

Screenshot 2020-03-28 at 2.09.59 PM.png

Appendix 1.2: Results of Quantization on Accuracy

Screenshot 2020-03-28 at 2.24.12 PM.png

Appendix 1.3: Effects of Low Rank Approximations on Accuracy

Screenshot 2020-03-28 at 2.29.59 PM.png

For fully connected layers, the below paper proposes tobreak down one fully connected layer into lots of fully connected layers.

Screenshot 2020-03-28 at 2.32.06 PM.png

Appendix 1.4: Binary /Ternary Weights at Inference Slides

Screenshot 2020-03-28 at 2.36.09 PM.png

Screenshot 2020-03-28 at 2.36.16 PM.png

Screenshot 2020-03-28 at 2.36.25 PM.png

Appendix 1.5 Speedup from Winograd Convolutions

More details about the Winograd Convolution: https://www.youtube.com/watch?v=Xh2hBMUYKAE.

Screenshot 2020-03-28 at 2.46.01 PM.png** **

Screenshot 2020-03-28 at 2.42.47 PM.png

Appendix 2. Optimal Hardware for Efficient Inference** **

2.1 Google TPU

Screenshot 2020-03-28 at 2.56.55 PM.png

This is Google’s NN workload in 2017 - 61% is dedicated to running Multi-layer perceptrons (for ads). LSTM (for Google langauge services) are 29%.

Screenshot 2020-03-28 at 2.57.01 PM.png

Performacne Bottlenecks:

In the left (sloped) region, you are bottle-necked by memory intensity.

X axis is ratio between FLOPs and memory bandwith overhead (FLOPS/byte of memory, listed as TPU Opt/Weight Byte in above table)

Y axis is the actual attainable peak performance.

If you’re only doing small operations, you are bottlenecked by memory bandwith, not arithmetic speed. Most NN do not have full utilization!

Screenshot 2020-03-28 at 3.00.50 PM.png

Screenshot 2020-03-28 at 3.00.55 PM.png

CNNs saturate the peak performance of TPU, but MLP and LSTM only use ~10% of potential throughput, because you cannot batch for real-time use cases.

Screenshot 2020-03-28 at 3.01.01 PM.png

Screenshot 2020-03-28 at 3.03.37 PM.png

=> Intro to EIE.

Screenshot 2020-03-28 at 3.22.59 PM.pngScreenshot 2020-03-28 at 3.23.04 PM.png

** **

Appendix N: Misc

Where is time and energy consumed by large models? in the memory access

To make deep learning more efficient, we should design hardware that improves memory access efficiency.

Screenshot 2020-03-18 at 4.12.52 PM.png

About Hardware:

Screenshot 2020-03-18 at 4.13.17 PM.png

Screenshot 2020-03-18 at 4.14.06 PM.png

Screenshot 2020-03-28 at 2.18.33 PM.png

Takeaway: use small representations for your numbers!

About SqeezeNet:

Han et al put out SqueezeNet. They used 1) Squeeze (1x1 conv) layers to reduce feature depth before convolution branches, 2) no fully connected layers. Everything is fully convolutional and the last layer is global average pooling. SqueezeNet is 50x smaller than AlexNet in its basic form and 510x smaller than AlexNet in compressed form.** **Model inference is ~3x faster on CPU and GPU.