beehive-lab / TornadoVM

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

[hotfix] Avoid cycles due to the revisiting of same nodes #456

Closed stratika closed 2 weeks ago

stratika commented 2 weeks ago

Description

We identified a bug in TornadoVM-Ray-Tracer which we tried to detect the source of it, since tornado version v1.0.4 was working.

After looking at it, we figured out that the problem was in the TornadoBatchFunctionAnalysis.java class. This class is used in the Sketcher to analyze the IR graph and detect if the loop index is being written in an output buffer. The problem was attributed to potential cycles that were resulting in a propagation of a null pointer that was then triggered by the TornadoVM-Ray-Tracer application.

This PR provides a fix.

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?

Run the unit-tests for all backends:

make BACKEND=opencl
tornado-test -V --fast uk.ac.manchester.tornado.unittests.batches.TestBatches
make BACKEND=ptx
tornado-test -V --fast uk.ac.manchester.tornado.unittests.batches.TestBatches
make BACKEND=spirv
tornado-test -V --fast uk.ac.manchester.tornado.unittests.batches.TestBatches

Additionally, try to run the TornadoVM-Ray-Tracer for the branch from my fork repository. OpenCL and SPIR-V seem to be working again, PTX seems to have an error.

git checkout upgrade/api/1.0.6-dev
mvn clean install
tornadovm-ray-tracer