mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-27 20:25:09 -04:00
fix up bandwidth calculation
This commit is contained in:
parent
c3515cfe47
commit
603d862830
1 changed files with 1 additions and 1 deletions
|
|
@ -182,7 +182,7 @@ int main(int argc, const char **argv) {
|
|||
// napkin math: estimate the memory bandwidth achieved
|
||||
// for each (B,T,C) output element, we do 1 read and 1 write, 4 bytes each
|
||||
// and e.g. A100 40GB PCIe is advertised at 1,555GB/s
|
||||
long memory_ops = B * T * C * 2 * 4;
|
||||
long memory_ops = B * T * C * 2 * (int)sizeof(floatX);
|
||||
float memory_bandwidth = memory_ops / elapsed_time / 1e6;
|
||||
|
||||
printf("block_size %4d | time %.4f ms | bandwidth %.2f GB/s\n", block_size, elapsed_time, memory_bandwidth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue