Git Product home page Git Product logo

nyjavasig-tornadovm-2021's Introduction

NYJavaSIG 2021 Demos

This repository contains examples and tests shown at the NYJavaSIG TornadoVM talk in Feb 2021

Link to the event: Video Recording

Pre-requisites and Setup

  • Install TornadoVM. Full guideline here
  • OpenCL or PTX device:
    • If OpenCL is selected, installation with OpenCL >= 1.2 installed
    • If the PTX backend is selected, CUDA >= 10
  • Maven 3.6

Once TornadoVM is installed, please configure the sources.sh file with your paths to the JAVA_HOME and TORNADO_ROOT.

All these examples and scripts uses Java 8. For JDK >= 11, please file an issue, and we can work through it together.

## Provide the paths to your path to the OpenJDK+JVMCI bin
export JAVA_HOME=<path-to-OpenJDK>
# Provide your path to the TornadoVM root folder
export TORNADO_ROOT=<path-to-TornadoVM>

## Keep these env-variables are they are
export PATH="${PATH}:${TORNADO_ROOT}/bin/bin/"
export TORNADO_SDK=${TORNADO_ROOT}/bin/sdk
export CLASSPATH=target/tornado-1.0-SNAPSHOT.jar

Run:

. sources.sh

Compile this tutorial:

mvn clean package

1) Running DFT

This example is taken from the example-suite of TornadoVM:

How to run it?

tornado nyjavasig.DFT <inputSize> <version:sequential|tornadoVM> <numIterations>

Example:

# Running Sequential
tornado nyjavasig.DFT 8192 sequential 10

# Running Parallel Version with TornadoVM
tornado nyjavasig.DFT 8192 tornado 10

Changing device?

# Running Parallel Version with TornadoVM
tornado --debug -Ds0.t0.device=0:1 nyjavasig.DFT 8192 tornado 10

Print Kernel:

# Running Parallel Version with TornadoVM
tornado --printKernel --debug -Ds0.t0.device=0:1 nyjavasig.DFT 8192 tornado 10

2) Running on FPGAs

Note, you need an FPGA to run these demos.

Run DFT on the FPGA
tornado --debug --printKernel -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=dftFPGA.conf nyjavasig.DFT 8192 tornado 5

Running with Emulation mode:

export CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1
tornado --debug --printKernel -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=dftFPGA.conf nyjavasig.DFT 8192 tornado 5
Running BlackScholes
tornado --debug -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=blackScholes.conf nyjavasig.BlackScholes 33554432 5

3) Running Live Task Migration

Demo using the Client-Server application to change the devices through the client:

How to run it?:

## Run Server in one terminal
./runServer.sh

## Client in another terminal
./runClient.sh

4) Python

cd python 

## Run TornadoVM accelerated (512 x 512 Doubles)
./runPython.sh mxmWithTornadoVM.py

5) Running TornadoVM with Ideal Graph Visualizer (IGV)

IGV can be downloaded from Oracle OTN

Run IGV 20.2.0

~/Downloads/20.2.0/idealgraphvisualizer/bin/idealgraphvisualizer &

Run an example (vector add)

tornado --igv nyjavasig.TestTornado

nyjavasig-tornadovm-2021's People

Contributors

jjfumero avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

weltam

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.