Coder Social home page Coder Social logo

tornado-insight's Introduction

TornadoInsight: Unleashing the Power of TornadoVM in IntelliJ IDEA

TornadoInsight is an open source IntelliJ plugin that aims to enhance the experience of developers when working with TornadoVM. It provides a built-in on-the-fly static checker, empowering developers to identify unsupported Java features in TornadoVM and understand the reasons behind these limitations. Additionally, it introduces a dynamic testing framework that enables developers to easily test individual TornadoVM tasks. It automatically wraps TornadoVM tasks, invoking the native TornadoVM runtime on the developers' machines for seamless debugging and testing.

Key Features:

1. On-the-Fly Static Checker

TornadoInsight is equipped with an on-the-fly static checker. This tool scans TornadoVM code in real time, pinpointing any Java features that are not supported by TornadoVM. Through instant notifications, developers gain immediate insights into potential compatibility issues, allowing for proactive adjustments and adherence to the TornadoVM guidelines. Currently, the static checker performs checks for datatypes, Traps/Exceptions, recursion, native method calls, assert statements.

TornadoInsight provides a tool window to view detailed information emerging from the static inspection of TornadoInsight.

2. Dynamic Testing Framework

TornadoInsight simplifies the testing process for individual TornadoVM tasks. After creating a TornadoVM task, there is no need to write the main method or initialize the method parameters. You only need to select the method in the tool window of TornadoInsight to test it.

With its dynamic testing framework, developers can seamlessly conduct tests on specific tasks within their codebase. TornadoInsight dynamically generates a test file and automatically generates the Main method and the TaskGraph required by TornadoVM. In turn, it automatically creates and initializes the input/output variables according to the parameter types. Then, TornadoInsight invokes the TornadoVM runtime on the developer's machine to run the generated Java class. This functionality streamlines the debugging process, making it convenient for developers to identify and resolve issues in their TornadoVM applications. If a TornadoVM task is compatible with TornadoVM, the test will output the generated OpenCL kernel code for it, so that developers can test it. If it is not compatible, it will output an exception. In addition, the elapsed time for running the checks is displayed in the bottom right corner.

How to use TornadoInsight?

This section covers the initial steps that are required in order to correctly setup the plugin project inside the IntelliJ IDE.

Folder layout

The output of this folder is as follows:

 idea
   |-src
     |-main
       |-java (plugin sources)
       |-resources (plugin resources - the plugin.xml file lives here)
   |-build (where build files are stored)
       |-distributions (where the plugin zip file is generated)   
   |-build.gradle (the gradle build file)
   |-gradle.properties (contains properties required to build this project)

Building the plugin

This plugin can be built with gradle. To build the plugin, simply run the following command from the idea folder:

sh gradlew clean build This will download gradle and the required IntelliJ dependencies, will build the plugin and will place the results in the build/distributions folder. Once the build is configured correctly, the plugin can even be tested in a sandbox environment, as follows:

sh gradlew runIde

Installing the plugin

To install the plugin in your IDE, first you need to build a plugin module file (a .zip file), as described in the previous section.

Once the plugin zip has been obtained, it can be installed in the IDE; go in Help -> Find Action..., and type Install plugin from disk, and then select the corresponding action from the drop down list. A new file dialog will pop up: point the IDE to the zip file you have created in the step above. The IDE will require a restart - once restart is completed the installation process is completed, and the plugin is ready to be used to run and debug jtreg tests.

Using TornadoInsight

Pre-requisites

TornadoInsight invokes at runtime Java and TornadoVM on the developers' local machine, and therefore, developers need to make sure that they have installed those prior to using the plugin.

Configuring TornadoInsight

The dynamic inspection feature of TornadoInsight is configured after the installation of the plugin, as follows:

  • Navigate to "Preferences" or "Settings" depending on your operating system.
  • Select "TornadoInsight" from the menu.

Developers should configure the TornadoVM root directory (i.e. the path to the TornadoVM cloned repository) and select a JDK which should be >= JDK 21. Additionally, developers should indicate a tentative "array size" that can be used by TornadoInsight to set the size of the input and output arrays of a TornadoVM task.

Limitations

1. No support for non-JDK method invocations

TornadoInsight, in its current state, lacks support for dynamic inspection of references. This limitation arises due to the nature of the dynamically generated Java code during the dynamic inspection process. The Java code is derived from a copy of the Tornado task method, and in this copying process, automatic handling of non-JDK method invocations and global variable replacements is not performed.

2.No support for TornadoVM Kernel API

The TornadoVM Kernel API is another way to express compute-kernels in TornadoVM. TornadoInsight does not support the Kernel API because it currently uses the Loop Parallel API: @Parallel and @Reduce to locate TornadoVM Tasks.

Acknowledgments

This work is partially supported by the following EU & UKRI grants (most recent first):

License

License: Apache 2

tornado-insight's People

Contributors

stratika avatar taisz avatar sarpharbali avatar kotselidis avatar jjfumero avatar

Stargazers

Taketoday avatar Engine avatar  avatar MushroomGua avatar  avatar  avatar Michalis Papadimitriou avatar Zaiyu Cheng avatar  avatar  avatar  avatar

Watchers

Cosmin Gorgovan avatar  avatar Michalis Papadimitriou avatar  avatar  avatar

Forkers

taisz sarpharbali

tornado-insight's Issues

Add a limitations list

Add a limitations list in the README file to show the current limitations of TornadoInsight.

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.