第23章付録:深層学習のための道具
23.5.1. Selecting Servers23.5.1 サーバを選ぶ
There is typically no need to purchase high-end CPUs with many threads since much of the computation occurs on the GPUs. That said, due to the global interpreter lock (GIL) in Python single-thread performance of a CPU can matter in situations where we have 4–8 GPUs. All things equal this suggests that CPUs with a smaller number of cores but a higher clock frequency might be a more economical choice. For example, when choosing between a 6-core 4 GHz and an 8-core 3.5 GHz CPU, the former is much preferable, even though its aggregate speed is less. An important consideration is that GPUs use lots of power and thus dissipate lots of heat. This requires very good cooling and a large enough chassis to use the GPUs. Follow the guidelines below if possible:
英語のヒント
計算の多くはGPUで行われるので、ふつうは多くのスレッドをもつハイエンドのCPUを買う必要はない。とはいえ、Pythonのグローバルインタプリタロック(GIL)のため、GPUが4〜8基ある状況ではCPUのシングルスレッド性能が重要になりうる。ほかの条件が同じなら、これはコア数が少なくてもクロック周波数の高いCPUのほうが経済的な選択かもしれないことを示唆する。たとえば、6コア4 GHzのCPUと8コア3.5 GHzのCPUのどちらかを選ぶなら、合計の速度は低くても、前者のほうがずっと好ましい。重要な考慮事項は、GPUが多くの電力を使い、したがって多くの熱を放つことである。そのため、GPUを使うにはとてもよい冷却と十分に大きな筐体が必要になる。できれば、以下の指針に従おう。
- Power Supply. GPUs use significant amounts of power. Budget with up to 350W per device (check for the peak demand of the graphics card rather than typical demand, since efficient code can use lots of energy). If your power supply is not up to the demand you will find that your system becomes unstable.
英語のヒント
電源。GPUはかなりの電力を使う。1デバイスあたり最大350Wで見積もる(効率のよいコードは多くのエネルギーを使うことがあるので、典型的な需要ではなくグラフィックスカードのピークの需要を確認すること)。電源が需要に見合わなければ、システムが不安定になる。 - Chassis Size. GPUs are large and the auxiliary power connectors often need extra space. Also, large chassis are easier to cool.
英語のヒント
筐体の大きさ。GPUは大きく、補助電源のコネクタは追加の空間を必要とすることが多い。また、大きな筐体は冷却しやすい。 - GPU Cooling. If you have a large number of GPUs you might want to invest in water cooling. Also, aim for reference designs even if they have fewer fans, since they are thin enough to allow for air intake between the devices. If you buy a multi-fan GPU it might be too thick to get enough air when installing multiple GPUs and you will run into thermal throttling.
英語のヒント
GPUの冷却。GPUがたくさんあるなら、水冷に投資したいかもしれない。また、ファンが少なくてもリファレンスデザインを狙おう。デバイスの間から空気を取り込めるほど薄いからである。ファンが複数あるGPUを買うと、複数のGPUを取り付けたときに厚すぎて十分な空気を得られず、サーマルスロットリングに陥るかもしれない。 - PCIe Slots. Moving data to and from the GPU (and exchanging it between GPUs) requires lots of bandwidth. We recommend PCIe 3.0 slots with 16 lanes. If you mount multiple GPUs, be sure to carefully read the motherboard description to ensure that 16 bandwidth is still available when multiple GPUs are used at the same time and that you are getting PCIe 3.0 as opposed to PCIe 2.0 for the additional slots. Some motherboards downgrade to 8 or even 4 bandwidth with multiple GPUs installed. This is partly due to the number of PCIe lanes that the CPU offers.
英語のヒント
PCIeスロット。GPUとの間でデータを移動する(そしてGPU間でデータを交換する)には、多くの帯域幅が必要である。16レーンのPCIe 3.0スロットを勧める。複数のGPUを取り付けるなら、マザーボードの説明を注意深く読み、複数のGPUを同時に使うときにも16の帯域幅が使えることと、追加のスロットでPCIe 2.0ではなくPCIe 3.0が得られることを必ず確かめよう。マザーボードによっては、複数のGPUを取り付けると8や、さらには4の帯域幅に落ちるものもある。これは一つには、CPUが提供するPCIeレーンの数による。
In short, here are some recommendations for building a deep learning server:
英語のヒント
要するに、深層学習のサーバを組むためのいくつかの推奨は次のとおりである。
- Beginner. Buy a low end GPU with low power consumption (cheap gaming GPUs suitable for deep learning use 150–200W). If you are lucky your current computer supports it.
英語のヒント
初心者。消費電力の低いローエンドのGPUを買う(深層学習に適した安いゲーム用GPUは150〜200Wを使う)。運がよければ、今のコンピュータがそれをサポートしている。 - 1 GPU. A low-end CPU with 4 cores will be sufficient and most motherboards suffice. Aim for at least 32 GB DRAM and invest into an SSD for local data access. A power supply with 600W should be sufficient. Buy a GPU with lots of fans.
英語のヒント
GPU 1基。4コアのローエンドのCPUで十分で、たいていのマザーボードで足りる。少なくとも32 GBのDRAMを目指し、ローカルのデータアクセスのためにSSDに投資しよう。600Wの電源で十分なはずである。ファンの多いGPUを買う。 - 2 GPUs. A low-end CPU with 4-6 cores will suffice. Aim for 64 GB DRAM and invest into an SSD. You will need in the order of 1000W for two high-end GPUs. In terms of mainboards, make sure that they have two PCIe 3.0 x16 slots. If you can, get a mainboard that has two free spaces (60mm spacing) between the PCIe 3.0 x16 slots for extra air. In this case, buy two GPUs with lots of fans.
英語のヒント
GPU 2基。4〜6コアのローエンドのCPUで足りる。64 GBのDRAMを目指し、SSDに投資しよう。ハイエンドのGPUを2基使うには1000W程度が必要になる。メインボードについては、PCIe 3.0 x16スロットが二つあることを確かめよう。できれば、空気のためにPCIe 3.0 x16スロットの間に空きスペースが二つ分(60mm間隔)あるメインボードを手に入れよう。この場合、ファンの多いGPUを2基買う。 - 4 GPUs. Make sure that you buy a CPU with relatively fast single-thread speed (i.e., high clock frequency). You will probably need a CPU with a larger number of PCIe lanes, such as an AMD Threadripper. You will likely need relatively expensive mainboards to get 4 PCIe 3.0 x16 slots since they probably need a PLX to multiplex the PCIe lanes. Buy GPUs with reference design that are narrow and let air in between the GPUs. You need a 1600–2000W power supply and the outlet in your office might not support that. This server will probably run loud and hot. You do not want it under your desk. 128 GB of DRAM is recommended. Get an SSD (1–2 TB NVMe) for local storage and a bunch of hard disks in RAID configuration to store your data.
英語のヒント
GPU 4基。シングルスレッドの速度が比較的速い(つまりクロック周波数の高い)CPUを必ず買おう。AMD ThreadripperのようなPCIeレーンの数の多いCPUがおそらく必要になる。PCIeレーンを多重化するのにPLXがおそらく必要になるので、PCIe 3.0 x16スロットを四つ得るには比較的高価なメインボードが必要になりそうである。幅が狭く、GPUの間に空気を入れられるリファレンスデザインのGPUを買おう。1600〜2000Wの電源が必要で、オフィスのコンセントはそれをサポートしないかもしれない。このサーバはおそらくうるさく熱くなる。机の下には置きたくないだろう。128 GBのDRAMを勧める。ローカルのストレージにはSSD(1〜2 TBのNVMe)を、データの保存にはRAID構成の何台かのハードディスクを用意しよう。 - 8 GPUs. You need to buy a dedicated multi-GPU server chassis with multiple redundant power supplies (e.g., 2+1 for 1600W per power supply). This will require dual socket server CPUs, 256 GB ECC DRAM, a fast network card (10 GBE recommended), and you will need to check whether the servers support the physical form factor of the GPUs. Airflow and wiring placement differ significantly between consumer and server GPUs (e.g., RTX 2080 vs. Tesla V100). This means that you might not be able to install the consumer GPU in a server due to insufficient clearance for the power cable or lack of a suitable wiring harness (as one of the coauthors painfully discovered).
英語のヒント
GPU 8基。複数の冗長な電源(たとえば電源1台あたり1600Wで2+1構成)をもつ、複数GPU専用のサーバ筐体を買う必要がある。これには、デュアルソケットのサーバ用CPU、256 GBのECC DRAM、高速なネットワークカード(10 GBEを推奨)が必要になり、サーバがGPUの物理的なフォームファクタをサポートするかどうかを確かめる必要がある。エアフローと配線の配置は、コンシューマ向けとサーバ向けのGPU(たとえばRTX 2080とTesla V100)の間で大きく異なる。これは、電源ケーブルのための隙間が足りなかったり、適したワイヤーハーネスがなかったりするために、コンシューマ向けのGPUをサーバに取り付けられないかもしれないことを意味する(共著者の一人が痛い目にあって知ったように)。