javajvmgpuhardware-acceleration

How can the JVM be accelerated using a GPU?


While this question is similar to what's here and there in that the problem being addressed is about the same, It's different since it's about finding ways to actually accelerate the JVM itself rather than some certain/specific parts of a Java program/project.

I just recently looked up TornadoVM here and I was wondering if there are virtual software environments/containers capable of running/accelerating the JVM by providing it access to multiple threads via instances spawned from heterogeneous hardware (CPUs + GPUs).

Hypothetically speaking, say I have a fleet of CPUs and GPUs, I am simply asking about ways one can successfully go about running a JVM program (capable of handling 1,000,000+ threads simultaneously) across all devices on my fleet.


Solution

  • This is an interesting question. It all depends on which parts of the JVM you want to accelerate on GPUs, and if those parts are suitable for acceleration or not. Is it the bytecode interpreter? GC? There are academic works in these areas.

    For example, this work (code) defines a byte-code interpreter suitable for acceleration on GPUs and FPGAs. This work proposes the use of heterogenous hardware, not only for the acceleration of user applications, but system applications (VMs, operating systems, etc).

    For instance, this work proposes to integrate parallel tasks, that can run on GPUs, into the OS, and safe, for example, data transfer across different processes that want to use the same GPU.

    Regarding TornadoVM, it can accelerate Java programs. Thus, if the JVM would have been implemented in Java, then some software components can be accelerated with TornadoVM. There are works already accelerating other Java-based Virtual Machines, such as GraalVM for R programs (not using TornadoVM):