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

Option to select the SPIR-V Runtime Dispatcher #451

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

jjfumero
Copy link
Member

@jjfumero jjfumero commented Jun 17, 2024

Description

This PR adds an option in the TornadoOptions to select which runtime we want as default to dispatch SPIR-V code.
By default. TornadoVM currently selects the OpenCL, but the user now can override this by using the following option:

  • Use -Dtornado.spirv.dispatcher=opencl to select OpenCL as default.
  • Use -Dtornado.spirv.dispatcher=levelzero to select LevelZero as default.

This is useful to pass, for example, all tests with another Runtime Dispatcher for SPIR-V.

$ make tests-spirv-levelzero 

$ make tests-spirv-opencl

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?

make BACKEND=spirv

tornado --jvm="-Dtornado.spirv.dispatcher=opencl" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

tornado --jvm="-Dtornado.spirv.dispatcher=levelzero" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

## If set a random value
tornado --jvm="-Dtornado.spirv.dispatcher=foo" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

#We get an error

- Use "-Dtornado.spirv.dispatcher=opencl" to select OpenCL as default.
- Use "-Dtornado.spirv.dispatcher=levelzero" to select LevelZero as default.
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

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.

LGTM, just a minor suggestions to clarify the default option of the flag.

…/common/TornadoOptions.java

Co-authored-by: Thanos Stratikopoulos <34061419+stratika@users.noreply.github.com>
@jjfumero jjfumero merged commit c29d72c into beehive-lab:develop Jun 17, 2024
2 checks passed
@jjfumero jjfumero deleted the feat/spirv/switching branch June 17, 2024 15:18
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