Revisiting dedispersion

Hey folks :grin: ! Last time I asked for some performance tips on a code that was trying to implement the operation of dedispersion in Julia. Unfortunately, that code turned out to be incorrect. The code now up on the repository here: https://github.com/astrogewgaw/DeDisp.jl, implements the algorithm correctly. Therefore, I have no choice but to repeat the question asked last time :sweat_smile:: what can I do to increase the performance of this code? Any tips?

MWE:

using DeDisp

A = rand(Int8, 4096, 10000)
B = dd(A, 500.0, 200.0, 81.96e-6, 50.0)

PS: Thanks for all the help @jw3126, @goerch and @baggepinnen last time! I am really sorry that you wasted your efforts on what turned out to be wrong code :sweat:. I am (a bit shamelessly) counting on your help yet again.

I am (a bit shamelessly) counting on your help yet again.

I am happy to help again. However, I think the important lesson here is to really make sure the code is correct before making it fast. So maybe you should add some tests, before trying to speed things up. For instance you could calculate some small examples with another battle tested library and add unit tests, that your method gives approximately the same results.

5 Likes

So maybe you should add some tests

I am looking into that :+1: . The only thing is that testing this package is not trivial, mostly because I am not sure how to verify the test results (expect by eye). The other thing is that other battle-tested libraries are in C and only usable via a command line interface. Maybe I could compare the final outputs from both packages somehow? Anyways, the idea is to have testing and docs ready by the time I get to the v0.1.0 release.

Trying it results in ERROR: ArgumentError: invalid Array dimensions for me. I see ntโ€ฒ = -7989?

1 Like

Hey @goerch! I could reproduce that on my end as well, which means that you have landed on a bug. I hope to try and solve this today. EDIT: I filed this issue on the GitHub repository myself, no worries :grin: !