From 603d862830b6d2e2ea4f31da7465fc548b3381ff Mon Sep 17 00:00:00 2001 From: Erik Schultheis Date: Tue, 30 Apr 2024 23:52:08 +0300 Subject: [PATCH] fix up bandwidth calculation --- dev/cuda/gelu_forward.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/cuda/gelu_forward.cu b/dev/cuda/gelu_forward.cu index a8edf31..464f034 100644 --- a/dev/cuda/gelu_forward.cu +++ b/dev/cuda/gelu_forward.cu @@ -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);