GalSim-developers / JAX-GalSim

JAX port of GalSim, for parallelized, GPU accelerated, and differentiable galaxy image simulations.
Other
27 stars 3 forks source link

refactor: do interpolation class init on the host #106

Closed beckermr closed 3 months ago

beckermr commented 3 months ago

This PR is a small refactor to move the init of the interpolant classes to the host. This pattern makes more sense in general since once we apply JIT, the constants computed on the host will get embeded into the JAX code and moved to the device with the code.

codspeed-hq[bot] commented 3 months ago

CodSpeed Performance Report

Merging #106 will improve performances by ×3.2

Comparing host-init-interp (997f855) with main (b6cbbcd)

Summary

⚡ 2 improvements ✅ 9 untouched benchmarks

Benchmarks breakdown

Benchmark main host-init-interp Change
test_benchmarks_lanczos_interp[kval-no_conserve_dc-compile] 1,558 ms 492 ms ×3.2
test_benchmarks_lanczos_interp[xval-no_conserve_dc-compile] 261.5 ms 160.2 ms +63.22%