プリンキピア

第13章計算の性能

13.4.1. Computers13.4.1 コンピュータ

Most deep learning researchers and practitioners have access to a computer with a fair amount of memory, computation, some form of an accelerator such as a GPU, or multiples thereof. A computer consists of the following key components:
英語のヒント
ほとんどの深層学習の研究者と実務家は、かなりの量のメモリと計算能力、GPUのような何らかの形のアクセラレータ、あるいはその複数をもつコンピュータを使える。コンピュータは、次の主な構成要素からなる。
  • A processor (also referred to as a CPU) that is able to execute the programs we give it (in addition to running an operating system and many other things), typically consisting of 8 or more cores.
    英語のヒント
    与えたプログラムを(オペレーティングシステムやそのほか多くのものを動かすことに加えて)実行できるプロセッサ(CPUとも呼ばれる)。ふつうは八つ以上のコアからなる。
  • Memory (RAM) to store and retrieve the results from computation, such as weight vectors and activations, and training data.
    英語のヒント
    重みベクトルや活性化のような計算の結果と、訓練データを格納し取り出すためのメモリ(RAM)。
  • An Ethernet network connection (sometimes multiple) with speeds ranging from 1 GB/s to 100 GB/s. On high end servers more advanced interconnects can be found.
    英語のヒント
    1 GB/sから100 GB/sまでの速さのイーサネットのネットワーク接続(複数のこともある)。高性能なサーバーには、もっと高度な相互接続がある。
  • A high speed expansion bus (PCIe) to connect the system to one or more GPUs. Servers have up to 8 accelerators, often connected in an advanced topology, while desktop systems have 1 or 2, depending on the budget of the user and the size of the power supply.
    英語のヒント
    システムを一つ以上のGPUにつなぐ高速な拡張バス(PCIe)。サーバーには最大8個のアクセラレータがあり、しばしば高度なトポロジーで接続されている。一方、デスクトップのシステムには、ユーザーの予算と電源の大きさによって、1個か2個ある。
  • Durable storage, such as a magnetic hard disk drive, a solid state drive, in many cases connected using the PCIe bus. It provides efficient transfer of training data to the system and storage of intermediate checkpoints as needed.
    英語のヒント
    磁気ハードディスクドライブやソリッドステートドライブのような永続的なストレージ。多くの場合、PCIeバスを使って接続される。それは、システムへの訓練データの効率的な転送と、必要に応じた途中のチェックポイントの格納を可能にする。
Fig. 13.4.2図13.4.2
Connectivity of components of a computer.
英語のヒント
コンピュータの構成要素の接続。
As Fig. 13.4.2 indicates, most components (network, GPU, and storage) are connected to the CPU across the PCIe bus. It consists of multiple lanes that are directly attached to the CPU. For instance AMD’s Threadripper 3 has 64 PCIe 4.0 lanes, each of which is capable 16 Gbit/s data transfer in both directions. The memory is directly attached to the CPU with a total bandwidth of up to 100 GB/s.
英語のヒント
図13.4.2が示すように、ほとんどの構成要素(ネットワーク、GPU、ストレージ)は、PCIeバスを介してCPUに接続されている。それは、CPUに直接つながる複数のレーンからなる。たとえば、AMDのThreadripper 3には64本のPCIe 4.0のレーンがあり、それぞれが両方向に16 Gbit/sのデータ転送ができる。メモリは、最大100 GB/sの合計帯域で、CPUに直接つながっている。
When we run code on a computer we need to shuffle data to the processors (CPUs or GPUs), perform computation, and then move the results off the processor back to RAM and durable storage. Hence, in order to get good performance we need to make sure that this works seamlessly without any one of the systems becoming a major bottleneck. For instance, if we cannot load images quickly enough the processor will not have any work to do. Likewise, if we cannot move matrices quickly enough to the CPU (or GPU), its processing elements will starve. Finally, if we want to synchronize multiple computers across the network, the latter should not slow down computation. One option is to interleave communication and computation. Let’s have a look at the various components in more detail.
英語のヒント
コンピュータでコードを動かすとき、データをプロセッサ(CPUやGPU)に移し、計算を行い、それから結果をプロセッサからRAMと永続的なストレージに戻す必要がある。したがって、よい性能を得るには、どのシステムも大きなボトルネックにならずに、これが滑らかに動くようにする必要がある。たとえば、画像を十分速く読み込めなければ、プロセッサにはする仕事がなくなる。同じように、行列を十分速くCPU(あるいはGPU)に移せなければ、その処理要素は飢える。最後に、ネットワークを介して複数のコンピュータを同期させたいなら、ネットワークが計算を遅くしてはならない。一つの選択肢は、通信と計算を交互に組み合わせることである。さまざまな構成要素をもっと詳しく見てみよう。