This tool extracts runtime and hardware features from a TornadoVM application and uses them to predict the optimal device for executing a given workload. It then runs the workload on the predicted device and reports performance.
This project performs the following steps:
- Code Feature Extraction: Runs the specified TornadoVM example to collect code-level metrics.
- Device Detection: Lists all available computing devices (CPU, GPU, iGPU).
- Feature Parsing: Loads extracted features from a JSON format.
- Device Prediction: Predicts the best device for execution based on feature analysis.
- Workload Execution: Runs the computation on the predicted optimal device.
Before running the script, make sure you have:
- TornadoVM installed with the OpenCL backend.
- A compatible Java 21+ GraalVM environment.
- Python 3 with necessary dependencies (for the extractor script).
- Your environment variables properly configured.
Before running the script, configure your environment:
export JAVA_HOME=/path/to/graalvm
export PATH=/path/to/tornadovm/bin:$PATH
export TORNADO_SDK=/path/to/tornadovm/sdk
source setvars.sh
Replace /path/to/... with your actual local paths.
To run the feature extraction and execution pipeline on a sample matrix multiplication workload:
python tornado_inference_runner -e tornado.examples/uk.ac.manchester.tornado.examples.compute.MatrixMultiplication1D -s 1024
Argument | Description | Default |
---|---|---|
-e, --example |
TornadoVM example class to run | Required |
-s, --size |
Input size for the computation | Required |
-m, --model-dir |
Directory containing trained models | Current directory |
-f, --features-dir |
Directory where features.json will be saved | /home/mikepapadim/manchester/TornadoVM/ |
-t, --tornado-path |
Path to tornado command | tornado |
-v, --verbose |
Enable verbose output | False |
After running the tool, you'll see:
- Feature extraction summary
- Available devices, including GPU and iGPU details
- Predicted optimal device based on extracted features
- Actual execution on the predicted device
- Final analysis summary
This version currently operates with TornadoVM-supported backends (OpenCL tested). It supports automatic device selection based on extracted features.
- See Developer Guide for detailed CLI options, error handling, and integration info.
- See Inference Engine Guide for detailed information on the prediction system.
This work is supported by UK Research and Innovation (UKRI) under the UK government’s Horizon Europe funding guarantee for grant number 10039107 TANGO.
MIT