第13章計算の性能
13.4.9. Exercises13.4.9 練習問題
- Write C code to test whether there is any difference in speed between accessing memory aligned or misaligned relative to the external memory interface. Hint: be careful of caching effects.
英語のヒント
外部のメモリのインターフェースに対して、整列したメモリと整列していないメモリにアクセスするのに速さの違いがあるかどうかを試すCのコードを書け。ヒント:キャッシュの効果に気をつけよ。 - Test the difference in speed between accessing memory in sequence or with a given stride.
英語のヒント
メモリに順にアクセスする場合と、決まったストライドでアクセスする場合の速さの違いを試せ。 - How could you measure the cache sizes on a CPU?
英語のヒント
CPUのキャッシュの大きさは、どうすれば測れるか。 - How would you lay out data across multiple memory channels for maximum bandwidth? How would you lay it out if you had many small threads?
英語のヒント
最大の帯域を得るには、複数のメモリチャネルにわたってデータをどう配置するか。小さなスレッドがたくさんあったら、どう配置するか。 - An enterprise-class HDD is spinning at 10,000 rpm. What is the absolutely minimum time an HDD needs to spend worst case before it can read data (you can assume that heads move almost instantaneously)? Why are 2.5” HDDs becoming popular for commercial servers (relative to 3.5” and 5.25” drives)?
英語のヒント
企業向けのHDDが10,000 rpmで回転している。最悪の場合に、HDDがデータを読めるようになるまでに費やす必要のある、絶対的な最短時間はどれくらいか(ヘッドはほぼ瞬時に動くと仮定してよい)。商用のサーバーで、(3.5インチや5.25インチのドライブと比べて)2.5インチのHDDが人気になりつつあるのはなぜか。 - Assume that an HDD manufacturer increases the storage density from 1 Tbit per square inch to 5 Tbit per square inch. How much information can you store on a ring on a 2.5” HDD? Is there a difference between the inner and outer tracks?
英語のヒント
HDDのメーカーが記憶密度を1平方インチあたり1 Tbitから5 Tbitに上げたとする。2.5インチのHDDの一つのリングに、どれだけの情報を格納できるか。内側と外側のトラックで違いはあるか。 - Going from 8 bit to 16 bit data types increases the amount of silicon approximately by four times. Why? Why might NVIDIA have added INT4 operations to their Turing GPUs?
英語のヒント
8ビットから16ビットのデータ型に移ると、シリコンの量はおよそ4倍になる。それはなぜか。NVIDIAがTuring GPUにINT4の演算を加えたのはなぜだろうか。 - How much faster is it to read forward through memory vs. reading backwards? Does this number differ between different computers and CPU vendors? Why? Write C code and experiment with it.
英語のヒント
メモリを前向きに読むのは、後ろ向きに読むのと比べてどれくらい速いか。この数字は、コンピュータやCPUのベンダーによって違うか。それはなぜか。Cのコードを書いて実験せよ。 - Can you measure the cache size of your disk? What is it for a typical HDD? Do SSDs need a cache?
英語のヒント
ディスクのキャッシュの大きさを測れるか。典型的なHDDではどれくらいか。SSDにキャッシュは必要か。 - Measure the packet overhead when sending messages across the Ethernet. Look up the difference between UDP and TCP/IP connections.
英語のヒント
イーサネットを介してメッセージを送るときのパケットのオーバーヘッドを測れ。UDPとTCP/IPの接続の違いを調べよ。 - Direct memory access allows devices other than the CPU to write (and read) directly to (from) memory. Why is this a good idea?
英語のヒント
ダイレクトメモリアクセスを使うと、CPU以外の装置がメモリに直接書き込める(メモリから直接読める)。これはなぜよい考えなのか。 - Look at the performance numbers for the Turing T4 GPU. Why does the performance “only” double as you go from FP16 to INT8 and INT4?
英語のヒント
Turing T4 GPUの性能の数字を見よ。FP16からINT8とINT4に移ると、性能が「たった」2倍にしかならないのはなぜか。 - What is the shortest time it should take for a packet on a round trip between San Francisco and Amsterdam? Hint: you can assume that the distance is 10,000 km.
英語のヒント
サンフランシスコとアムステルダムのあいだを往復するパケットにかかるべき最短の時間はどれくらいか。ヒント:距離は10,000 kmと仮定してよい。