プリンキピア

第13章計算の性能

13.7.4. Key–Value Stores13.7.4 キー・バリューストア

Implementing the steps required for distributed multi-GPU training in practice is nontrivial. This is why it pays to use a common abstraction, namely that of a key–value store with redefined update semantics.
英語のヒント
分散した複数GPUでの訓練に必要な手順を実際に実装するのは自明ではない。だからこそ、共通の抽象化、つまり更新のセマンティクスを定義し直したキー・バリューストアの抽象化を使うことが割に合う。
Across many workers and many GPUs the computation for gradient i can be defined as
英語のヒント
多くのワーカーと多くのGPUにわたって、勾配iの計算は次のように定義できる。
𝐠i=∑k∈workers∑j∈GPUs𝐠ijk,(13.7.1)
where 𝐠ijk is part of gradient i split on GPU j of worker k. The key aspect in this operation is that it is a commutative reduction, that is, it turns many vectors into one and the order in which the operation is applied does not matter. This is great for our purposes since we do not (need to) have fine grained control over when which gradient is received. Besides, note that this operation is independent among different i.
英語のヒント
ここで𝐠ijkは、ワーカーkのGPU jに分けられた勾配iの一部である。この操作の重要な点は、それが可換な縮約であること、つまり多くのベクトルを一つに変え、操作を当てはめる順序が問題にならないことである。どの勾配をいつ受け取るかをきめ細かく制御しない(し、その必要もない)ので、これはここでの目的にはすばらしい。さらに、この操作は異なるiのあいだで独立であることに注意してほしい。
This allows us to define the following two operations: push, which accumulates gradients, and pull, which retrieves aggregate gradients. Since we have many different sets of gradients (after all, we have many layers), we need to index the gradients with a key i. This similarity to key–value stores, such as the one introduced in Dynamo (DeCandia et al., 2007) is not by coincidence. They, too, satisfy many similar characteristics, in particular when it comes to distributing the parameters across multiple servers.
英語のヒント
これにより、次の二つの操作を定義できる。勾配を累積するpushと、集約した勾配を取り出すpullである。勾配の組はたくさん(結局のところ層がたくさん)あるので、勾配にキーiで添字をつける必要がある。Dynamo(DeCandia et al., 2007)で導入されたもののようなキー・バリューストアとのこの類似は、偶然ではない。それらも、特に複数のサーバーにわたってパラメータを分散することについて、多くの似た特徴を満たす。
The push and pull operations for key-value stores are described as follows:
英語のヒント
キー・バリューストアのpushとpullの操作は、次のように説明される。
  • push(key, value) sends a particular gradient (the value) from a worker to a common storage. There the value is aggregated, e.g., by summing it up.
    英語のヒント
    push(key, value)は、特定の勾配(value)をワーカーから共通のストレージに送る。そこで、値はたとえば足し合わせることで集約される。
  • pull(key, value) retrieves an aggregate value from common storage, e.g., after combining the gradients from all workers.
    英語のヒント
    pull(key, value)は、たとえばすべてのワーカーからの勾配を組み合わせた後に、共通のストレージから集約した値を取り出す。
By hiding all the complexity about synchronization behind a simple push and pull operation we can decouple the concerns of statistical modelers who want to be able to express optimization in simple terms and the system engineers who need to deal with the complexity inherent in distributed synchronization.
英語のヒント
同期についての複雑さをすべて単純なpushとpullの操作の背後に隠すことで、最適化を簡単な言葉で表したい統計的なモデルを作る人の関心事と、分散した同期に本来備わる複雑さを扱う必要のあるシステムのエンジニアの関心事を切り離せる。