Coder Social home page Coder Social logo

zeta1999 / qconlondon2020-tornadovm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjfumero/qconlondon2020-tornadovm

0.0 0.0 0.0 47 KB

Code Examples explained in QCon-London 2020 about TornadoVM

License: Apache License 2.0

Shell 44.78% Java 47.81% JavaScript 7.41%

qconlondon2020-tornadovm's Introduction

TornadoVM QCon-London 2020 - Demos

Artefact & demos used for QCon-London presentation 2020: TornadoVM @ QCon-London

Slides available here

Video will be available soon by InfoQ

Pre-requisites
  • Install TornadoVM. Full guideline here
  • OpenCL device with OpenCL >= 1.2 installed

1) Live Task Migration

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

$ export JAVA_HOME=/PATH/TO/graal-jvmci-8/jdk1.8.0/product
$ export TORNADO_ROOT=/PATH/TO/TORNADOVM/ROOT
$ export PATH="${PATH}:${TORNADO_ROOT}/bin/bin/"
$ export TORNADO_SDK=${TORNADO_ROOT}/bin/sdk

## Compile the application
$ mvn clean package

How to reproduce?:

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

## Client in another terminal
./runClient.sh

2) Matrix Multiplication

$ export CLASSPATH=target/tornado-1.0-SNAPSHOT.jar

# Run sequential code (without TornadoVM acceleration)
tornado qconlondon.MatrixMultiplication 512 seq

# Run with TornadoVM acceleration on the default device
tornado qconlondon.MatrixMultiplication 512 tornado

# Run with TornadoVM on the default device with debug information
tornado --debug qconlondon.MatrixMultiplication 512 tornado

# Run with TornadoVM and print the generated OpenCL kernel
tornado --printKernel qconlondon.MatrixMultiplication 512 tornado

# See all devices available
tornado --devices 

# Run with TornadoVM on the device 1
# Convention: -D<taskScheduleName>.<taskName>.device=0:<deviceID> 
tornado --printKernel --debug -Ds0.t0.device=0:1 qconlondon.MatrixMultiplication 512 tornado

# Run with TornadoVM on the device 3 
# Convention: -D<taskScheduleName>.<taskName>.device=0:<deviceID> 
tornado --printKernel --debug -Ds0.t0.device=0:3 qconlondon.MatrixMultiplication 512 tornado

# Run TornadoVM with IGV (Ideal Graph Visualizer) to see the compiled graphs 
tornado --igv qconlondon.MatrixMultiplication 512 

3) Node.js and TornadoVM

See install guidelines for running TornadoVM with GraalVM here

$ cd nodejs
$ export BASE=/path/to/tornadovm-graal
$ export PATH=$BASE/bin/bin:$PATH
$ export TORNADO_SDK=$BASE/bin/sdk

## JDK 8 - last Graal
$ export JAVA_HOME=/path/to/oracleGraal/19.3.0/graalvm-ce-java8-19.3.0

## Install the NPM dependencies
$ $JAVA_HOME/bin/npm install express
$ $JAVA_HOME/bin/npm install jimp
$ $JAVA_HOME/bin/npm install fs

Compile the user-code using the alias for javac provided by TornadoVM:

$ javac.py Mandelbrot.java
Running with docker?
$ docker run \
 --runtime=nvidia \
 --rm -it -v \
 "$PWD":/data \
 beehivelab/tornado-gpu-graalvm-jdk11 \
 bash node.sh server.js

## Access
http://172.17.0.2:3000/ 

## Access the sequential execution
http://172.17.0.2:3000/java
Running stand-alone?
$ bash node.sh server.js

## Access
http://127.0.0.1:3000/

## Access the sequential execution
http://127.0.0.1:3000/java

qconlondon2020-tornadovm's People

Contributors

jjfumero 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.