arXiv(opens in a new tab)Computer ScienceApr 2017Cited by 5 papers on PaperVantage

Manuscript Offprint

arXiv:1704.04760

In-datacenter performance analysis of a tensor processing unit

Norman P. Jouppi, C. Young, Nishant Patil, David A. Patterson, Gaurav Agrawal, R. Bajwa, S. Bates, S. Bhatia, N. Boden, A. Borchers, R. Boyle, Pierre-luc Cantin, C. Chao, C. Clark, Jeremy Coriell, M. Daley, M. Dau, Jeffrey Dean, Ben Gelb, Taraneh Ghaemmaghami, Rajendra Gottipati, William Gulland, R. Hagmann, C. Ho, Doug Hogberg, John R. Hu, R. Hundt, Dan Hurt, Julian Ibarz, A. Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Daniel Killebrew, A. Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, D. Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, G. MacKean, A. Maggiore, Maire Mahony, Kieran Miller, R. Nagarajan, Ravi Narayanaswami, Ray Ni, K. Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, A. Phelps, Jonathan Ross, Matt Ross, Amir H. Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Boyu Tian, Horia Toma, E. Tuttle, V. Vasudevan, R. Walter, Walter Wang, Eric Wilcox, D. Yoon

Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre-luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Daniel Killebrew, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Matt Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon

Google, Inc., Mountain View, CA USA

Email: {jouppi,cliffy,nishantpatil,davidpatterson}@google.com

To appear at the 44th International Symposium on Computer Architecture (ISCA), Toronto, Canada, June 26, 2017.

Abstract

Many architects believe that major improvements in cost-energy-performance must now come from domain-specific hardware. This paper evaluates a custom ASIC—called a Tensor Processing Unit (TPU)—deployed in datacenters since 2015 that accelerates the inference phase of neural networks (NN). The heart of the TPU is a 65,536 8-bit MAC matrix multiply unit that offers a peak throughput of 92 TeraOps/second (TOPS) and a large (28 MiB) software-managed on-chip memory. The TPU's deterministic execution model is a better match to the 99th-percentile response-time requirement of our NN applications than are the time-varying optimizations of CPUs and GPUs (caches, out-of-order execution, multithreading, multiprocessing, prefetching, ...) that help average throughput more than guaranteed latency. The lack of such features helps explain why, despite having myriad MACs and a big memory, the TPU is relatively small and low power. We compare the TPU to a server-class Intel Haswell CPU and an Nvidia K80 GPU, which are contemporaries deployed in the same datacenters. Our workload, written in the high-level TensorFlow framework, uses production NN applications (MLPs, CNNs, and LSTMs) that represent 95% of our datacenters' NN inference demand. Despite low utilization for some applications, the TPU is on average about 15X - 30X faster than its contemporary GPU or CPU, with TOPS/Watt about 30X - 80X higher. Moreover, using the GPU's GDDR5 memory in the TPU would triple achieved TOPS and raise TOPS/Watt to nearly 70X the GPU and 200X the CPU.

Index terms–DNN, MLP, CNN, RNN, LSTM, neural network, domain-specific architecture, accelerator

1. Introduction to Neural Networks

The synergy between the large data sets in the cloud and the numerous computers that power it has enabled a renaissance in machine learning. In particular, deep neural networks (DNNs) have led to breakthroughs such as reducing word error rates in speech recognition by 30% over traditional approaches, which was the biggest gain in 20 years [Dea16]; cutting the error rate in an image recognition competition since 2011 from 26% to 3.5% [Kri12] [Sze15] [He16]; and beating a human champion at Go [Sil16]. Unlike some hardware targets, DNNs are applicable to a wide range of problems, so we can reuse a DNN-specific ASIC for solutions in speech, vision, language, translation, search ranking, and many more.

Neural networks (NN) target brain-like functionality and are based on a simple artificial neuron: a nonlinear function (such as max⁡(0,value)\max(0, \text{value})) of a weighted sum of the inputs. These artificial neurons are collected into layers, with the outputs of one layer becoming the inputs of the next one in the sequence. The “deep” part of DNN comes from going beyond a few layers, as the large data sets in the cloud allowed more accurate models to be built by using extra and larger layers to capture higher levels of patterns or concepts, and GPUs provided enough computing to develop them.

The two phases of NN are called training (or learning) and inference (or prediction), and they refer to development versus production. The developer chooses the number of layers and the type of NN, and training determines the weights. Virtually all training today is in floating point, which is one reason GPUs have been so popular. A step called quantization transforms floating-point numbers into narrow integers—often just 8 bits—which are usually good enough for inference. Eight-bit integer multiplies can be 6X less energy and 6X less area than IEEE 754 16-bit floating-point multiplies, and the advantage for integer addition is 13X in energy and 38X in area [Dal16].

Three kinds of NNs are popular today:

  1. Multi-Layer Perceptrons (MLP): Each new layer is a set of nonlinear functions of weighted sum of all outputs (fully connected) from a prior one, which reuses the weights.

  2. Convolutional Neural Networks (CNN): Each ensuing layer is a set of of nonlinear functions of weighted sums of spatially nearby subsets of outputs from the prior layer, which also reuses the weights.

  3. Recurrent Neural Networks (RNN): Each subsequent layer is a collection of nonlinear functions of weighted sums of outputs and the previous state. The most popular RNN is Long Short-Term Memory (LSTM). The art of the LSTM is in deciding what to forget and what to pass on as state to the next layer. The weights are reused across time steps.

Table 1 shows two examples of each of the three types of NNs—which represent 95%95\% of NN inference workload in our datacenters—that we use as benchmarks. Typically written in TensorFlow [Aba16], they are surprisingly short: just 100 to 1500 lines of code. Our benchmarks are small pieces of larger applications that run on the host server, which can be thousands to millions of lines of C++ code. The applications are typically user-facing, which leads to rigid response-time limits.

Each model needs between 5M and 100M weights (9th column of Table 1), which can take a lot of time and energy to access. To amortize the access costs, the same weights are reused across a batch of independent examples during inference or training, which improves performance.

This paper describes and measures the Tensor Processing Unit (TPU) and compares its performance and power for inference to its contemporary CPUs and GPUs. Here is a preview of the highlights:

  • Inference apps usually emphasize response-time over throughput since they are often user-facing.

  • Due to latency limits, the K80 GPU is underutilized for inference, and is just a little faster than a Haswell CPU.

  • Despite having a much smaller and lower power chip, the TPU has 25 times as many MACs and 3.5 times as much on-chip memory as the K80 GPU.

  • The TPU is about 15X - 30X faster at inference than the K80 GPU and the Haswell CPU.

  • Four of the six NN apps are memory-bandwidth limited on the TPU; if the TPU were revised to have the same memory system as the K80 GPU, it would be about 30X - 50X faster than the GPU and CPU.

  • The performance/Watt of the TPU is 30X - 80X that of contemporary products; the revised TPU with K80 memory would be 70X - 200X better.

  • While most architects have been accelerating CNNs, they represent just 5%5\% of our datacenter workload.

NameLOCLayersNonlinear functionWeightsTPU Ops / Weight ByteTPU Batch Size% of Deployed TPUs in July 2016
FCConvVectorPoolTotal
MLP010055ReLU20M20020061%
MLP1100044ReLU5M168168
LSTM01000243458sigmoid, tanh52M646429%
LSTM11500371956sigmoid, tanh34M9696
CNN010001616ReLU8M288885%
CNN110004721389ReLU100M175032

Table 1. Six NN applications (two per NN type) that represent 95%95\% of the TPU's workload. The columns are the NN name; the number of lines of code; the types and number of layers in the NN (FC is fully connected, Conv is convolution, Vector is self-explanatory, Pool is pooling, which does nonlinear downsizing on the TPU; and TPU application popularity in July 2016. One DNN is RankBrain [Cla15]; one LSTM is a subset of GNM Translate [Wu16]; one CNN is Inception; and the other CNN is DeepMind AlphaGo [Sill6][Jou15].

References (63)

  • TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems
  • Ineffectual-Neuron-Free Deep Neural Network Computing
  • Fathom: reference workloads for modern deep learning methods
  • Programmable Neurocomputing, in The Handbook of Brain Theory and Neural Networks: Second Edition, M. A. Arbib (Ed.), MIT Press, ISBN 0-262-01197-2, November 2002
  • Asanović, K., Beck, Johnson, J., Wawrzynek, J., Kingsbury, B. and Morgan, N., November 1998
  • The case for energy-proportional computing
  • Private communication
  • and Burger, D.C.D., 2016
  • Origami: A convolutional network accelerator
  • A dynamically configurable coprocessor for convolutional neural networks
  • Diannao: A small-footprint high-throughput accelerator for ubiquitous machine-learning
  • Dadiannao: A machine-learning supercomputer
  • Eyeriss: A Spatial Architecture for Energy-Efficient Dataflow for Convolutional Neural Networks
  • DianNao Family: Energy-Efficient Hardware Accelerators for Machine Learning, Research Highlight, Communications of the ACM, 59(11)
  • PRIME: A Novel Processing-In-Memory Architecture for Neural Network Computation in ReRAM-based Main Memory
  • Bloomberg Technology, www.bloomberg.com
  • High Performance Hardware for Machine Learning, Cadence ENN Summit
  • The tail at scale
  • ShiDianNao: shifting vision processing closer to the sensor
  • Cnp: An FPGA-based processor for convolutional networks
  • Neuflow: A runtime reconfigurable dataflow processor for vision
  • Deep Learning with Limited Numerical Precision
  • A VLSI architecture for high-performance, low-cost, on-chip learning
  • Learning both weights and connections for efficient neural networks
  • EIE: efficient inference engine on compressed deep neural network
  • Identity mappings in deep residual networks (opens arXiv in a new tab)
  • Computer architecture: a quantitative approach, 6th edition, Elsevier
  • The datacenter as a computer
  • Special-purpose digital hardware for neural networks: An architectural survey
  • Google supercharges machine learning tasks with TPU custom chip
  • If I could only design one circuit
  • Neurocube: A Programmable Digital Neuromorphic Architecture with High-Density 3D Memory
  • Imagenet classification with deep convolutional neural networks
  • Algorithms for VLSI processor arrays
  • Identifying shades of green: The SPECpower benchmarks
  • RedEye: Analog ConvNet Image Sensor Architecture for Continuous Mobile Vision
  • Pudiannao: A polyvalent machine learning accelerator
  • Cambricon: An instruction set architecture for neural networks
  • Tesla K80 GPU Accelerator
  • Tesla GPU Accelerators For Servers
  • Accelerating deep convolutional neural networks using specialized hardware
  • Toward accelerating deep learning at scale using specialized hardware in the datacenter
  • Latency lags bandwidth
  • Memory-centric accelerator design for convolutional neural networks
  • A reconfigurable fabric for accelerating large-scale datacenter services
  • Convolution engine: balancing efficiency & flexibility in specialized computing
  • Design of a 1st Generation Neurocomputer
  • Minerva: Enabling low-power, highly-accurate deep neural network accelerators
  • Neural Network Processor, Patent Application No. 62/164,931
  • Computing Convolutions Using a Neural Network Processor, , Patent Application No. 62/164,902
  • Prefetching Weights for a Neural Network Processor, Patent Application No. 62/164,981
  • Rotating Data for Neural Network Computations, Patent Application No. 62/164,908
  • Imagenet large scale visual recognition challenge
  • The user and business impact of server delays, additional bytes, and HTTP chunking in web search
  • ISAAC: A Convolutional Neural Network Accelerator with In-Situ Analog Arithmetic in Crossbars
  • Mastering the game of Go with deep neural networks and tree search
  • Decoupled access/execute computer architectures
  • Full-Chip Simulations, Keys to Success
  • Going deeper with convolutions
  • Vector Computation Unit in a Neural Network Processor, Patent Application No. 62/165,022
  • Roofline: an insightful visual performance model for multicore architectures
  • Batch Processing in a Neural Network Processor, Patent Application No. 62/165,020
  • Optimizing FPGA-based accelerator design for deep convolutional neural networks