This is @jjfumero work on enabling MTMD behaviour through the Taskgraph API.
This PR enables device selection as part of the API instead of command line arguments which is currently supported.
It allows to run multiple tasks on multiple devices, single or multi-threaded as part of the standard ExecutionPlan in TornadoVM. It introduces the withConcurrentDevices and withoutConcurrentDevices calls as an extension to the original withDevice API call.
Example usage with concurrent execution:
TornadoDevice device0 = TornadoRuntime.getTornadoRuntime().getDriver(0).getDevice(0);
TornadoDevice device1 = TornadoRuntime.getTornadoRuntime().getDriver(0).getDevice(1);
// Extension for multi-device: This will run one task after the other in parallel
executionPlan.withConcurrentDevices() //
.withDevice("graph.task0", device0) //
.withDevice("graph.task1", device1);
// Blocking call
executionPlan.execute();
Example usage with serial execution:
TornadoDevice device0 = TornadoRuntime.getTornadoRuntime().getDriver(0).getDevice(0);
TornadoDevice device1 = TornadoRuntime.getTornadoRuntime().getDriver(0).getDevice(1);
// Extension for multi-device: This will run one task after the other in parallel
executionPlan.withoutConcurrentDevices() //
.withDevice("graph.task0", device0) //
.withDevice("graph.task1", device1);
// Blocking call
executionPlan.execute();
Note:
Previous behaviour available from the command line:
Description
This is @jjfumero work on enabling MTMD behaviour through the
Taskgraph
API.This PR enables device selection as part of the API instead of command line arguments which is currently supported. It allows to run multiple tasks on multiple devices, single or multi-threaded as part of the standard
ExecutionPlan
in TornadoVM. It introduces thewithConcurrentDevices
andwithoutConcurrentDevices
calls as an extension to the originalwithDevice
API call.Example usage with concurrent execution:
Example usage with serial execution:
Note: Previous behaviour available from the command line:
Backend/s tested
Mark the backends affected by this PR.
OS tested
Mark the OS where this PR is tested.
How to test the new patch?