HNHacker News
TopNewBestAskShowJobs

elmarhaussmann

50 karma · joined February 23, 2018

submissionscomments
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Author here.

Yes, thanks for mentioning that! That's what the article is alluding to at the end. There's also something like a "cost-to-model" and that's influenced by how easy it is to make efficient use of the performance and how much tweaking it needs. It's also influenced by the framework you use... However, that's difficult to compare and almost impossible to measure.

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
For this benchmark, NVLink and gradient reduction isn't the bottleneck. The performance scales almost perfectly linearly from one GPU to four.
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Happy you like the post! The implementations we used are open source (we reference the specific revisions), so reproducing results is possible right now. We haven't thought about publishing our small scripts around that (there's not much to it), but it's a good idea. There's also work towards benchmarking suites like DAWNBench (https://dawn.cs.stanford.edu/benchmark/).

The illustrations are from an artist/designer we contract from time to time. I agree, his work is awesome!

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Indeed, that's also my experience. ImageNet is pretty huge (although 'it's the new MNIST') so that seems to help converging to very similar solutions and accuracies.

Tracking down bugs in convergence is really costly in these settings. We had a problem in pre-processing that took us quite a while to figure out...

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
In general, you try to keep the TPU/GPU busy 100%, so enough data needs to be readily accessible at any point in time. In this example, images needs to be read from disk, decoded, transformed (cropped, resized, normalized etc.) before they can be fed to the TPU. The transformations can be computationally intensive so they actually become a bottleneck.

In terms of how much compute power the TPU pre-processing needs I only have very rough numbers: I ran the same pre-processing while training ResNet-50 on a node with 4 GPUs and it was consistently utilizing >22 CPU cores (including all of the other CPU-tasks while training).

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Thanks for catching this!
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
All of the computation, including pre-processing, is offloaded to the TPU. The weak machine is really just idling. A bigger one will only cost money and have no measurable effect on the performance.
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
They don't require it but some of the ResNet-50 implementations can make use of it (e.g., the ones in the Docker containers on the Nvidia GPU Cloud). But even the ones without seem to scale to 4 GPUs pretty well. This may be a different story for 8 GPUs and larger/deeper networks, e.g., ResNet-152.
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Probably not the best phrasing in the post ("next to buying"). It's only comparing cloud pricing (since the TPUv2 is only available there). If you consider buying hardware the situation is different as you correctly point out.
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Yeah, pretty big coincidence. However, this may change with the next TensorFlow versions, which supposedly has further speed improvements for the TPUv2.

Note also, that the ~2% performance difference is only on one model (ResNet-50) and cannot be generalized to all workloads/all of deep learning (at least not without further proof).

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Happy to hear the benchmark is useful to you! We'd love to try different setups and further models/networks. On the other hand, such benchmarks are a LOT of effort (which we underestimated it initially), so we'll have to see.
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
So far only very few details are disclosed. Here are two presentations:

https://supercomputersfordl2017.github.io/Presentations/Imag... http://learningsys.org/nips17/assets/slides/dean-nips17.pdf

For the last version of the TPU, Google provided more detail, e.g., in this paper:

https://arxiv.org/pdf/1704.04760.pdf

Hopefully, Google will publish something similar for TPUv2, but I have no knowledge whether or when that might happen.

elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
On AWS this was using nvidia-docker with the TensorFlow Docker images. Probably, the AWS AMI Deep Learning gives very similar performance (with same versions of CUDA, TensorFlow etc.). There's only so much you can tweak if the GPU itself is the bottleneck...
elmarhaussmann··on Comparing Google’s TPUv2 against Nvidia’s V100 on ResNet-50
Hi, author here. The motivation for this article came out of the HN discussion on a previous post (https://news.ycombinator.com/item?id=16447096). There was a lot of valuable feedback - thanks for that.

Happy to answer questions!

elmarhaussmann··on Benchmarking Google’s new TPUv2
Thank you for your feedback! (author here)

Our intention is really to provide a sound comparison. I think we agree that these kinds of comparisons can be hard given the constraints (e.g., lack of available technical information on TPUv2 or public implementations of optimized models for certain architectures). As I stated elsewhere, we are collecting all of the feedback and will run additional experiments.

If you know of an implementation of a mixed-precision/fp16 model that you'd like to see results for, please let us know! I may also reach out directly to you for that if you don't mind.

elmarhaussmann··on Benchmarking Google’s new TPUv2
It was my understanding that the TensorFlow benchmarks do make use of TensorCores on the V100. We'll verify and update accordingly.
elmarhaussmann··on Benchmarking Google’s new TPUv2
I tested many different batch sizes for the LSTM, so I am pretty confident it's not the reason.
elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

Thanks for your feedback. As I noted above, we will report further results with larger batch sizes (and smaller ones for the TPU). The LSTM not converging is one of the experiences we wanted to share. We are working on solving this issue and will update the post accordingly. Our goal is really a fair and valuable comparison, which is not easy, so we value all of the feedback.

elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

These are only available on the Google Cloud right now. I don't think there are plans to sell them anytime soon.

elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

No, this is really only comparing the throughput on the devices. A thorough comparison should really focus on time to reach a certain quality - including all of the tricks available for a certain architecture.

elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

Note that the TPU supports larger batch sizes because it has more RAM. We tested multiple batch sizes for GPUs and reported the fastest one. We'll try increasing the batch sizes as far as possible and report. The overall comparison will likely not change by much - we saw speed increases of around 5% doubling the batch size from 64 to 128. (https://www.tensorflow.org/performance/benchmarks also reports numbers for batch sizes of 32 and 64 on the P100)

elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

Point well taken, we'll make sure to add a comparison to 4 and 8 GPUs. For now, a "Cloud TPU" (containing 8 cores) seems to be the smallest unit to allocate. The question of what exactly makes up a single device and how many to compare against each other is not easy to answer.

elmarhaussmann··on Benchmarking Google’s new TPUv2
Would you expect a big performance difference from using CUDA 9.1?
elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

Good point, I agree that the FP16 GPU results should be closer or grouped with the TPU results. We'll try to update accordingly.

elmarhaussmann··on Benchmarking Google’s new TPUv2
Author here.

Thanks for your feedback and your suggestions (and from everybody else)! We'll make sure to gather all of the valuable feedback and run additional experiments. Different batch sizes and a comparison against >1 GPUs is already planned (and partly executed).

elmarhaussmann··on Benchmarking Google’s new TPUv2
Where specified "fp16", the V100 benchmarks use the code from https://github.com/tensorflow/benchmarks/tree/master/scripts... with the flag --use_fp16=true which enables fp16 for some but not all Tensors.