Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scene.set_spectra_to_match taking to long #69

Open
b-remy opened this issue Jun 19, 2024 · 1 comment
Open

scene.set_spectra_to_match taking to long #69

b-remy opened this issue Jun 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@b-remy
Copy link
Collaborator

b-remy commented Jun 19, 2024

Hi @pmelchior , I ran a profiler on the scene_spectra_to_match function and as you can see, the interpolation function (in the resampling renderer) is taking most of the time (3 calls per rendering operation)

image
37 seconds overall

This can be reduced to 6.3 seconds by jitting the resample_obs function in interpolate.py

@partial(jax.jit, static_argnums=(1,2,3,4))
def resample_ops(kimage, shape_in, shape_out, res_in, res_out, interpolant=Quintic()):

image

Interpolating images is indeed expensive, so should we jit this function in the code?

@b-remy b-remy added the enhancement New feature or request label Jun 19, 2024
@pmelchior
Copy link
Owner

I also noticed that this function takes long. Until now, we have only jitted the inner loops of the sampling and the fitting functions because jit usually works best when it sees large code blocks. But it might be a good idea to jit (some part of) the renderer. The most high-level function would be Observation.render Can you try if this helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants