Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TornadoVM stuck when excuting the unsupported example #244

Open
TaisZ opened this issue Apr 24, 2023 · 1 comment
Open

TornadoVM stuck when excuting the unsupported example #244

TaisZ opened this issue Apr 24, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@TaisZ
Copy link
Contributor

TaisZ commented Apr 24, 2023

Describe the bug

Recursion is not supported in TornadoVM. It is expected that TornadoVM should throw some exceptions. However, the problem seems that the execution hangs and it gets stuck. The bug reason may be the same as #240

How To Reproduce

I created the following example:
tornado-examples/src/main/java/uk/ac/manchester/tornado/examples/Broken/Recursion.java

package uk.ac.manchester.tornado.examples.Broken;

import uk.ac.manchester.tornado.api.ImmutableTaskGraph;
import uk.ac.manchester.tornado.api.TaskGraph;
import uk.ac.manchester.tornado.api.TornadoExecutionPlan;
import uk.ac.manchester.tornado.api.annotations.Parallel;
import uk.ac.manchester.tornado.api.enums.DataTransferMode;

import java.util.Arrays;

public class Recursion {

    public static void recursion(int a, int b){
        if(a == 0) b += 1;

        for (@Parallel int i = 0; i<a; i++){
            recursion(a-1, b);
        }
    }

    public static void main(String[] args) {
        int a = 3;
        int b = 0;

        TaskGraph taskGraph = new TaskGraph("s0") //
                .transferToDevice(DataTransferMode.FIRST_EXECUTION, a) //
                .task("t0", Recursion::recursion, a, b) //
                .transferToHost(DataTransferMode.EVERY_EXECUTION, b);

        ImmutableTaskGraph immutableTaskGraph = taskGraph.snapshot();
        TornadoExecutionPlan executor = new TornadoExecutionPlan(immutableTaskGraph);
        executor.execute();

    }
}

Output

Run the example by the following command:
tornado --fullDebug -m tornado.examples/uk.ac.manchester.tornado.examples.Broken.Recursion

Console output:

WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign
Loading DRIVER: uk.ac.manchester.tornado.drivers.opencl.OCLTornadoDriverProvider@2df32bf7
Loading DRIVER: uk.ac.manchester.tornado.drivers.ptx.PTXTornadoDriverProvider@7ac296f6

Computing system setup (please complete the following information):

  • OS: Ubuntu 22.4
  • Driver versions: Nvidia 530.30.02
  • OpenCL versions: 3.0
  • CUDA Driver versions: 12.1.68
  • GPU: RTX 3080
  • TornadoVM commit id: 8fe1d4e
@jjfumero
Copy link
Member

Thanks for the report. We will investigate this case and let you know.

@jjfumero jjfumero self-assigned this Apr 26, 2023
@jjfumero jjfumero added the bug Something isn't working label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants