Why Three Minutes of Voice Search Pushed Google to Build Its First TPU
Three minutes of talking hardly sounds like a threat to Google’s budget. Then its engineers tried multiplying those three minutes by all the people who might use voice search in a day.
Google wanted phones to get better at speech recognition, the job of turning speech into written words. The software could do it. The trouble started when the engineers counted the chips they’d need. According to Google chip designer Norm Jouppi, three minutes of voice search a day per user could have meant twice as many data centers, the buildings full of computers that handled those requests. That was the forecast on the chips Google had at the time.
The engineers could still change what went inside the buildings. They designed a tensor processing unit, or TPU, a chip for the math their software kept repeating.
What did the phone hear?
Try saying “set a timer” while the kitchen fan is running. To pick the words out of that sound, the speech software measures little slices of audio. It uses a model, a program that has learned patterns by practicing on recordings with known words. That practice is called training. Now the model can use those patterns to guess which words came through the racket in your kitchen.
Much of the work comes down to multiplying numbers and adding up the results. Line up some of those numbers in rows and columns and you have a matrix. The same math crops up in other jobs, from labeling pictures to translating a sentence. A chip that handled it well could earn its keep long after somebody turned off the kitchen fan.
Google could buy graphics processing units, or GPUs, from the chip designer Nvidia. GPUs were built to draw pictures on screens. They can do many calculations at once, a talent that also comes in handy for multiplying grids of numbers. Google also knew how much of this particular math its own computers did. It could work out which sums it would be paying to do for years.
How the first TPU moved the numbers
The “tensor” in TPU is a group of numbers arranged in a particular shape. A row of numbers is one kind of tensor. A matrix is another. The part of the first TPU that multiplied matrices had a grid of its own, 256 little math units wide and 256 tall. Google’s engineers showed how a number could travel to the next unit while another calculation got under way.
Think of the work it takes to set a table for a crowd. You can walk back to the cupboard for every plate. Or a few people can stand along the table and pass plates down the line. Each trip is short, and several plates can move together. Inside the TPU, keeping the numbers close to the units doing the math saved time and electricity.
Follow the Numbers Through a TPU
Google put its first TPUs to work in 2015. They specialized in inference, the part where a trained model hears a new recording and makes a guess. The engineers ran a benchmark, a test using six programs Google already used. They compared their TPU with an Intel chip built for general use and one of Nvidia’s GPUs. Each program had a deadline for its answer. A lovely average is small comfort when it’s your timer that takes forever to set. On those six jobs, the TPU ran about 15 to 30 times as fast on average as the other two chips.
When does it pay to build your own?
A company with different jobs would need its own numbers. Designing a chip brings bills of its own. Engineers have to test it, and software teams have to make their models run on it. A chip built around today’s math can struggle if tomorrow’s software needs different sums. Buying GPUs leaves more of the chip-design costs with Nvidia.
- Chapter 7 takes apart Google’s first TPU on paper, down to the grid that does the math.
- This is a college textbook for readers who want to work through the numbers behind the design.
Google could spread the cost across products and years. It also got to choose what the next version should do. In 2023, it introduced Gemini, its family of AI models that can work with text and pictures. By then it was using later TPUs called v4 and v5e to train the models themselves.
That first voice-search estimate put a price on millions of people taking just a few minutes to ask about the weather or set a kitchen timer. At that scale, it was worth designing the thing that listened.
GPU, TPU, or LPU? Why Nvidia Bet Billions on a Rival’s Chip
Can Substrate Beat ASML With a Chipmaking Idea the Industry Shelved?
QUOTE:
"Amateurs hack systems, professionals hack people."
