第6章構築者のための手引き
6.7.5. Exercises6.7.5 練習問題
- Try a larger computation task, such as the multiplication of large matrices, and see the difference in speed between the CPU and GPU. What about a task with a small number of calculations?
英語のヒント
大きな行列の掛け算のような、もっと大きな計算の課題を試し、CPUとGPUの速さの違いを見よ。計算の回数が少ない課題ではどうか。 - How should we read and write model parameters on the GPU?
英語のヒント
GPU上のモデルのパラメータは、どう読み書きすべきか。 - Measure the time it takes to compute 1000 matrix–matrix multiplications of matrices and log the Frobenius norm of the output matrix one result at a time. Compare it with keeping a log on the GPU and transferring only the final result.
英語のヒント
の行列どうしの掛け算を1000回計算するのにかかる時間を測り、出力行列のフロベニウスノルムを一度に一つの結果ずつ記録せよ。それを、記録をGPU上に保持して最後の結果だけを転送する場合と比べよ。 - Measure how much time it takes to perform two matrix–matrix multiplications on two GPUs at the same time. Compare it with computing in in sequence on one GPU. Hint: you should see almost linear scaling.
英語のヒント
二つのGPU上で二つの行列どうしの掛け算を同時に行うのに、どれだけ時間がかかるかを測れ。それを、一つのGPU上で順に計算する場合と比べよ。ヒント:ほぼ線形のスケーリングが見られるはずである。