Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Last active July 9, 2026 20:25
Show Gist options
  • Select an option

  • Save Hermann-SW/c58d77d3dca86fe56b547a01009a624f to your computer and use it in GitHub Desktop.

Select an option

Save Hermann-SW/c58d77d3dca86fe56b547a01009a624f to your computer and use it in GitHub Desktop.
gemini double sqrt benchmark demonstrating 383.6 double sqrt GFLOPS on Radeon vii GPU
New version for AMD&NVIDIA GPUs:
https://github.com/Hermann-SW/RR/tree/main/tsp/hip
@Hermann-SW

Hermann-SW commented Jun 4, 2026 •

Copy link
Copy Markdown
Author

4× longer runtime of benchmark made reported Gsqrt/s values reliable.
No need to use rocprofv2 to determine real measurement:

hermann@7600x:~$ ./benchmark_sqrt 3
Device ID 3 (AMD Instinct MI50/MI60) UUID: GPU-13c24061732c730c
Number of CUs/SMs: 60
Allocating 6103 MB of VRAM...
Launching Kernel across 1666667 thread blocks...
--------------------------------------------------------
Execution Completed Successfully.
Execution Time: 0.00916043 seconds
Total Sqrt Operations: 4e+09
Verification Check (Last Element): 3.51286
436.661 double Gsqrt/s 
hermann@7600x:~$ 

History:

hipcc -O3 --amdgpu-target=gfx906 benchmark_sqrt.cpp -o benchmark_sqrt

Reported value is too low ...

$ rocprofv2 -i counters.txt ./benchmark_sqrt
Allocating 1525 MB of VRAM...
ROCProfilerV2: Collecting the following counters:
- L2CacheHit
- VALUUtilization
Enabling Counter Collection
Launching Kernel across 390625 thread blocks...
--------------------------------------------------------
Execution Completed Successfully.
Execution Time: 0.00392576 seconds
Total Sqrt Operations: 1e+09
Verification Check (Last Element): 3.51285
254.728 Genuine double sqrt GFLOPS
Dispatch_ID(0), GPU_ID(1), Queue_ID(1), Process_ID(6192), Thread_ID(6192), Grid_Size(100000000), Workgroup_Size(256), LDS_Per_Workgroup(0), Scratch_Per_Workitem(0), Arch_VGPR(8), Accum_VGPR(0), SGPR(16), Wave_Size(64), Kernel_Name("genuine_sqrt_kernel(double const*, double*, int) (.kd)"), Begin_Timestamp(9883533233069), End_Timestamp(9883535839951), Correlation_ID(0), L2CacheHit(0.000735), VALUUtilization(100.000000)
$

... the profiler timestamps reveal only 9883535839951-9883533233069 = 2606882ns = 0.002606882s elapsed.
With that 383 double sqrt GFLOPS:

1000000000/(9883535839951-9883533233069) = 383.60002485728161075184

Wow:

VALUUtilization(100.000000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment