Skip to content

Benchmark suite to evaluate Intel Data Parallel Extensions for Python

License

Notifications You must be signed in to change notification settings

chudur-budur/dpbench

 
 

Repository files navigation

Code style: black pre-commit

DPBench - Numba/Numba-Dpex/dpnp/DPCPP Benchmarks

  • _numba.py : This file contains Numba implementations of the benchmarks. There are three modes: nopython-mode, nopython-mode-parallel and nopython-mode-parallel-range.
  • numba_dpex.py : This file contains Numba-Dpex implementations of the benchmarks. There are three modes: kernel-mode, numpy-mode and prange-mode.
  • _*dpnp.py : This file contains dpnp implementations of the benchmarks.
  • _native_ext/__sycl/_kernel.hpp : This file contains native dpcpp implementations of the benchmarks.

Examples of setting up and running the benchmarks

  1. Setting up conda environment and installing dependencies:

     $ conda create -n dpbench-dev
     $ conda activate dpbench-dev
     $ conda install python=3.9
     $ conda install -c intel tbb dpcpp_linux-64
     $ conda install numpy numba cython cmake ninja scikit-build pandas
     $ conda install scipy scikit-learn pybind11
     # do not miss the quotes!
     $ conda install -c pkgs/main libgcc-ng">=11.2.0" libstdcxx-ng">=11.2.0" libgomp">=11.2.0"
     $ conda install -c intel dpctl numba-dpex dpnp
    
  2. Build and run DPBench

    • To build:
      $  CC=icx CXX=icpx python setup.py develop -- -Dpybind11_DIR=$(python -m pybind11 --cmakedir) -DDPCTL_MODULE_PATH=$(python -m dpctl --cmakedir)
    • To run, taking black_scholes for example:
      $  python -c "import dpbench; dpbench.run_benchmark(\"black_scholes\")"
  3. Device Customization

    If a framework is SYCL based, an extra configuration option sycl_device may be set in the framework JSON file to control what device the framework uses for execution. The sycl_device value should be a legal SYCL device filter string. The dpcpp, dpnp, numba_dpex_kernel, and numba_dpex frameworks support the sycl_device option.

    Here is an example:

        {
            "framework": {
                "simple_name": "dpcpp",
                "full_name": "dpcpp",
                "prefix": "dp",
                "postfix": "dpcpp",
                "class": "DpcppFramework",
                "arch": "gpu",
                "sycl_device": "level_zero:gpu:0"
            }
        }

    NOTE: The arch option is deprecated and not used by dpbench.

    To run with custimized framework JSON file, pass it as an argument to the run_benchmark or run_benchmarks functions.

    $ python -c "import dpbench; dpbench.run_benchmark(\"black_scholes\", "<absolute path to json file>")"

About

Benchmark suite to evaluate Intel Data Parallel Extensions for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.7%
  • C++ 15.5%
  • CMake 1.8%