GithubHelp home page GithubHelp logo

engpap / montecarlo-benchmarking Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.99 GB

Evaluation and implementation of MonteCarlo workload on multi-GPU systems via Unified Memory

C 70.24% C++ 22.64% Shell 0.60% Makefile 0.54% Cuda 3.12% Java 2.85%

montecarlo-benchmarking's Introduction

MonteCarlo Benchmarking

Introduction

This is a project of the High Performance Processors and Systems course of Politecnico Di Milano. This repository contains the evaluation and implementation of MonteCarlo workload on multi-GPU systems via Unified Memory and GrCUDA framework. The project is based on the Tartan benchmarking suite, more specifically on the MonteCarlo benchmark scale-up implementation.

Presentation

For an overview of the project and its results, please refer to the presentation here.

Technical Report

The technical report of the project can be found here. The report is a comprehensive document detailing the study and implementation of Monte-Carlo simulation for option pricing, implemented using multi-GPU CUDA C++, CUDA 11 with Unified Memory, and GrCUDA with GraalVM Java.

The report covers the following aspects:

  1. An introduction and an overview of the Monte-Carlo Simulation and Option Pricing, including a problem statement and research objectives.
  2. A detailed description of the original multi-GPU CUDA C++ implementation, and the benchmark program flow and manual handling methods.
  3. A section on the Unified Memory (UM) implementation including porting to CUDA 11, initial UM porting, and a number of optimizations such as prefetching the memory and advising memory migration.
  4. An exploration of GrCUDA and GraalVM Java implementation, including porting to Java, program structure, program design, and a brief description of the classes involved. It also covers the binding from PTX files and additional optimizations.
  5. A thorough methodology section that outlines performance evaluation metrics, data collection and analysis tools, and the testing procedure.
  6. Results and discussion segment that compares performance across different versions, validation of data transfer patterns, profiling outputs, and various timing graphs.

Please refer to the report for a detailed understanding of the work done on this project.

Repository Structure

Below is a brief overview of the main directories and files:

common/

A directory for common resources used across the project.

montecarlo/

A directory dedicated to the GrCUDA implementation of the MonteCarlo benchmark.

scale-up/

A directory dedicated to the CUDA implementation of the MonteCarlo benchmark. It contains different versions:

  • /montecarlo: CUDA baseline version which reflects Tartan implementation, ported in CUDA 11
  • /montecarlo_UM: Unified Memory implementation
  • /montecarlo_UMv1: Unified Memory implementation with prefetching
  • /montecarlo_UMv2: Unified Memory implementation with advising
  • /montecarlo_UMv3: Unified Memory implementation with prefetching & advising

IISWC-18.pdf

Paper of the project's benchmark suite.

grcuda-0.1.1.jar

The grcuda jar file used for implementing the GrCUDA version.

How to set up your machine

  • Configuration: Set env in "shared.mk". You need to install NCCL library before building the NVLink version.
  • GrCUDA Installation: Follow the instructions in the Nects Lab's GrCUDA repository.

How to run the benchmarks

Method A

To run every possible configuration, take timings, produces nvprof and Nsight Systems report files:

  • For CUDA baseline version:
  $ cd scale-up/montecarlo/
  $ chmod +x run.sh
  $ ./run.sh
  • For CUDA version 0:
  $ cd scale-up/montecarlo_UM/
  $ chmod +x run.sh
  $ ./run.sh
  • For CUDA version 1:
  $ cd scale-up/montecarlo_UMv1/
  $ chmod +x run.sh
  $ ./run.sh
  • For CUDA version 2:
  $ cd scale-up/montecarlo_UMv2/
  $ chmod +x run.sh
  $ ./run.sh
  • For CUDA version 3:
  $ cd scale-up/montecarlo_UMv3/
  $ chmod +x run.sh
  $ ./run.sh
  • For GrCUDA version:
  $ cd montecarlo/
  $ chmod +x run_grcuda.sh
  $ ./run_grcuda.sh

Method B

Alternatively, you may not be interested in report file. In that case, just run the single version by entering into each app dir, make, and run:

  • For CUDA versions:
  $ cd scale-up/<app>/
  $ make
  $ export CUDA_VISIBLE_DEVICES=<gpu_list>
  $ ./MonteCarlo --scaling=<scaling> --method=<method> --size=<size>

where:
app is in {montecarlo, montecarlo_UM, montecarlo_UMv1, montecarlo_UMv2, montecarlo_UMv3}
scaling is in {strong, weak}
method is {threaded, streamed}
size is in {512, 1024, 4096, 8192}
gpu_list is "0" if 1 GPU, "0,1" if 2 GPUs, "0,1,2,3" if 4 GPUs, etc.

ย 

  • For GrCUDA version:
  $ cd montecarlo/src/test/java/com/polimi/montecarlo
  $ mvn test

montecarlo-benchmarking's People

Contributors

engpap avatar andreapiras00 avatar gwdidonato avatar

Stargazers

 avatar

Watchers

Ian Di Dio Lavore avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.