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

New calls to profile the Execution Plan: withThreadInfo and withPrintKernel #340

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

jjfumero
Copy link
Member

Description

This PR enables two more methods in the TornadoExecutionPlan API to debug the kernels and the code dispatcher (number of threads and device in which each task in an immutable task-graph will be executed).

This PR introduces the following methods in the task-graph:

TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph);
executionPlan
       .withThreadInfo()  // new method to print the thread deployment - same action as --threadInfo from the command line
       .withPrintKernel() // new method to dump the generated kernel. Same action as the --printKernel from the command line 
       .execute();

Problem description

Apart from the

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?

$ make 
$ tornado-test -V uk.ac.manchester.tornado.unittests.foundation.TestIntegers#test06
$ tornado-test -V uk.ac.manchester.tornado.unittests.foundation.TestIntegers#test07
$ tornado-test -V uk.ac.manchester.tornado.unittests.profiler.TestProfiler#testKernelOnAndOff 
$ tornado-test -V uk.ac.manchester.tornado.unittests.profiler.TestProfiler#testThreadInfoOnAndOff
$ make tests 

@jjfumero jjfumero added enhancement New feature or request API feature New feature proposal labels Feb 22, 2024
@jjfumero jjfumero self-assigned this Feb 22, 2024
Copy link
Collaborator

@mairooni mairooni left a comment

Choose a reason for hiding this comment

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

LGTM

public String toString() {
return String.format("task meta data: domain=%s, global workgroup size=%s%n", domain, (getGlobalWork() == null) ? "null" : formatWorkDimensionArray(getGlobalWork(), "1"));
}
// @Override
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. This was for debugging. I will revert this.

Copy link
Member

@mikepapadim mikepapadim left a comment

Choose a reason for hiding this comment

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

LGTM

@jjfumero jjfumero merged commit c36582a into beehive-lab:develop Feb 26, 2024
2 checks passed
@jjfumero jjfumero deleted the feat/api/info branch February 26, 2024 08:35
jjfumero added a commit that referenced this pull request Feb 29, 2024
Improvements
~~~~~~~~~~~~~~~~~~

- `#323 <https://github.com/beehive-lab/TornadoVM/pull/323>`_: Set Accelerator Memory Limit per Execution Plan at the API level
- `#328 <https://github.com/beehive-lab/TornadoVM/pull/328>`_: Javadoc API to run with concurrent devices and memory limits
- `#340 <https://github.com/beehive-lab/TornadoVM/pull/340>`_: New API calls to enable ``threadInfo`` and ``printKernel`` from the Execution Plan API.
- `#334 <https://github.com/beehive-lab/TornadoVM/pull/334>`_: Dynamically enable/disable profiler after first run

Compatibility
~~~~~~~~~~~~~~~~~~

- `#337 <https://github.com/beehive-lab/TornadoVM/pull/337>`_ : Initial support for Graal and JDK 21.0.2

Bug Fixes
~~~~~~~~~~~~~~~~~~

- `#322 <https://github.com/beehive-lab/TornadoVM/pull/322>`_: Fix duplicate thread-info debug message when the debug option is also enabled.
- `#325 <https://github.com/beehive-lab/TornadoVM/pull/325>`_: Set/Get accesses for the ``MatrixVectorFloat4`` type fixed
- `#326 <https://github.com/beehive-lab/TornadoVM/pull/326>`_: Fix installation script for running with Python >= 3.12
- `#327 <https://github.com/beehive-lab/TornadoVM/pull/327>`_: Fix Memory Limits for all supported Panama off-heap types.
- `#329 <https://github.com/beehive-lab/TornadoVM/pull/329>`_: Fix timers for the dynamic reconfiguration policies
- `#330 <https://github.com/beehive-lab/TornadoVM/pull/330>`_: Fix the profiler logs when silent mode is enabled
- `#332 <https://github.com/beehive-lab/TornadoVM/pull/332>`_: Fix Batch processing when having multiple task-graphs in a single execution plan.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request feature New feature proposal
Projects
Development

Successfully merging this pull request may close these issues.

3 participants