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

Transfer to host in execution result. #477

Open
jjfumero opened this issue Jul 2, 2024 Discussed in #476 · 0 comments
Open

Transfer to host in execution result. #477

jjfumero opened this issue Jul 2, 2024 Discussed in #476 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jjfumero
Copy link
Member

jjfumero commented Jul 2, 2024

Discussed in #476

Originally posted by andrii0lomakin July 2, 2024
Hi guys.
I have tried very simple test case:

public static void main(String[] args) {
        var taskGraph = new TaskGraph("SimpleGraph");
        var input = new FloatArray(10);
        for (int i = 0; i < 10; i++) {
            input.set(i, i + 1);
        }


        var output = new FloatArray(10);
        for (int i = 0; i < 10; i++) {
            output.set(i, 1.1f);
        }

        taskGraph.transferToDevice(DataTransferMode.EVERY_EXECUTION, input);
        taskGraph.task("copyVectorForBroadcast", (in, out) ->
                        TvmVectorOperations.copyVector(in, 0, out, 0, 10),
                input, output);
       // taskGraph.transferToHost(DataTransferMode.EVERY_EXECUTION, output);
        ImmutableTaskGraph immutableTaskGraph = taskGraph.snapshot();

        // Create an execution plan from an immutable task-graph
        try (TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph)) {
            // Run the execution plan on the default device
            var result = executionPlan.execute();
            result.transferToHost(output);

            System.out.println("Execution completed " + Arrays.toString(output.toHeapArray()));
        } catch (TornadoExecutionPlanException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

If I uncomment transferToHost line in execution graph everything works as expected.
But should not it work even without this line because I call transferToHost in execution result ?

@jjfumero jjfumero added the bug Something isn't working label Jul 2, 2024
@jjfumero jjfumero self-assigned this Jul 2, 2024
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
None yet
Development

No branches or pull requests

1 participant