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

Execution of empty task graph with registered objects causes cryptic assertion error #489

Open andrii0lomakin opened 1 month ago

andrii0lomakin commented 1 month ago

Good day. I mistakenly created two task graphs and registered objects to transfer in one graph but tasks in the other one. Then I executed a graph with 0 amount of tasks and registered transfer objects. As a result, I got a cryptic assertion error (only because assertions were enabled).

That does not allow for identifying such issues correctly.

stratika commented 1 month ago

hi @andrii0lomakin, thanks for the report. To understand better, did you try something similar to this?

TaskGraphgraph = new TaskGraph("s0");
graph.transferToDevice(DataTransferMode.FIRST_EXECUTION, input) 
          .transferToHost(DataTransferMode.EVERY_EXECUTION, output);

ImmutableTaskGraph immutableTaskGraph = graph.snapshot();
TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph);
executionPlan.execute();

How did you enable the assertions? And what is the exact error message you got?

andrii0lomakin commented 1 month ago

@stratika I have used -ea -da:org.graalvm.compiler... You can find the reproducer there: https://github.com/babylonml/tornadovm-bugs/blob/main/src/test/kotlin/com/babylonml/EmptyTaskGraph.kt . To run the test, please specify the TornadoVM SDK location using the babylonml.tornadovm.home property.