jason-ni / Programming-Massively-Parallel-Processors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Programming-Massively-Parallel-Processors

About

This repository is splitted into two sections:

  • The first section found in Chapters contains source code and information from the book "Programming Massively Parallel Processors" by David B. Kirk and Wen-mei W. Hwu. You can find the book here.

  • The second section found in Performance-Tests-NvBench contains benchmarks done with the NvBench Project.


Preperation for the benchmarks

To use this project and run the benchmarks, you will need:

  • A NVIDIA GPU with CUDA support. You can find a list of supported GPUs here.
  • The NVIDIA CUDA Toolkit installed on your system. You can find the latest version here.
  • The CMAKE tool installed on your system. You can find the latest version here.
  • Git installed on your system. You can find the latest version here.
  • (Optional) Python installed on your system. You can find the latest version here.
  • (Optional) Miniconda installed on your system. You can find the latest version here.

The Optional tools are only needed if you want to run the python script extract_stats.py to generate plots from the csv files generated by the benchmarks.


How to use this project

Clone this repository to your local machine:

git clone --recursive https://github.com/R100001/Programming-Massively-Parallel-Processors.git

Then, create a build directory and run CMAKE:

cd Performance-Tests-NvBench
mkdir build
cd build
cmake ..

Finally, build the project:

cmake --build .

This project contains ready CMAKELISTS.txt files for the benchmarks. You can change them to fit your needs.


How to run the benchmarks

After building the project, you can run the benchmarks by executing the out files in the corresponding directories.

You can also change the source code of the benchmarks. You can see some examples here.

There is a python script extract_stats.py that can generate plots using the csv files generated by the benchmarks. You can generate csv files by running the benchmarks with the following command:

/path/to/benchmark/executable.out --csv /path/to/csv/file.csv

You can generate the results for the benchmarks in Markdown format using the optional argument:

/path/to/benchmark/executable.out --md /path/to/markdown/file.md

To run the script it is recommended to use a virtual environment. You can create one with the following commands:

conda create -n nvbench python matplotlib
conda activate nvbench

Then, you can run the script with the following command:

python extract_stats.py --path /path/to/csvs/directory --output /path/to/output/directory --data_to_plot x1 x2 ... xn
  • x1 x2 ... xn are the column numbers in the csv files that you want to plot. You can find the names of the columns in the first line of the csv files.

About


Languages

Language:Cuda 96.8%Language:Python 2.1%Language:CMake 1.1%