Backend Selection
Warning
This is an advanced topic that may affect application performance or even lead to mysterious crashes. This section is meant for educational purposes and for those who wish to dig a little deeper.
The C++ library makes extensive use of Intel(R) AVX-512 instructions both in the form of direct intrinsics and through the EVE SIMD library. Along with design decisions around generic programming and static dimensionality, this makes it quite difficult to surgically extract the portions of the library that are accelerated by these instructions. In order to support multiple CPU micro-architectures including those that lack Intel(R) AVX-512 support, we instead ship multiple versions of the backing shared library, each targeting a different micro-architecture. At run-time, the svs Python module tries to select the best backend for the current CPU.
There are several environment variables that can be set prior to loading the library that can influence this behavior.
SVS_QUIET=YES
The svs loading logic may emit warnings when loading the backend. This can occur either when the loaded backend is targeting an old architecture and may have poor performance, or when the selection logic is explicitly bypassed and the resulting backend may not be compatible with the current CPU.
These warning are suppressed when this environment variable is defined.
SVS_OVERRIDE_BACKEND=<backend-name>
Explicitly bypass the backend selection logic. See the
svs.loader.available_backends()
for a list of valid strings for this variable. Misusing this feature can cause the application to not load or crash.
Documentation for functions regarding backend selection and the current backend are given below.
- svs.loader.available_backends()
Return a list of the available backends that where compiled when this module was built.
Each backend in the list may be used to initialize
SVS_OVERRIDE_BACKEND
environment variable prior to application start to override the default loading logic.
- svs.loader.current_backend()
Return the name of the current backend.
- svs.loader.library()
Return the library backend as a module. Dynamically loads the library when first called.
Dynamically loading the library may trigger warnings related to correctness or performance. If you really really don’t want these warnings, they can be suppressed by defining the environemtn variable
SVS_QUIET=YES
prior to application start.