測試 TPUv2 的 C/P 值

有人用相同演算法實際測試 Google 的 TPUv2 與 NVIDIATesla P100 的 C/P 值了:「Benchmarking Google’s new TPUv2」。

如果以 ResNet-50 當作計算的演算法,可以看到其實 C/P 值的差距沒有想像中大。主要原因是 GPU 可以使用較低的精度計算以加快速度,而非 Google 之前新聞稿故意使用較高精度比較 (TPU 使用 8-bit matrix engine,所以 GPU 使用較低的 fp16 版本比較會比較有參考價值):

真正的差異是在 LSTM

It turns out that the TPU is even faster on the LSTM model (21402 examples/s): ~12.9 times faster than a P100 (1658 examples/s) and ~7.7 times faster than a V100 (2778 examples/s)!

不過這邊就沒特別提到精度了...

Bitmain 推出 AI chip

BitmainBitcoin ASIC 市場上算是很有名的,就利用作 ASIC 的經驗推出自己的 AI chip 了:「Bitcoin’s Biggest Tech Player to Release AI Chips and Computers」。

這樣除了可以在雲端上租用 Google Cloud PlatformCloud TPU 以外,也可以自己買硬體來算了 (雖然軟體的支援應該還要再等):「Tensor Computing Processor BM1680」。

AlphaGo Zero 的計算量

AlphaGo Zero 論文裡有提到,用同樣的硬體 (4 TPU) 可以用 89:11 碾壓 AlphaGo Master (今年年初與柯潔下的那個版本),主要是得力於更高品質的 neural network 以及更強的選擇能力 (後面這塊應該是將兩個 nerual network 簡化為一後的好處):

This neural network improves the strength of the tree search, resulting in higher quality move selection and stronger self-play in the next iteration.

那麼對應的問題就會冒出來了,究竟 DeepMind 花了多少時間才能訓練出這個新的 nerual network?結果吳毅成教授在 Facebook 上先估算出來了:

這邊的 TPU 對 GPU 的推估應該是基於當時 Google 在說明 TPU 的部份「An in-depth look at Google’s first Tensor Processing Unit (TPU)」:

In short, we found that the TPU delivered 15–30X higher performance and 30–80X higher performance-per-watt than contemporary CPUs and GPUs.

用 GPU 大約是 12K 顆,反推回 TPU 大約也是千顆這個數量左右。而這個數量以目前已經將 TPU 商用化的 Google 來看應該是很輕鬆,只能說有錢真好 XD:

1. 從另外一個角度看, DeepMind 僅40天就可以把 40-block 版本練起來, 換算一下, DeepMind 等於用了約12000顆 1080 Ti.

AlphaGo 不是使用 GPU 加速...

Google 今天公佈的資料中說明了 AlphaGo 不是用一般常見的 GPU 加速運算:「Google supercharges machine learning tasks with TPU custom chip」。

這是特別為 TensorFlow 製作的 ASIC:

The result is called a Tensor Processing Unit (TPU), a custom ASIC we built specifically for machine learning — and tailored for TensorFlow.

而 AlphaGo 用的版本是 TPU 版:

AlphaGo was powered by TPUs in the matches against Go world champion, Lee Sedol, enabling it to "think" much faster and look farther ahead between moves.

放 AlphaGo 的機櫃長這樣:

通常 ASIC 特製的版本會比 FPGA 或是 GPU 快上許多,這代表目前這些沒有大公司撐腰的圍棋軟體要跟 AlphaGo 拼,除非演算法上有重大的突破,不然就得用更大量的設備跟他換...