Skip to content

Performance: Diracs on a Grid ​

The two paths of Diracs on a Grid: the dedicated solver, and the same diracs given as a cloud ( a SumOfDiracs ), which is what a solve on positions does.

One problem, at every size: N x N diracs of equal masses on the unit square, against an image of 512 x 512 affine pixels ( Image( degree = 1 ) ), a field of sines with an offset, 1 + 0.5 sin( 6 pi x ) sin( 4 pi y ). Whole solves from a cold start, stopped on max |mass - target| / target <= 1e-6; the CPU on all its cores ( 2 x 64 AMD EPYC 7763 ), the cards an RTX 2080 Ti and an H100.

dedicated, EPYC 7763, 128 coresdedicated, RTX 2080 Tidedicated, H100generic, EPYC 7763, 128 coresgeneric, RTX 2080 Tigeneric, H100
Diracs on a grid100 ms1 s10 s1e41e51e61e7diracs ( N x N )dedicated, RTX 2080 Ti, n = 4e3: 39.5 ms at 1.86 GHzdedicated, RTX 2080 Ti, n = 2e4: 41.2 ms at 1.86 GHzdedicated, RTX 2080 Ti, n = 7e4: 49.4 ms at 1.86 GHzdedicated, RTX 2080 Ti, n = 3e5: 63.9 ms at 1.86 GHzdedicated, RTX 2080 Ti, n = 1e6: 118 ms at 1.86 GHzdedicated, RTX 2080 Ti, n = 4e6: 348 ms at 1.86 GHzdedicated, H100, n = 4e3: 26.6 ms at 1.98 GHzdedicated, H100, n = 2e4: 27.5 ms at 1.98 GHzdedicated, H100, n = 7e4: 28 ms at 1.98 GHzdedicated, H100, n = 3e5: 31.2 ms at 1.98 GHzdedicated, H100, n = 1e6: 41.4 ms at 1.98 GHzdedicated, H100, n = 4e6: 71.5 ms at 1.98 GHzdedicated, 128 threads, n = 4e3: 49.3 ms at 2.48 GHzdedicated, 128 threads, n = 2e4: 79.2 ms at 2.48 GHzdedicated, 128 threads, n = 7e4: 194 ms at 2.48 GHzdedicated, 128 threads, n = 3e5: 261 ms at 2.48 GHzdedicated, 128 threads, n = 1e6: 431 ms at 2.48 GHzdedicated, 128 threads, n = 4e6: 962 ms at 2.48 GHzdedicated, 128 threads, n = 2e7: 3.24 s at 2.48 GHzgeneric, RTX 2080 Ti, n = 4e3: 90.9 ms at 1.86 GHzgeneric, RTX 2080 Ti, n = 2e4: 113 ms at 1.86 GHzgeneric, RTX 2080 Ti, n = 7e4: 147 ms at 1.86 GHzgeneric, RTX 2080 Ti, n = 3e5: 321 ms at 1.86 GHzgeneric, RTX 2080 Ti, n = 1e6: 989 ms at 1.86 GHzgeneric, RTX 2080 Ti, n = 4e6: 4.04 s at 1.86 GHzgeneric, H100, n = 4e3: 79.6 ms at 1.98 GHzgeneric, H100, n = 2e4: 84.6 ms at 1.98 GHzgeneric, H100, n = 7e4: 102 ms at 1.98 GHzgeneric, H100, n = 3e5: 196 ms at 1.98 GHzgeneric, H100, n = 1e6: 510 ms at 1.98 GHzgeneric, H100, n = 4e6: 2.14 s at 1.98 GHzgeneric, 128 threads, n = 4e3: 155 ms at 2.48 GHzgeneric, 128 threads, n = 2e4: 171 ms at 2.48 GHzgeneric, 128 threads, n = 7e4: 303 ms at 2.48 GHzgeneric, 128 threads, n = 3e5: 846 ms at 2.48 GHzgeneric, 128 threads, n = 1e6: 2.34 s at 2.48 GHzgeneric, 128 threads, n = 4e6: 9.62 s at 2.48 GHzgeneric, 128 threads, n = 2e7: 54.4 s at 2.48 GHz

Total time for a solve against an image of 512 x 512 affine pixels: a slope of one decade per decade is linear. Log-log; hover a point for its time.

dedicatedgeneric
all the coresRTX 2080 Ti / H100all the coresRTX 2080 Ti / H100
64 x 640.0493 s ( 4 )0.0395 s ( 4 ) / 0.0266 s ( 4 )0.155 s ( 5 )0.0909 s ( 4 ) / 0.0796 s ( 4 )
128 x 1280.0792 s ( 5 )0.0412 s ( 5 ) / 0.0275 s ( 5 )0.171 s ( 5 )0.113 s ( 4 ) / 0.0846 s ( 4 )
256 x 2560.194 s ( 7 )0.0494 s ( 7 ) / 0.0280 s ( 7 )0.303 s ( 5 )0.147 s ( 4 ) / 0.102 s ( 4 )
512 x 5120.261 s ( 7 )0.0639 s ( 7 ) / 0.0312 s ( 7 )0.846 s ( 5 )0.321 s ( 4 ) / 0.196 s ( 4 )
1024 x 10240.431 s ( 7 )0.118 s ( 7 ) / 0.0414 s ( 7 )2.34 s ( 5 )0.989 s ( 4 ) / 0.510 s ( 4 )
2048 x 20480.962 s ( 8 )0.348 s ( 8 ) / 0.0715 s ( 8 )9.62 s ( 5 )4.04 s ( 4 ) / 2.14 s ( 4 )
4096 x 40963.24 s ( 8 )– / –54.4 s ( 5 )– / –

Seconds, a whole solve from a cold start to `max |mass - target| / target <= 1e-6`: N x N diracs of equal masses against an image of 512 x 512 affine pixels. dedicated: the grid's own Newton; generic: the same diracs as a cloud. In brackets: Newton iterations.

The gap grows with N. On the CPU: 3× at 512 x 512, 10× at 2048 x 2048, 17× at 4096 x 4096 ( 3.2 s against 54 s on the 128 cores ). On the 2080 Ti: 5× at 512 x 512, 12× at 2048 x 2048 ( 0.35 s against 4.0 s ); on the H100, 30× at 2048 x 2048 ( 0.072 s against 2.1 s ). Past a million diracs, a dirac costs the dedicated solver about 200 ns on the CPU, 83 ns on the 2080 Ti and 17 ns on the H100; the generic one more than 2 µs on the CPU, 0.5 to 1 µs on the cards. Below 256 x 256, fixed costs dominate ( 0.03 to 0.15 s ).

The dedicated solver computes in doubles, on the CPU and on the card. The generic one computes in doubles on the CPU, and on the card in floats first, then in doubles ( precision = "auto" ). Floats alone do not reach the tolerance: at 512 x 512 the generic solve stalls near 1e-3, the cells too small for the digits of a float.

The numbers on this page come from bench/bench_grid.py ( jobs grid and gpu_grid of bench/page.py ). The machines and the protocol of the other benchmarks are on the overview.

SDOT — H. Leclerc, Q. Mérigot, T. Gallouët · LMO / INRIA PARMA