Intel SVML downstream patches for LLVM in llvmlite

I was looking further into this and found the following discussion: https://discourse.llvm.org/t/x86-finalizing-svml-support-in-llvm/70977

Which is the upstreaming efforts for the internal patches on enabling Intel SVML on Clang that seemed to have stalled.

Does anyone know what type of scenarios or performance wins this is providing? Also is this something that is expected to be part of auto-vectorization or more of the user still needs to manually invoke SVML intrinsics?

I’m wondering how to trial this out internally in numba and potentially other services and see if the gains are enough to help push the upstream patches forward :slight_smile:

Thanks,
Modi

1 Like

The use of SVML is automatic in Numba as long as the libSVML is installed. See documentation about it at https://numba.readthedocs.io/en/stable/user/performance-tips.html#intel-svml. Many numpy.* and math.* transcendentals are automatically upgraded to use SVML functions. This test here shows what it supported.

2 Likes

Thanks,

LLVM does have support for generating calls to SVML via -fveclib=svml: https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fveclib

Are there additional features enabled by the downstream patches? Reading through the LLVM-14 patch (https://github.com/Hardcode84/llvm-project/commit/9de32f5474f1f78990b399214bdbb6c21f8f098e#diff-0d6db65ec90b08444da63b5f4ece0baa276a8bfbacd2841a2df5d20688d40334) it seems to be more on the legality side. That sounds more like a bug than a missing feature if that’s the case.

Also side note it looks like I can’t directly post links so that’s why they’re in code blocks :confused:

Is there a short and easy way to test if Numba has the SVML feature on a given system?

Yes, run numba -s and it will print a long list of diagnostic information containing something like:

__SVML Information__
SVML State, config.USING_SVML                 : True
SVML Library Loaded                           : True
llvmlite Using SVML Patched LLVM              : True
SVML Operational                              : True

Is there a way to do the same within Python?

What we remember is that it is mainly for legality in using Intel’s SVML library which uses a different calling convention. (CC @Hardcode84)

Discourse trust levels configuration confuses me. New users should be able to post a maximum of 2 links. I added *.llvm.org as part of trusted domain, hopefully that helps.

Take a look at the implementation for numba -s here. It’s relying on checking if libSVML is around: