Skip to content

Benchmark suite to evaluate Data Parallel Extensions for Python

License

Notifications You must be signed in to change notification settings

npolina4/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
     $ 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 dppy/label/dev -c intel -c main dpctl numba-dpex dpnp
     $ pip install alembic
    
  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\")" 2> /dev/null
    • Similarly, to run all the cases in DPBench:
      $  python -c "import dpbench; dpbench.run_benchmarks()" 2> /dev/null
  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, 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 Data Parallel Extensions for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.6%
  • C++ 18.5%
  • CMake 2.7%
  • Mako 0.2%