flatironinstitute / sf_benchmarks

Special function benchmarks
Apache License 2.0
10 stars 1 forks source link

suggestions #2

Open ahbarnett opened 2 years ago

ahbarnett commented 2 years ago

Dear Robert, Excellent. As a follow-up to our chat, 1) I realised that putting in a range of arguments (eg bessel is very different speed for different combos of nu and x) is much more a priority than including any more function types. This really applies to some of the more elaborate funcs (bessel being such a one, since it has nu order and x argument; by contrast erf only has a small range of relevant x and no other params).

2) Here are some other codes to include: (entirely up to you) baobzi applied to any of the functions! :) https://github.com/ahbarnett/mpspack/tree/master/%40utils hank103 and possibly hank106 https://github.com/JamesCBremerJr/BesselEval https://github.com/JamesCBremerJr/ALegendreEval only if you have another to compare to

[but then we start to get into matlab, etc, and having to rewrite in C++, maybe off-topic for now... eg https://github.com/sms03snc/Faddeeva ]

Ok, have fun! Cheers, Alex

blackwer commented 2 years ago

Thanks! Setting the domain of interest is definitely one of the next things on the table. Trying to think of the best way to keep the code tidy while still being a bit more extensible. I did the bessels for various nu arguments, but didn't chain up the higher nus. I was trying to think of a clean way to implement these "2d" functions without just manually writing a million of them.

I'll go ahead and add these other funcs though. Then I'll get the database stuff set up. Then I'll add the range functionality.

I wrote the SIMD sleef stuff, and it is indeed pretty impressive. Updating the README in a sec.

blackwer commented 2 years ago

@ahbarnett

I haven't added the other functions yet, but check the README.md now. I have ranges. I have a lot more functions. They're much faster. I have a database (though only one machine), so I can collate results from different runs. Still needs input control and a nice way to visualize the results, but it's almost "done." Though I haven't re-added the complex functions yet (but it's next on the list).

DiamonDinoia commented 1 year ago

One further comment on ranges. In case of periodic functions, the argument reduction strategy can introduce significant overhead. It would be worth benchmarking small/medium/high numbers so that all of these strategies can be evaluated. Depending on the workload, having to compute sin[0, 2PI] can lead to different performance compared to sin[-1M,1M].