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 Refactoring and Documentation #455

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

jjfumero
Copy link
Member

@jjfumero jjfumero commented Jun 19, 2024

Description

API Refactoring (no need for loaders of the Device specific implementations) and documentation for the Backend API.
Major list of changes:

  • Javadoc for the Backend API (TornadoBackend, Policy, WorkerGrid
  • Cleanup unused methods
  • Rename TornadoRuntime to TornadoRuntimeProvider
  • Rename TornadoRuntimeInterface to TornadoRuntime
  • Rename TornadoSettingsInterface to TornadoSettings
  • Remove loaders for device-specific backends. There is no need to have this anymore.

Problem description

If the patch provides a fix for a bug, please describe what was the issue and how to reproduce the issue.

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 BACKEND=spirv,opencl,ptx
make tests

* Perform dynamic reconfiguration based on best end-to-end runtime, including compilation,
* data transfers and execution. In this mode, the TornadoVM runtime will compile and
* run the whole application for every reachable accelerator. In this mode, there is no
* warm-up. The dynamic reconfiguration switches device best on the lowest end-to-end runtime.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rephrase the last sentence.

Comment on lines 32 to 33
* The dynamic reconfiguration switches device best of highest-performance
* (lowest end-to-end runtime).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rephrase this sentence.

* could be 1D, 2D or 3D.
*
* @return int
*/
int dimension();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we refactor this method to numOfDimensions?

Copy link
Member Author

@jjfumero jjfumero Jun 20, 2024

Choose a reason for hiding this comment

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

I think dimension is ok for now. The usage is something like:

WorkerGrid worker = new WorkerGrid2D();
int val = worker.dimension();

This looks clean to me without loosing any meaning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

to me the dimension could be that you query if you have a 3 dimensional array to get one specific dimension (0, 1, 2). But that's fine for now, and in the java doc it is clear.

Comment on lines 9 to 18
public class TestRuntimeAPI extends TornadoTestBase {

@Test
public void test01() {

TornadoRuntime runtimeInterface = TornadoRuntimeProvider.getTornadoRuntime();

runtimeInterface.getBackend(0).getNumDevices();
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we add this test in unit-tests?

jjfumero and others added 4 commits June 20, 2024 07:20
…java

Co-authored-by: Thanos Stratikopoulos <34061419+stratika@users.noreply.github.com>
…java

Co-authored-by: Thanos Stratikopoulos <34061419+stratika@users.noreply.github.com>
…Backend.java

Co-authored-by: Thanos Stratikopoulos <34061419+stratika@users.noreply.github.com>
@jjfumero
Copy link
Member Author

Thanks @stratika . All changes done.

@stratika
Copy link
Collaborator

Perfect! LGTM, let's merge first #456 in order to try this PR also with Ray-Tracer, before merging with develop.

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

@jjfumero jjfumero merged commit 4f5e0df into beehive-lab:develop Jun 20, 2024
2 checks passed
@jjfumero jjfumero deleted the docs/backends/api branch June 20, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants