Open max-dax opened 2 years ago
Are these times in seconds? What is the call path to the LAL function?
I'm not sure I understand this table. So we have roughly 50% of synthetic phase time spent on generating modes, < 1% on inner products, but what is the third column, "phase loop"?
How does the mode generation time of ~ 0.2 s compare to the time to generate the polarizations? Is this XPHM?
Okay, I see that it takes about 10 times longer to generate XPHM modes with ChooseFDModes
vs generating polarizations with SimInspiralFD
. Are you sure that the implementation within lalsimulation
is really the same?
n_grid=10
(i.e., largely removing the effect of the phase loop) only reduces the time by ~30%, not by 50%. Maybe this is because some waveforms take a bit longer to generate, I saw some with up to 0.7 s.lalsimulation
backend, and it is possible there is a reason it takes longer to compute individual modes than to compute the entire waveform. But I guess that computing individual modes would be an intermediate step for computing the waveform, that's why I am surprised it takes so much longer. Note that the timing also includes the frame transformations that you apply, although I would expect these to be rather lightweight.Yeah I tested it without even the frame transformations, and I found that the factor of 10 difference persists. It is possible that the lalsimulation
implementation is rather different for the two cases. I could ask on mattermost.
Okay, this is the expected behavior. Cecilio said
The implementations are independent, in fact ChooseFDModes came after the implementation of IMRPhenomXPHM in ChooseFDWaveform. The implementation could in fact be improved to be more efficient, but for now what it does is that for each mode in ChooseFDModes, it has to compute the corresponding modes in the co-precessing frame and then do the rotation to the J-frame. In ChooseFDWaveform the co-precessing modes are only computed once.
I think it's fine to leave it as-is for now, and maybe the waveform people will make it faster at some point.
Ok thanks for checking this! I guess in the paper we can list the IS computation time for IMRPhenomXPHM, under real and under optimal (i.e., if lalsimulation
was optimized) conditions.
Yeah, or just have a footnote about this.
Could it be that for the polarization API they're only computing the waveform on a sparse grid and then interpolating the data with a multi-banding approach a la https://inspirehep.net/literature/1516394 ?
It turned out that we had to turn multi-banding off to generate accurate modes. When I tested turning it back on, it improved the runtime by maybe 20%, so this is definitely not the whole story.
My understanding is that ChooseFDModes
must be computing each mode separately in a way that is not efficient, whereas ChooseFDWaveform
must be reusing calculations that are the same for each mode. Hence ChooseFDModes
takes ten times as long.
Is this still important? We could go back to the Phenom developers to see if they can accelerate ChooseFDModes
.
Why is sampling synthetic phase so much slower than a single likelihood evaluation? Profiling the code with print statements
we get:
The phase loop can likely be vectorized, but is there a way to speed up mode computation? This seems to take much longer than a simple waveform evaluation, although in the
lalsimulation
backend both should compute the same things.