- 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.
-
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
-
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
- To build:
-
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. Thesycl_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
orrun_benchmarks
functions.$ python -c "import dpbench; dpbench.run_benchmark(\"black_scholes\", "<absolute path to json file>")"