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

[API] New API call in the Execution Plan to log/trace the plan #565

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

jjfumero
Copy link
Member

Description

This patch extends the API with a new method to log/dump the operations enabled for the TornadoVM execution plan.

New methods:

plan.printTraceExecutionPlan();

String s = plan.getTraceExecutionPlan()

How to use it?

// Testing multiple functions to invoke the print logic plan later
executionPlan.withWarmUp() //
      .withDevice(device) //
      .withGridScheduler(grid) //
      .withThreadInfo() //
      .withProfiler(ProfilerMode.SILENT);

// When we call execute(), then it records the path 
executionPlan.execute();

Output:

Root
 -> withWarmUp 
 -> withDevice 
 -> withGridScheduler 
 -> withThreadInfo 
 -> withProfiler 

Problem description

n/a.

Backend/s tested

Mark the backends affected by this PR.

  • OpenCL
  • PTX
  • SPIRV

OS tested

Mark the OS where this PR is tested.

  • Linux
  • OSx
  • Windows

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

  • Yes
  • No

How to test the new patch?

tornado-test -V --fast uk.ac.manchester.tornado.unittests.executor.TestExecutor#test05
make tests

@jjfumero jjfumero changed the title [API] [API] New API call in the Execution Plan to log/trace the plan Sep 27, 2024

import uk.ac.manchester.tornado.api.TornadoExecutionPlan;

public sealed class ExecutionPlanType extends TornadoExecutionPlan //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to make the ExecutionPlan types records instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExecutionPlanType cotains mutable fields and it extends another class, so we can't.

Copy link
Collaborator

@stratika stratika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor changes suggested, thanks for the PR.

@jjfumero
Copy link
Member Author

Thank you @stratika , I refactored the classes.

@stratika
Copy link
Collaborator

Thank you @stratika , I refactored the classes.

perfect, I will do final testing before the approval.

Copy link
Collaborator

@stratika stratika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Linux OS, all backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants