A performance benchmarking tool for different matrix implementations by evaluating matrix operations. This tool displays the benchmarked results as a graph.
Currently this package supports matrix multiplications for the following languages / implementations:
- Python
- NumPy
- C++
- Boost
- CuPy
- pyCUDA
- cuBLAS
- Numba (with and without CPU parallelization)
- Numba with CUDA
- Python >= 3.0
- NumPy
- tabulate
- PlotLy
These dependencies must be downloaded to observe performance benchmarks for other implementations.
- Boost : Download Boost and unzip in the parent directory of root.
- CuPy : Check the CuPy Documentation for installation requirements of cupy. Can be installed by using
pip
, but is required to be installed with the appropriate CUDA version. - pyCUDA : Check the pyCUDA Wiki for installation requirements of pyCUDA. Can be installed by
pip install pycuda
. - cuBLAS : We use the
scikit-cuda
package that utilizes pyCUDA. Check the scikit-cuda Wiki for installation requirements. This can be installed withpip install scikit-cuda
. - Numba : Can be installed with
pip install numba
. Check numba documentation for details. - Numba with CUDA : Only compatible with NVIDIA graphics card with compute capability 3.0 or above. Check Numba with CUDA Overview for more information, as well as necessary configurations to allow Numba to access CUDA Toolkit.
Note: Currently requires all such packages to be installed. This will be fixed in a future release.
Our lastest release can be downloaded by pip
:
pip install pbmo
The most latest (unstable) version can be installed through GitHub:
git clone https://github.com/kwat0308/pbmo.git
cd pbmo/
pip install .
The code can be run in any Python interactive shell, as well in a Jupyter notebook. Examples are placed in the examples/
directory.
A minimal example would be of such:
import numpy as np
from pbmo.pbmo import PBMO
ndim = np.arange(10) # max 10x10 matrix
ndims = list(zip(ndim, ndim))
pbmo = PBMO(dims=ndims) # 10000 iterations
pbmo.evaluate_matmul()
pbmo.collect_results()
pbmo.plot_results() # plots log scale
Note: Running plotly on Jupyter Notebook or Jupyter Lab requires additional configurations. Check here for details.