Performance of non-BLAS functions?

Issue #378 new
Nils Deppe created an issue

Hi Klaus!

We use Blaze effectively as a way of doing expression templates for math so we can write things like:

Vector a = b + c * square(sin(x))

Have you done any performance measurements of Blaze for the various basic math expressions? I’m wondering because libraries like XSIMD (https://github.com/xtensor-stack/xsimd/) seem to do some tricks for functions like tanh that aren’t natively supported by SIMD instructions. Of course, XSIMD also doesn’t offer (or at least when I last looked a year or so ago) expression templates like Blaze does and would require us to write out all the loops manually (yuck!).

If you have done these measurements it would be great to have a wiki entry showing them off. If not, maybe it’s something to consider doing 🙂 It would certainly be helpful in selling Blaze to people that want an ET library for non-BLAS operations and might give some guidance on if there are any operations that Blaze could do better on than it currently is 🙂 I realize this is not very high priority but just wanted to make sure you were aware that there’s interest in seeing these results.

Thank you so much!

Cheers,

Nils

PS I’m marking as “minor” because it might not be “trivial” to implement, but is also not a priority.

Comments (2)

  1. Klaus Iglberger

    Hi Nils!

    Thanks for the suggestion. Of course we cannot provide results for every possible combination of basic expressions, but a few selected examples would help. We’ll keep this in mind for the next update of the performance graphs.

    In case you need extra speed for trigonometric functions like sin(), cos() or tan() I would recommend to try using Sleef. This functionality has been added in Blaze 3.8, however, which unfortunately seems to give you trouble (see issue #377).

    Thanks again,

    Best regards,

    Klaus!

  2. Nils Deppe reporter

    Hi Klaus!

    That sounds great, thank you!

    Thanks for pointing out the sleef support. That looks like it’ll do exactly what I was asking about. I’ll try to see if by disable AVX-512 I can get Blaze 3.8 working on my machine with sleep.

    Thank you again!

    Best wishes,

    Nils

  3. Log in to comment