Skip to content

Dbench is a collection of parallel hardware agnostic microbenchmarks that aim at capturing the most important patterns in analytical query execution

License

Notifications You must be signed in to change notification settings

kurapov-peter/dwarf_bench

Repository files navigation

Dbench

“Dwarf bench” is a collection of patterns that attempt to capture performance characteristics of analytical queries. The idea is to extend the taxonomy of computational patterns defined in the article “The Landscape of Parallel Computing Research” published in 2006 to data analytics in heterogeneous environments. Implementing basic structures and algorithms once for multiple devices strives to find a balance between performance and specific capabilities usage, and implementation effort. We chose platform-agnostic tools to express our language of patterns (OpenCL, SYCL).

Usage

Using DwarfBench library

#include <bench.hpp>
#include <iostream>

int main() {
  std::vector<DwarfBench::DeviceType> devices = {
    DwarfBench::DeviceType::CPU,
    DwarfBench::DeviceType::GPU,
  };

  std::vector<DwarfBench::Dwarf> dwarfs = {
    DwarfBench::Dwarf::Join,
    DwarfBench::Dwarf::Sort,
    DwarfBench::Dwarf::Scan,
    DwarfBench::Dwarf::GroupBy
  };
  
  DwarfBench::DwarfBench db;

  for (DwarfBench::Dwarf dwarf: dwarfs) {
    for (DwarfBench::DeviceType device: devices) {
      DwarfBench::RunConfig rc = {
          .device = device,
          .inputSize = 1024,
          .iterations = 10,
          .dwarf = dwarf,
      };

      auto results = db.makeMeasurements(rc);

      for (auto &result : results) {
        std::cout << dwarf << ' ' << device << " RESULT: " << result.dataSize << ' ' << result.microseconds
                  << std::endl;
      }
    }
  }
}

Using DwarfBench utility

Check the lists of benchmarks available using dwarf list

Launch one of the kernel using for example Radix kernel:

./dwarf_bench Radix --device=cpu --input_size=25600 262144 524288 --report_path="report_radix_CPU.csv" --iterations=9

Change to GPU device using --device=gpu

Build

  1. Requirements (see below): boost1.61, oclhelpers, opencl 1.2 (tested with nvidia 11.3, intel gfx & intel opencl cpu runtimes)
  2. Get latest release of opencl helpers from https://github.com/kurapov-peter/oclhelpers/releases
  3. Put the lib into your CMAKE_PREFIX_PATH or set oclhelpers_DIR env var
  4. Install CUDA
  5. Install CPU runtime (You'll only need the runtime: sudo apt install intel-oneapi-runtime-opencl)
  6. Install Intel gfx drivers
  7. In order to run dpcpp tests with cpu, gpu and cuda follow these steps:
  8. mkdir build && cd build && CXX=clang++ oclhelpers_DIR=/path/to/helpers cmake -DENABLE_DPCPP=ON .. && make -jnproc

Docker

  • docker build . --network host -t dwarfs-dev
  • docker run --network host --privileged -it --name spicy -v /path/to/dwarf_bench:/dwarf_bench dwarfs-dev:latest bash
  • mkdir build && cd build
  • CXX=dpcpp cmake /dwarf_bench/ -DENABLE_DPCPP=on -DENABLE_TESTS=on
  • cmake --build . --parallel 4
  • cd tests && ctest

About

Dbench is a collection of parallel hardware agnostic microbenchmarks that aim at capturing the most important patterns in analytical query execution

Topics

Resources

License

Stars

Watchers

Forks