https://github.com/beehive-lab/tornadovm
TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
✓Academic publication links
Links to: acm.org -
✓Committers with academic emails
12 of 32 committers (37.5%) from academic institutions -
✓Institutional organization owner
Organization beehive-lab has institutional domain (apt.cs.manchester.ac.uk) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
Basic Info
- Host: GitHub
- Owner: beehive-lab
- License: apache-2.0
- Language: Java
- Default Branch: master
- Homepage: https://www.tornadovm.org
- Size: 157 MB
Statistics
- Stars: 1,308
- Watchers: 41
- Forks: 120
- Open Issues: 60
- Releases: 23
Topics
Metadata Files
README.md
TornadoVM

TornadoVM is a plug-in to OpenJDK and GraalVM that allows programmers to automatically run Java programs on heterogeneous hardware. TornadoVM targets OpenCL, PTX and SPIR-V compatible devices which include multi-core CPUs, dedicated GPUs (Intel, NVIDIA, AMD), integrated GPUs (Intel HD Graphics and ARM Mali), and FPGAs (Intel and Xilinx).
TornadoVM has three backends that generate OpenCL C, NVIDIA CUDA PTX assembly, and SPIR-V binary. Developers can choose which backends to install and run.
Website: tornadovm.org
Documentation: https://tornadovm.readthedocs.io/en/latest/
For a quick introduction please read the following FAQ.
Latest Release: TornadoVM 1.1.1 - 07/07/2025 : See CHANGELOG.
1. Installation
In Linux and macOS, TornadoVM can be installed automatically with the installation script. For example:
```bash $ ./bin/tornadovm-installer --help usage: tornadovm-installer [-h] [--jdk JDK] [--backend BACKEND] [--version] [--listJDKs] [--polyglot] [--mvnsinglethreaded] [--auto-deps]
TornadoVM Installer Tool. It will install all software dependencies except the GPU/FPGA drivers
options: -h, --help show this help message and exit --jdk JDK Specify a JDK to install by its keyword (e.g., 'jdk21', 'graal-jdk-21'). Run with --listJDKs to view all available JDK keywords. --backend BACKEND Select the backend to install: { opencl, ptx, spirv } --version Print version --listJDKs List supported JDKs --polyglot Enable Truffle Interoperability with GraalVM --mvnsinglethreaded Run Maven in single-threaded mode --auto-deps Automatic download and use any missing dependencies ```
NOTE Select the desired backend:
opencl: Enables the OpenCL backend (requires OpenCL drivers)ptx: Enables the PTX backend (requires NVIDIA CUDA drivers)spirv: Enables the SPIRV backend (requires Intel Level Zero drivers)
Example of installation:
```bash
Install the OpenCL backend with OpenJDK 21
$ ./bin/tornadovm-installer --jdk jdk21 --backend opencl
It is also possible to combine different backends:
$ ./bin/tornadovm-installer --jdk jdk21 --backend opencl,spirv,ptx ```
Alternatively, TornadoVM can be installed either manually from source or by using Docker.
If you are planning to use Docker with TornadoVM on GPUs, you can also follow these guidelines.
You can also run TornadoVM on Amazon AWS CPUs, GPUs, and FPGAs following the instructions here.
2. Usage Instructions
TornadoVM is currently being used to accelerate machine learning and deep learning applications, computer vision, physics simulations, financial applications, computational photography, and signal processing.
Featured use-cases:
- kfusion-tornadovm: Java application for accelerating a computer-vision application using the Tornado-APIs to run on discrete and integrated GPUs.
- Java Ray-Tracer: Java application accelerated with TornadoVM for real-time ray-tracing.
We also have a set of examples that includes NBody, DFT, KMeans computation and matrix computations.
Additional Information
- General Documentation
- Benchmarks
- How TornadoVM executes reductions
- Execution Flags
- FPGA execution
- Profiler Usage
3. Programming Model
TornadoVM exposes to the programmer task-level, data-level and pipeline-level parallelism via a light Application Programming Interface (API). In addition, TornadoVM uses single-source property, in which the code to be accelerated and the host code live in the same Java program.
Compute-kernels in TornadoVM can be programmed using two different approaches (APIs):
a) Loop Parallel API
Compute kernels are written in a sequential form (tasks programmed for a single thread execution). To express
parallelism, TornadoVM exposes two annotations that can be used in loops and parameters: a) @Parallel for annotating
parallel loops; and b) @Reduce for annotating parameters used in reductions.
The following code snippet shows a full example to accelerate Matrix-Multiplication using TornadoVM and the loop-parallel API:
```java public class Compute { private static void mxmLoop(Matrix2DFloat A, Matrix2DFloat B, Matrix2DFloat C, final int size) { for (@Parallel int i = 0; i < size; i++) { for (@Parallel int j = 0; j < size; j++) { float sum = 0.0f; for (int k = 0; k < size; k++) { sum += A.get(i, k) * B.get(k, j); } C.set(i, j, sum); } } }
public void run(Matrix2DFloat A, Matrix2DFloat B, Matrix2DFloat C, final int size) {
// Create a task-graph with multiple tasks. Each task points to an exising Java method
// that can be accelerated on a GPU/FPGA
TaskGraph taskGraph = new TaskGraph("myCompute")
.transferToDevice(DataTransferMode.FIRST_EXECUTION, A, B) // Transfer data from host to device only in the first execution
.task("mxm", Compute::mxmLoop, A, B, C, size) // Each task points to an existing Java method
.transferToHost(DataTransferMode.EVERY_EXECUTION, C); // Transfer data from device to host
// Create an immutable task-graph
ImmutableTaskGraph immutableTaskGraph = taskGraph.snaphot();
// Create an execution plan from an immutable task-graph
try (TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph)) {
// Run the execution plan on the default device
TorandoExecutionResult executionResult = executionPlan.execute();
} catch (TornadoExecutionPlanException e) {
// handle exception
// ...
}
}
} ```
b) Kernel API
Another way to express compute-kernels in TornadoVM is via the Kernel API.
To do so, TornadoVM exposes the KernelContext data structure, in which the application can directly access the thread-id, allocate
memory in local memory (shared memory on NVIDIA devices), and insert barriers.
This model is similar to programming compute-kernels in SYCL, oneAPI, OpenCL and CUDA.
Therefore, this API is more suitable for GPU/FPGA expert programmers that want more control or want to port existing
CUDA/OpenCL compute kernels into TornadoVM.
The following code-snippet shows the Matrix Multiplication example using the kernel-parallel API:
```java public class Compute { private static void mxmKernel(KernelContext context, Matrix2DFloat A, Matrix2DFloat B, Matrix2DFloat C, final int size) { int idx = context.globalIdx int jdx = context.globalIdy; float sum = 0; for (int k = 0; k < size; k++) { sum += A.get(idx, k) * B.get(k, jdx); } C.set(idx, jdx, sum); }
public void run(Matrix2DFloat A, Matrix2DFloat B, Matrix2DFloat C, final int size) {
// When using the kernel-parallel API, we need to create a Grid and a Worker
WorkerGrid workerGrid = new WorkerGrid2D(size, size); // Create a 2D Worker
GridScheduler gridScheduler = new GridScheduler("myCompute.mxm", workerGrid); // Attach the worker to the Grid
KernelContext context = new KernelContext(); // Create a context
workerGrid.setLocalWork(16, 16, 1); // Set the local-group size
TaskGraph taskGraph = new TaskGraph("myCompute")
.transferToDevice(DataTransferMode.FIRST_EXECUTION, A, B) // Transfer data from host to device only in the first execution
.task("mxm", Compute::mxmKernel, context, A, B, C, size) // Each task points to an existing Java method
.transferToHost(DataTransferMode.EVERY_EXECUTION, C); // Transfer data from device to host
// Create an immutable task-graph
ImmutableTaskGraph immutableTaskGraph = taskGraph.snapshot();
// Create an execution plan from an immutable task-graph
try (TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph)) {
// Run the execution plan on the default device
// Execute the execution plan
TorandoExecutionResult executionResult = executionPlan
.withGridScheduler(gridScheduler)
.execute();
} catch (TornadoExecutionPlanException e) {
// handle exception
// ...
}
}
} ```
Additionally, the two modes of expressing parallelism (kernel and loop parallelization) can be combined in the same task graph object.
4. Dynamic Reconfiguration
Dynamic reconfiguration is the ability of TornadoVM to perform live task migration between devices, which means that TornadoVM decides where to execute the code to increase performance (if possible). In other words, TornadoVM switches devices if it can detect that a specific device can yield better performance (compared to another).
With the task-migration, the TornadoVM's approach is to only switch device if it detects an application can be executed faster than the CPU execution using the code compiled by C2 or Graal-JIT, otherwise it will stay on the CPU. So TornadoVM can be seen as a complement to C2 and Graal JIT compilers. This is because there is no single hardware to best execute all workloads efficiently. GPUs are very good at exploiting SIMD applications, and FPGAs are very good at exploiting pipeline applications. If your applications follow those models, TornadoVM will likely select heterogeneous hardware. Otherwise, it will stay on the CPU using the default compilers (C2 or Graal).
To use the dynamic reconfiguration, you can execute using TornadoVM policies. For example:
java
// TornadoVM will execute the code in the best accelerator.
executionPlan.withDynamicReconfiguration(Policy.PERFORMANCE, DRMode.PARALLEL)
.execute();
Further details and instructions on how to enable this feature can be found here.
- Dynamic reconfiguration: https://dl.acm.org/doi/10.1145/3313808.3313819
5. How to Use TornadoVM in your Projects?
To use TornadoVM, you need two components:
a) The TornadoVM jar file with the API. The API is licensed as GPLV2 with Classpath Exception.
b) The core libraries of TornadoVM along with the dynamic library for the driver code (.so files for OpenCL, PTX
and/or SPIRV/Level Zero).
You can import the TornadoVM API by setting this the following dependency in the Maven pom.xml file:
```xml
To run TornadoVM, you need to either install the TornadoVM extension for GraalVM/OpenJDK, or run with our Docker images.
6. Additional Resources
Here you can find videos, presentations, tech-articles and artefacts describing TornadoVM, and how to use it.
7. Academic Publications
If you are using TornadoVM >= 0.2 (which includes the Dynamic Reconfiguration, the initial FPGA support and CPU/GPU reductions), please use the following citation:
bibtex
@inproceedings{Fumero:DARHH:VEE:2019,
author = {Fumero, Juan and Papadimitriou, Michail and Zakkak, Foivos S. and Xekalaki, Maria and Clarkson, James and Kotselidis, Christos},
title = {{Dynamic Application Reconfiguration on Heterogeneous Hardware.}},
booktitle = {Proceedings of the 15th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments},
series = {VEE '19},
year = {2019},
doi = {10.1145/3313808.3313819},
publisher = {Association for Computing Machinery}
}
If you are using Tornado 0.1 (Initial release), please use the following citation in your work.
bibtex
@inproceedings{Clarkson:2018:EHH:3237009.3237016,
author = {Clarkson, James and Fumero, Juan and Papadimitriou, Michail and Zakkak, Foivos S. and Xekalaki, Maria and Kotselidis, Christos and Luj\'{a}n, Mikel},
title = {{Exploiting High-performance Heterogeneous Hardware for Java Programs Using Graal}},
booktitle = {Proceedings of the 15th International Conference on Managed Languages \& Runtimes},
series = {ManLang '18},
year = {2018},
isbn = {978-1-4503-6424-9},
location = {Linz, Austria},
pages = {4:1--4:13},
articleno = {4},
numpages = {13},
url = {http://doi.acm.org/10.1145/3237009.3237016},
doi = {10.1145/3237009.3237016},
acmid = {3237016},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {Java, graal, heterogeneous hardware, openCL, virtual machine},
}
Selected publications can be found here.
8. Acknowledgments
This work is partially funded by Intel corporation. In addition, it has been supported by the following EU & UKRI grants (most recent first):
- EU Horizon Europe & UKRI AERO 101092850.
- EU Horizon Europe & UKRI P2CODE 101093069.
- EU Horizon Europe & UKRI ENCRYPT 101070670.
- EU Horizon Europe & UKRI TANGO 101070052.
- EU Horizon 2020 ELEGANT 957286.
- EU Horizon 2020 E2Data 780245.
- EU Horizon 2020 ACTiCLOUD 732366.
Furthermore, TornadoVM has been supported by the following EPSRC grants:
9. Contributions and Collaborations
We welcome collaborations! Please see how to contribute to the project in the CONTRIBUTING page.
Write your questions and proposals:
Additionally, you can open new proposals on the GitHub discussions page.
Alternatively, you can share a Google document with us.
Collaborations:
For Academic & Industry collaborations, please contact here.
10. TornadoVM Team
Visit our website to meet the team.
11. Licenses Per Module
To use TornadoVM, you can link the TornadoVM API to your application which is under Apache 2.
Each Java TornadoVM module is licensed as follows:
| Module | License |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Tornado-API | |
| Tornado-Runtime |
|
| Tornado-Assembly |
|
| Tornado-Drivers |
|
| Tornado-Drivers-OpenCL-Headers |
|
| Tornado-scripts |
|
| Tornado-Annotation |
|
| Tornado-Unittests |
|
| Tornado-Benchmarks |
|
| Tornado-Examples |
|
| Tornado-Matrices |
|
| | |
Owner
- Name: Beehive lab
- Login: beehive-lab
- Kind: organization
- Location: United Kingdom
- Website: http://apt.cs.manchester.ac.uk/
- Repositories: 38
- Profile: https://github.com/beehive-lab
Beehive lab is part of the Advanced Processor Technologies Group at the University of Manchester specializing in hw/sw codesign.
GitHub Events
Total
- Create event: 6
- Release event: 5
- Issues event: 38
- Watch event: 99
- Delete event: 2
- Issue comment event: 182
- Push event: 151
- Pull request review event: 240
- Pull request review comment event: 125
- Pull request event: 160
- Fork event: 10
Last Year
- Create event: 6
- Release event: 5
- Issues event: 38
- Watch event: 99
- Delete event: 2
- Issue comment event: 182
- Push event: 151
- Pull request review event: 240
- Pull request review comment event: 125
- Pull request event: 160
- Fork event: 10
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Juan Fumero | j****o@m****k | 3,565 |
| Michalis Papadimitriou | m****m@h****m | 1,723 |
| Thanos | t****o@g****m | 818 |
| James Clarkson | j****n@m****k | 500 |
| gigiblender | f****6@g****m | 269 |
| MaryXek | x****y@g****m | 265 |
| Juan Fumero | j****o@e****k | 197 |
| James Clarkson | c****j@c****k | 114 |
| Gyorgy Rethy | r****0@g****m | 96 |
| Christos Kotselidis | c****s@m****k | 38 |
| otabuzzman | i****k@g****m | 30 |
| foutrisn | n****s@m****k | 23 |
| Valery Silaev | v****v@g****m | 19 |
| andrii0lomakin | a****n@g****m | 10 |
| dependabot[bot] | 4****] | 10 |
| Benjamin Bell | b****2@p****k | 9 |
| grfrost | c****2 | 9 |
| Alireza Shateri | a****7@g****m | 8 |
| dalexandrov | m****v@g****m | 6 |
| SirYwell | h****e@o****e | 6 |
| Michalis Papadimitriou | m****m@p****n | 6 |
| Foivos Zakkak | f****k@m****k | 5 |
| Gaurav Gaur | v****v@g****m | 4 |
| yc128 | 8****8 | 1 |
| krzychus | k****z@u****h | 1 |
| Tianyu Zuo | z****s@f****m | 1 |
| Juan Fumero | j****o@m****k | 1 |
| gigiblender | f****u@s****k | 1 |
| juanfumero | j****o@c****k | 1 |
| Mark J. Williamson | m****w@m****e | 1 |
| and 2 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 143
- Total pull requests: 447
- Average time to close issues: 3 months
- Average time to close pull requests: 6 days
- Total issue authors: 51
- Total pull request authors: 14
- Average comments per issue: 3.05
- Average comments per pull request: 1.29
- Merged pull requests: 374
- Bot issues: 0
- Bot pull requests: 9
Past Year
- Issues: 29
- Pull requests: 194
- Average time to close issues: 11 days
- Average time to close pull requests: 5 days
- Issue authors: 16
- Pull request authors: 4
- Average comments per issue: 3.9
- Average comments per pull request: 1.13
- Merged pull requests: 158
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jjfumero (23)
- andrii0lomakin (16)
- stratika (12)
- yazun (9)
- mikepapadim (7)
- vsilaev (7)
- nailh-boop (5)
- gigiblender (4)
- Vinhixus (4)
- yrq0208 (3)
- TaisZ (3)
- bitstuffing (3)
- gwinstanley (2)
- jnorthrup (2)
- ItayShtainberg (2)
Pull Request Authors
- jjfumero (220)
- stratika (87)
- mikepapadim (75)
- mairooni (37)
- dependabot[bot] (9)
- andrii0lomakin (7)
- gigiblender (3)
- otabuzzman (2)
- coldav (2)
- yazun (1)
- yc128 (1)
- kabutz (1)
- luisa-poeschl (1)
- jnorthrup (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 32
proxy.golang.org: github.com/beehive-lab/TornadoVM
- Documentation: https://pkg.go.dev/github.com/beehive-lab/TornadoVM#section-documentation
- License: apache-2.0
-
Latest release: v1.1.1
published 8 months ago
Rankings
proxy.golang.org: github.com/beehive-lab/tornadovm
- Documentation: https://pkg.go.dev/github.com/beehive-lab/tornadovm#section-documentation
- License: apache-2.0
-
Latest release: v1.1.1
published 8 months ago
Rankings
Dependencies
- org.openjdk.jmh:jmh-generator-annprocess 1.29 provided
- junit:junit 4.13.1
- org.apache.logging.log4j:log4j-api 2.17.1
- org.apache.logging.log4j:log4j-core 2.17.1
- org.apache.lucene:lucene-core 8.2.0
- org.openjdk.jmh:jmh-core 1.29
- ${project.groupId}:tornado-runtime ${project.version}
- org.ow2.asm:asm 9.2
- readthedocs-sphinx-search ==0.1.1
- sphinx ==5.3.0
- sphinx_rtd_theme ==1.1.1
- ${project.groupId}:tornado-annotation ${project.version}
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-benchmarks ${project.version}
- ${project.groupId}:tornado-drivers-common ${project.version}
- ${project.groupId}:tornado-examples ${project.version}
- ${project.groupId}:tornado-matrices ${project.version}
- ${project.groupId}:tornado-runtime ${project.version}
- ${project.groupId}:tornado-unittests ${project.version}
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-matrices ${project.version}
- org.apache.commons:commons-lang3 3.12.0
- org.apache.commons:commons-math3 3.6.1
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-drivers-common ${project.version}
- tornado:tornado-runtime ${tornado.version}
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-drivers-common ${project.version}
- tornado:tornado-drivers-opencl ${project.version} compile
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-drivers-common ${project.version}
- beehive-lab:beehive-spirv-lib 0.0.2
- ${project.groupId}:tornado-api ${project.version} compile
- ${project.groupId}:tornado-matrices ${project.version} compile
- ${project.groupId}:tornado-api ${project.version}
- org.ejml:ejml-simple 0.38
- ${project.groupId}:tornado-api ${project.version}
- ${project.groupId}:tornado-api ${project.version} compile
- junit:junit 4.13.2
- org.apache.lucene:lucene-core