第13章計算の性能
13.4.8. Summary13.4.8 まとめ
- Devices have overheads for operations. Hence it is important to aim for a small number of large transfers rather than many small ones. This applies to RAM, SSDs, networks and GPUs.
英語のヒント
装置には演算のオーバーヘッドがある。したがって、小さな転送をたくさん行うより、大きな転送を少ない回数行うことを目指すのが重要である。これは、RAM、SSD、ネットワーク、GPUに当てはまる。 - Vectorization is key for performance. Make sure you are aware of the specific abilities of your accelerator. E.g., some Intel Xeon CPUs are particularly good for INT8 operations, NVIDIA Volta GPUs excel at FP16 matrix-matrix operations and NVIDIA Turing shines at FP16, INT8, and INT4 operations.
英語のヒント
ベクトル化は性能の鍵である。使うアクセラレータの具体的な能力を知っておくようにしよう。たとえば、一部のIntel Xeon CPUは特にINT8の演算が得意であり、NVIDIA Volta GPUはFP16の行列と行列の演算にすぐれ、NVIDIA TuringはFP16、INT8、INT4の演算で輝く。 - Numerical overflow due to small data types can be a problem during training (and to a lesser extent during inference).
英語のヒント
小さなデータ型による数値的なオーバーフローは、訓練のあいだ(そして程度は低いが推論のあいだ)問題になりうる。 - Aliasing can significantly degrade performance. For instance, memory alignment on 64 bit CPUs should be done with respect to 64 bit boundaries. On GPUs it is a good idea to keep convolution sizes aligned, e.g., to tensor cores.
英語のヒント
エイリアシングは性能を大きく下げうる。たとえば、64ビットのCPUでのメモリの整列は、64ビットの境界に合わせて行うべきである。GPUでは、畳み込みの大きさを、たとえばテンソルコアに合わせてそろえておくのがよい考えである。 - Match your algorithms to the hardware (e.g., memory footprint, and bandwidth). Great speedup (orders of magnitude) can be achieved when fitting the parameters into caches.
英語のヒント
アルゴリズムをハードウェア(たとえばメモリの使用量や帯域)に合わせよう。パラメータをキャッシュに収めると、(桁違いの)大きな高速化が達成できる。 - We recommend that you sketch out the performance of a novel algorithm on paper before verifying the experimental results. Discrepancies of an order-of-magnitude or more are reasons for concern.
英語のヒント
実験結果を確かめる前に、新しいアルゴリズムの性能を紙の上で見積もっておくことを勧める。1桁以上の食い違いは、懸念の理由になる。 - Use profilers to debug performance bottlenecks.
英語のヒント
プロファイラを使って、性能のボトルネックをデバッグしよう。 - Training and inference hardware have different sweet spots in terms of price and performance.
英語のヒント
訓練用と推論用のハードウェアは、価格と性能の点で、最適な点が異なる。