GPU Peak FLOPS

Compute peak TFLOPS from SMs, units, FMAs per clock and clock speed, and convert datasheet sparse peaks to dense. A free ML coding interview task on NudgeCode: write it in Python and check it with tests in your browser. Easy · GPU, Hardware, FLOPS · from GPU Hardware and Architecture.

Implement three functions returning TFLOPS: fp32_peak_tflops(sms, fp32_units_per_sm, clock_ghz) (one FMA = 2 FLOPs per unit per clock), tensor_peak_tflops(tensor_cores, fma_per_core_per_clock, clock_ghz), and dense_tflops(listed_tflops, with_sparsity) (a 'with sparsity' figure is the 2:4 sparse peak, twice the dense one). Example: A100 FP32 ≈ 19.5, BF16 Tensor ≈ 312.