https://github.com/jjfumero/qconlondon2020-tornadovm
Code Examples explained in QCon-London 2020 about TornadoVM
https://github.com/jjfumero/qconlondon2020-tornadovm
acceleration demos fpgas gpus graalvm qconlondon2020 tornadovm
Last synced: 24 days ago
JSON representation
Code Examples explained in QCon-London 2020 about TornadoVM
- Host: GitHub
- URL: https://github.com/jjfumero/qconlondon2020-tornadovm
- Owner: jjfumero
- License: apache-2.0
- Created: 2020-02-11T10:19:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-21T12:56:52.000Z (almost 4 years ago)
- Last Synced: 2025-03-30T23:11:33.961Z (2 months ago)
- Topics: acceleration, demos, fpgas, gpus, graalvm, qconlondon2020, tornadovm
- Language: Java
- Homepage:
- Size: 65.4 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TornadoVM QCon-London 2020 - Demos
Artefact & demos used for QCon-London presentation 2020: [TornadoVM @ QCon-London](https://qconlondon.com/london2020/presentation/tornadovm-breaking-programmability-and-usability-gap-between-java)
* Slides available [here](https://github.com/jjfumero/jjfumero.github.io/blob/master/files/QCON2020-TornadoVM.pdf)
* Video will be available soon by [InfoQ](https://www.infoq.com/)
* Review from InfoQ review about the talk in QCon London: https://www.infoq.com/news/2020/03/TornadoVM-QCon-London/
* InfoQ Article: https://www.infoq.com/articles/tornadovm-java-gpu-fpga/
###### Pre-requisites
* Install TornadoVM. Full guideline [here](https://github.com/beehive-lab/TornadoVM/blob/master/INSTALL.md)
* OpenCL device with OpenCL >= 1.2 installed
* Maven 3.6## 1) Live Task Migration
Demo using the Client-Server application to change the devices through the client:
```bash
$ 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 install
```How to reproduce?:
```bash
## Run Server in one terminal
./runServer.sh## Client in another terminal
./runClient.sh
```## 2) Matrix Multiplication
```bash
$ 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 --threadInfo 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..device=0:
tornado --printKernel --threadInfo -Ds0.t0.device=0:1 qconlondon.MatrixMultiplication 512 tornado# Run with TornadoVM on the device 3
# Convention: -D..device=0:
tornado --printKernel --threadInfo -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](https://github.com/beehive-lab/TornadoVM/blob/master/assembly/src/docs/10_INSTALL_WITH_GRAALVM.md)
```bash
$ 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:
```bash
$ javac.py Mandelbrot.java
```##### Running with docker?
```bash
$ 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
$ bash node.sh server.js## Access
http://127.0.0.1:3000/## Access the sequential execution
http://127.0.0.1:3000/java
```