Measure the latency of each memory tier on a T4
Colab T4 · freenotebook90 minrequiredGoal · A bar chart of measured cycles-per-access for registers, shared memory, L2-resident global memory and DRAM-resident global memory.
- 1On Colab, use %%writefile to create pchase.cu, a pointer-chasing kernel that follows a linked list of indices and reads clock64() before and after.
- 2Compile with !nvcc -arch=sm_75 -o pchase pchase.cu and run with array sizes 4 KB (L1), 1 MB (L2) and 256 MB (DRAM).
- 3Add a variant that chases through a __shared__ array and one that only does register arithmetic in a loop.
- 4Divide elapsed clocks by the number of accesses and plot one bar per tier.
- 5Compare with Table 3 of the Volta microbenchmarking paper and note which numbers moved for Turing.
- Deliverable
- Notebook with pchase.cu, the raw clock numbers and the bar chart.
- Check
- Shared memory is at least 10x faster per access than DRAM-resident global memory; the three global-memory sizes show clearly increasing latency.
- Fallback
- Run on Kaggle, or read the Volta paper tables and reproduce the chart from their numbers.