Build

The package does not use only pure python. Performance is usually achieved by using C++ extensions. Next sections explain how it works.

Build C++ extensions

The packages relies on cmake to build the C++ extensions, whether it is wrapped with pybind11 or cython. Both options are available and can be linked with openmp, eigen, CUDA. cmake is called from setup.py with two instructions:

  • python setup.py build_ext --inplace, the legacy way

  • pip install -e ., the new way

By default, cmake builds with CUDA if it is available. It can be disabled:

  • python setup.py build_ext -v --inplace --with-cuda=0, the legacy way,

  • pip install -e . -v --config-settings="--with-cuda=0", the new way (not fully working yet),

  • pip install -e . -v --global-option "--with-cuda=0", the deprecated way,

  • USE_CUDA=0 pip install -e . -v, when other options do not work.

In case there are multiple versions of CUDA installed, option cuda-version can be specified:

python setup.py build_ext --inplace --cuda-version=11.8

Spark

Notebooks using pyspark can be run locally. They are disabled on CI but they can be run as well with the rest of the other unit tests with:

TEST_SPARSE=1 pytest _unittests