JAX-GalSim icon indicating copy to clipboard operation
JAX-GalSim copied to clipboard

use codspeed to benchmark performance and look for regressions

Open beckermr opened this issue 1 year ago • 2 comments

We can use this free service to write benchmark tests for CPUs: https://docs.codspeed.io/benchmarks/python

We won't be able to test on GPUs, but it will be a good start.

beckermr avatar Jun 12 '24 21:06 beckermr

I think you implemented this already in #100 so we can close this issue?

ismael-mendoza avatar Sep 16 '24 19:09 ismael-mendoza

I'd like to implement other bits of the code.

beckermr avatar Sep 16 '24 19:09 beckermr

Have you done any runtime tests on interpolated images? I have done some testing on scarlet2, where we implement the same Bernstein&Gruen method, and see massive costs even if the interpolation call is jitted. It would be good to compare. Maybe we're doing something stupid..

pmelchior avatar Nov 17 '25 20:11 pmelchior

You can see how we do things here: https://github.com/GalSim-developers/JAX-GalSim/blob/main/jax_galsim/interpolatedimage.py#L980

Avoid any calls to jax.lax.scan, fori_loops, while_loops, and similar. Instead, we unroll everything into memory and do one giant sum.

beckermr avatar Nov 17 '25 21:11 beckermr

Thanks! Benjamin did check the code here. My question is: do you have runtime numbers for an Fourier resampling method?

pmelchior avatar Nov 17 '25 22:11 pmelchior

I do not. The algorithms here follow galsim exactly by construction.

beckermr avatar Nov 18 '25 00:11 beckermr