beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.17k stars 110 forks source link

Batch Processing with Multiple tasks in a task-graph #332

Closed jjfumero closed 6 months ago

jjfumero commented 6 months ago

Description

This fixes and adds support for batch processing when having a TaskGraph with multiple tasks. Besides, it removes old/unreachable methods that are not needed anymore.

However, this PR still has the issue of incorrect results when the task-graph does not perform a copy-in. I added two more unit-tests, one with copy in and the other without. It seems that without copy-in, the batch processing works (compiler and internals of the runtime), but the results are not correct.

For task-graphs with copy-in/out (which was the original intended use), multiple tasks in a taskgraph with batch processing now works. We can go ahead this is partial fix, and add a new extension on top of this to process also for only outputs.

Problem description

The issue was that, when having multiple tasks in a task-graph, the TornadoVM interpreter was not invalidating the code cache (to force recompilation).

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

How to test the new patch?

$ make
$ tornado-test -V --fast --debug --threadInfo --printKernel --printBytecode uk.ac.manchester.tornado.unittests.batches.TestBatches#testBatchNotEven
$ tornado-test -V --fast --debug --threadInfo --printKernel --printBytecode uk.ac.manchester.tornado.unittests.batches.TestBatches#testBatchNotEven2