spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
115 stars 62 forks source link

NIRSpec NRS1 and NRS2 PSF creation have very different runtimes #814

Open eteq opened 6 months ago

eteq commented 6 months ago

See the attached snippet from a notebook running the latest WebbPSF. image (4)

The key points to note are:

  1. Unsurprisingly, the first run is slower than the later ones because various calculations need to be cached.
  2. Much more surprisingly, after the first, there is a consistent trend, independent of execution order, that computing an MSA PSF for the NRS2 detector is ~4x slower than NRS1. Which seems odd since one would think they'd be nearly identical.

(Note: this is on a machine with cupy and a GPU, so it might be using the cupy GPU pathway which may or may not make a difference.)

cc @mperrin (who I discussed a bit with out-of-band about this)

mperrin commented 1 month ago

@eteq out of curiosity are you still having this issue? I never got around to trying to reproduce it (since I don't have an easy access to a GPU machine at work, it's not as straightforward to do so). From your perspective is there still motivation for someone to look into this for you?