深層å¦ç¿ã«ç¹åããããã»ããµãCloud TPU ã®è¨è¨
Google Cloud Japan Team
ãã®æ稿ã¯ç±³å½æé 8 æ 30 æ¥ã«æ稿ããããã®ï¼æ稿ã¯ãã¡ãï¼ã®æ訳ã§ãã
Posted by Google Cloud ãããããã¼ã¢ããã±ã¤ã ä½è¤ä¸æ²
Tensor Processing Unit (TPU) ã¯ãæ©æ¢°å¦ç¿ã®è¨ç®å¦çã®ããã« Google ãã¼ãããéçºããã«ã¹ã¿ã LSI ï¼ASICï¼ã§ããGoogle 翻訳ããã©ããæ¤ç´¢ããã㦠Gmail çã®ä¸»è¦ãª Google ãµã¼ãã¹ã®éç¨ãæ¯ããåºç¤æè¡ã§ããGoogle Cloud ã§ã¯ãæ©æ¢°å¦ç¿ãå©ç¨ããã¨ã³ã¸ãã¢ããã¼ã¿ãµã¤ã¨ã³ãã£ã¹ãã«åãã¦ããã® TPU ã®è½åãã¹ã±ã¼ã©ãã«ã§ä½¿ããããã¯ã©ã¦ããµã¼ãã¹ã¨ãã¦æä¾ãã  Cloud TPU ãæä¾ãã¦ãã¾ããä»å¹´ 6 æã«ãµã³ãã©ã³ã·ã¹ã³ã§éå¬ããã Google Next â18 ã§ã¯ãç¡åãã©ã¤ã¢ã«ãå«ããã¹ã¦ã®ã¦ã¼ã¶ã¼ã«åã㦠Cloud TPU v2 ã®ä¸è¬æä¾ï¼GAï¼ãéå§ãããã¾ãæ°ãã« Cloud TPU v3 ã®ã¢ã«ãã¡çãã¢ãã¦ã³ã¹ããã¾ããã
ãã® TPU ã«ã¤ãã¦ãå¤ãã®æ¹ãããCPU ã GPU ã¨ã¯ã©ãéãã®ãï¼ãã¨ãã質åãããã ãã¾ãããã㧠Google ã§ã¯ããã®çåã«å¿ãããã¬ã¼ã³ãã¼ã·ã§ã³ã¨ã¢ãã¡ã¼ã·ã§ã³ãæ²è¼ãããã¢ã³ã³ãã³ãï¼æ¥æ¬èªåå¹ä»ãï¼ãå ¬éãã¾ããã
ãã®è¨äºã§ã¯ããã®ã³ã³ãã³ããããã¤ã©ã¤ãé¨åãæç²ãã¦ç´¹ä»ãã¾ãã
ãã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®åã
CPUãGPUãããã³ TPU ã®æ¯è¼ãããåã«ãã¾ãæ©æ¢°å¦ç¿ã®ä¸ã§ãã¨ããããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã«ã©ã®ãããªè¨ç®ãå¿ è¦ã¨ããããè¦ã¦ã¿ã¾ããããä¾ã¨ãã¦ãææ¸ãæ°åç»åãèªèããç°¡åãªä¸å±¤ã®ãã¥ã¼ã©ã« ãããã¯ã¼ã¯ãèãã¦ã¿ã¾ãã
å ¥åãã¼ã¿ã¨ã㦠28 x 28 ã®ã¢ãã¯ãç»åãæ³å®ããã¨ãåè¨ 784 åã®å¤ã§ãã®ç»åã表ãã¾ããããã§ãæ°åã®ã8ããèªèãããã¥ã¼ãã³ã¯ãåã ã®å¤ã«å¯¾ãã¦ãã©ã¡ã¼ã¿å¤ï¼ä¸å³ã®èµ¤ãç·ï¼ãæãç®ãã¾ãã
ãã®ãã©ã¡ã¼ã¿ã¯ãå ¥åãã¼ã¿ã®ç¹å¾´ãæ½åºããç»åãã8ãã®åã«ã©ã®ç¨åº¦ä¼¼ã¦ãããã測ããã£ã«ã¿ã¼ã¨ãã¦åãã¾ãã以ä¸ã®ãããªåãã§ãã
ãã¥ã¼ã©ã« ãããã¯ã¼ã¯ã«ãããã¼ã¿åé¡ã¯ããããã£ã±ã«ã¯ä¸å³ã®ä»çµã¿ã§åãã¦ãã¾ããã¤ã¾ããå ¥åãã¼ã¿ã«å¯¾ãã¦åã ã®ãã©ã¡ã¼ã¿ãæãç®ï¼ä¸å³ã§åã«è²ãä»ããé¨åï¼ãããã®çµæã足ãç®ï¼å³å´ã§åã並ã¹ãé¨åï¼ãã¦ãã¾ãããã®çµæãããä¸çªå¤§ããªæ°å¤ãå¾ãããã°ãå ¥åãã¼ã¿ã¨ãã©ã¡ã¼ã¿ãæãããä¼¼ã¦ãããã¨ã表ãããããèªèçµæã¨ãªãã¾ãã
ãã®ããã«ããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã§ã¯å
¥åãã¼ã¿ã¨ãã©ã¡ã¼ã¿ã®éã§å¤§éã®æãç®ï¼ä¹ç®ï¼ã¨è¶³ãç®ï¼å ç®ï¼ãå¿
è¦ã¨ãªãã¾ãããã®ä¹ç®ã¨å ç®ã¯é常ãé«æ ¡ã大å¦ã§ç¿ãè¡åæ¼ç®ã¨ãã¦å®è¡ããã¾ããã¤ã¾ãããã®ä¹ç®ã¨å ç®ãããã«éããå°ãªãé»åã§å®è¡ã§ããããããã¥ã¼ã©ã« ãããã¯ã¼ã¯ããã«ã¯ãã£ã¼ãã©ã¼ãã³ã°éçºã®å¹çæ§ã大ããå·¦å³ãã¾ãã
CPU ã®åã
ã§ã¯ãã©ããããããããµã¼ãã¼ã¾ã§ããããã³ã³ãã¥ã¼ã¿ã®å¿èé¨ã¨ãã¦åºãç¨ãããã¦ãã CPU ã¯ããã®è¨ç®ãã©ã®ããã«æ±ã£ã¦ããã®ã§ãããããCPU ã¯ããã¤ãã³ ã¢ã¼ããã¯ãã£ã«åºã¥ãæ±ç¨ããã»ããµã§ããã¤ã¾ããã½ããã¦ã§ã¢ã¨ã¡ã¢ãªãå©ç¨ãã¦ä»¥ä¸ã®ããã«è¨ç®ãé²ãã¾ããCPU ã®æ大ã®ç¹å¾´ã¯ããã®æè»æ§ã«ããã¾ãããã¤ãã³ ã¢ã¼ããã¯ãã£ã®ãããã§ããããã種é¡ã®ã½ããã¦ã§ã¢ãèªã¿è¾¼ã¿ãä½ç¾ä¸ã¨ãã種é¡ã®ã¢ããªã±ã¼ã·ã§ã³ã«å¯¾å¿ã§ãã¾ããä¾ãã°ã¯ã¼ãããã»ããµã§ææ¸ãæ¸ãããããã±ãã ã¨ã³ã¸ã³ãå¶å¾¡ããããéè¡ã®å£åº§æ¯æ¿ãæ±ã£ããããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã§ç»åèªèãããã¨ãå¤ç¨®å¤æ§ãªç¨éã« CPU ã使ãã¾ãã
ããããã®æè»æ§ã®ããã«ãCPU èªä½ã¯ã次ã«ã©ã®ãããªè¨ç®ããã¹ããããåãã£ã¦ç¥ããã¨ãã§ãã¾ãããæ¯åãã½ããã¦ã§ã¢ããã®æ示ãåããå¿
è¦ãããã¾ãããã®ãã CPU ã¯ãåã
ã®è¨ç®ã®ãã¹ã¦ã«ããã¦ãè¨ç®çµæã CPU ä¸ã®ã¡ã¢ãªï¼ã¬ã¸ã¹ã¿ã L1 ãã£ãã·ã¥ï¼ã«ä¿åããªããã°ãªãã¾ããããã®ã¡ã¢ãªã®èªã¿æ¸ãã«ã¨ããªãå¶ç´ã¯ãã¤ãã³ ããã«ããã¯ã¨å¼ã°ãã¾ããä¾ãã°å¤§è¦æ¨¡ãªãã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®è¨ç®ã§ã¯ãå®è¡ãã¹ãä¹ç®ã¨å ç®ã®æé ã¯ããããã決ã¾ã£ã¦ãã¾ããããã§ããCPU ã® ALUï¼ä¹ç®å¨ã¨å ç®å¨ãåããæ¼ç®è£
ç½®ï¼ã¯ãåã
ã®è¨ç®ãã²ã¨ã¤ãã¤å®è¡ãããã®çµæãæ¯åã¡ã¢ãªã«ä¿åãã¾ããããã CPU ã«ããè¨ç®ã®ã¹ã«ã¼ããããå¶éããã¾ãå¤å¤§ãªé»åãæ¶è²»ãã¦ãã¾ãã
GPU ã®åã
CPU ããé«ãè¨ç®ã¹ã«ã¼ããããå¾ããããGPU ã¯ãæ°ååã® ALU ã使ããã¨ããã·ã³ãã«ãªè§£æ±ºçãæ¡ã£ã¦ãã¾ããç¾ä»£ã® GPU 㯠2,500ã5,000 åã® ALU ãã²ã¨ã¤ã®ããã»ããµã«æè¼ãã¦ãããæ°ååã®ä¹ç®ã¨å ç®ãåæã«å®è¡ã§ãã¾ãããã® GPU ã®ã¢ã¼ããã¯ãã£ã¯ããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®è¡åæ¼ç®ã®ãããªå¤§è¦æ¨¡ä¸¦åè¨ç®ã«ã´ã£ããé©ãã¦ãã¾ããå®éã«ããã£ã¼ãã©ã¼ãã³ã°ã®å¦ç¿ã GPU ã§è¡ãã¨ãCPU ã«æ¯ã¹ã¦æ¡éãã®æ§è½ãå¾ããã¾ãããã®ããããã£ã¼ãã©ã¼ãã³ã°ç¨éã§ã¯ä»ãã£ã¨ãããã¥ã©ã¼ãªè¨ç®ç°å¢ã¨ã㦠GPU ãå©ç¨ããã¦ãã¾ãã
ããããGPU ããã¯ããæ°ç¾ä¸ãã®ç°ãªãã¢ããªã±ã¼ã·ã§ã³ãã½ããã¦ã§ã¢ã«å¯¾å¿ããæ±ç¨ããã»ããµã¨ãã¦è¨è¨ããã¦ãã¾ãããã®ããããã¤ãã³ ããã«ããã¯ã®æ¬è³ªçãªå¶ç´ããã¯éãããã¾ãããGPU ã® ALU ãåã
ã®è¨ç®ãè¡ããã³ãã¬ã¸ã¹ã¿ãã·ã§ã¢ã¼ãã¡ã¢ãªãªã©ã®ã¡ã¢ãªã«è¨ç®çµæãä¿åããã¾ãèªã¿åºãç´ãå¿
è¦ãããã¾ããGPU ã¯æ°ååã® ALU ãåããããããã®ã¡ã¢ãªã®èªã¿æ¸ãã«ãã£ã¦çããé»åæ¶è²»ãããã«æ¯ä¾ãã¦å·¨å¤§ãªãã®ã¨ãªããã¾ãè¤éãªé
ç·ã®ããã«ãããé¢ç©ã®å¤ããå°æãã¾ãã
TPU ã®åã
Google ã TPU ãè¨è¨ããéãéçºãã¼ã ã¯ãã¡ã¤ã³ç¹åã¢ã¼ããã¯ãã£ãæ¡ç¨ãã¾ãããã¤ã¾ããCPU ã GPU ã®ãããªæ±ç¨ããã»ããµã§ã¯ãªãããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®è¨ç®ã«ç¹åããè¡åæ¼ç®å°ç¨ããã»ããµã¨ãã¦è¨è¨ãã¾ããããã®ãã TPU ã¯ãã¯ã¼ãããã»ããµããã±ããå¶å¾¡ãéè¡æ¯ãè¾¼ã¿ã¨ãã£ãç¨éã«ã¯ä½¿ãã¾ãããä¸æ¹ã§ããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã§å¿ è¦ã¨ãªã大è¦æ¨¡ãªä¹ç®ã¨å ç®ãå§åçãªã¹ãã¼ãã§ããªãã¤ã¤ãããå°ãªãæ¶è²»é»åã¨å°ãããããé¢ç©ã«æãããã¨ã«æåãã¦ãã¾ãããã®æåã®ã«ã®ã¯ããã¤ãã³ ããã«ããã¯ã®å¤§åã解æ¶ã§ãããã¨ã«ããã¾ããTPU ã®ããã¹ããã¨ã¯è¡åã®ä¹ç®ã¨å ç®ã ããªã®ã§ãTPU ã®è¨è¨è ã«ã¯å¿ è¦ãªãã¹ã¦ã®è¨ç®ã®æé ããããããåãã£ã¦ãã¾ããããã§ãæ°ååã®ä¹ç®å¨ã¨å ç®å¨ã大è¦æ¨¡ãªãããªã¯ã¹ç¶ã«ä¸¦ã¹ãããããé ç·ã«ãã£ã¦ç´æ¥çµãã§ãã¾ããããã¯ã·ã¹ããªã㯠ã¢ã¬ã¤ã¨å¼ã°ããã¢ã¼ããã¯ãã£ã§ããCloud TPU v2 ã®å ´åã1 ã¤ã®ããã»ããµã¯ 128 x 128 ã®ã·ã¹ããªã㯠ã¢ã¬ã¤ã 2 ã¤æè¼ããåè¨ã§ 32,768 åã® 16 ããã ALU ãéç´ãã¦ãã¾ãã
ãã®ã·ã¹ããªã㯠ã¢ã¬ã¤ããã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®è¨ç®ãã©ã®ããã«å®è¡ããã®ãè¦ã¦ã¿ã¾ããããã¾ããTPU ã¯ã¡ã¢ãªãããã©ã¡ã¼ã¿ãèªã¿è¾¼ã¿ãä¹ç®å¨ã¨å ç®å¨ã®ãããªãã¯ã¹ã«èªã¿è¾¼ã¿ã¾ãã
ã¤ã¥ãã¦ãTPU ã¯å ¥åãã¼ã¿ãã¡ã¢ãªããèªã¿è¾¼ã¿ã¾ããåã ã®ä¹ç®ãé²ãã«ã¤ãã¦ããã®çµæã¯é£ã®ä¹ç®å¨ã¸ã¨ãã±ããªã¬ã¼å¼ã«æ¸¡ãããåæã«å ç®ãè¡ããã¾ãããã®çµæããããªãã¯ã¹ããã¯ãã¹ã¦ã®ãã¼ã¿ã¨ãã©ã¡ã¼ã¿å士ã®ä¹ç®çµæãå ç®ããå¤ãåºã¦ãã¾ãããã®å¤§è¦æ¨¡ãªè¨ç®å¦çãé²ãéãã¡ã¢ãªã¸ã®èªã¿æ¸ãã¯ä¸åçºçãã¾ããã
ãã®è¨è¨ã«ãã£ã¦ãTPU ã§ã¯ãã¥ã¼ã©ã« ãããã¯ã¼ã¯ã®è¨ç®ã«ããã¦ãããã¦é«ãè¨ç®ã¹ã«ã¼ããããéæãã¤ã¤ãæ¶è²»é»åã¨ãããé¢ç©ãããæãããã¨ãå¯è½ã«ãªãã¾ããã
ã³ã¹ãã 1/5 ã«
ãã® TPU ã¢ã¼ããã¯ãã£ãããããã¡ãªããã¯ä½ã§ããããï¼ ãã®çãã¯ãã³ã¹ãã§ãã2018 å¹´ 8 ææç¹ã§ã® Cloud TPU v2 ã®ä¾¡æ ¼ã¯ä»¥ä¸ã®éãã§ããã¹ã¿ã³ãã©ã¼ã大å¦ãå ¬éãã DAWNBench ã§ã¯ããã£ã¼ãã©ã¼ãã³ã°ã®å¦ç¿ã¨æ¨è«ã対象ã¨ããå種ã®ãã³ããã¼ã¯çµæãæ²è¼ããã¦ãã¾ãããã¾ãã¾ãªç¨éãã¢ãã«ãè¨ç®ç°å¢ã®çµã¿åããã§ãããããã®å¦ç¿ãæ¨è«ã«è¦ããã³ã¹ããæéãçºè¡¨ããã¦ãã¾ãã
2018 å¹´ 4 æã« DAWNBench ã®ã³ã³ãã¹ããç· ãåãããæç¹ã§ãTPU 以å¤ã®ããã»ããµã«ããå¦ç¿ã³ã¹ãã®æä½é¡ã¯ $72.40 ã§ããï¼ResNet-50 ã ImageNet ãã¼ã¿ã»ããã¨ã¹ãããã¤ã³ã¹ã¿ã³ã¹ã§ 93% 精度ã¾ã§å¦ç¿ãããå ´åï¼ãä¸æ¹ãCloud TPU v2 ã® Preemptible ä¾¡æ ¼ãé©ç¨ããå ´åãåãå¦ç¿ä½æ¥ã $12.87 ã§çµãããã¨ãã§ãã¾ãããã㯠TPU ã使ããªãå ´åã® 1/5 ã§ãããã®å·®ãããããã¥ã¼ã©ã« ãããã¯ã¼ã¯åãã«ãã¡ã¤ã³ç¹åã¢ã¼ããã¯ãã£ã®ããã»ããµãéçºãããã¨ã§å¾ãããã¡ãªããã§ãã