-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix issue with multiple SPIR-V devices #552
Merged
jjfumero
merged 5 commits into
beehive-lab:develop
from
mairooni:fix/spirv/multi-device
Sep 10, 2024
Merged
Fix issue with multiple SPIR-V devices #552
jjfumero
merged 5 commits into
beehive-lab:develop
from
mairooni:fix/spirv/multi-device
Sep 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stratika
approved these changes
Sep 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I tested it on the server that has two LevelZero devices.
jjfumero
approved these changes
Sep 9, 2024
jjfumero
added a commit
to jjfumero/TornadoVM
that referenced
this pull request
Sep 30, 2024
Improvements ============ - beehive-lab#565: New API call in the Execution Plan to log/trace the executed configuration plans. - beehive-lab#563: Expand the TornadoVM profiler with Level Zero Sysman Energy Metrics. - beehive-lab#559: Refactoring Power Metric handlers for PTX and OpenCL. - beehive-lab#548: Benchmarking improvements. - beehive-lab#549: Prebuilt API tests added using multiple backend-setup. - Add internal tests for monitoring memory management [link](beehive-lab@0644225). Compatibility ============= - beehive-lab#561: Build for OSx 14.6 and OSx 15 fixed. Bug Fixes ============== - beehive-lab#564: Jenkins configuration fixed to run KFusion per backend. - beehive-lab#562: Warmup action from the Execution Plan fixed to run with correct internal IDs. - beehive-lab#557: Shared Execution Plans Context fixed. - beehive-lab#553: OpenCL compiler flags for Intel Integrated GPUs fixed. - beehive-lab#552: Fixed runtime to select any device among multiple SPIR-V devices. - Fixed zero extend arithmetic operations: [link](beehive-lab@ea7b602).
jjfumero
added a commit
to jjfumero/TornadoVM
that referenced
this pull request
Sep 30, 2024
Improvements ============ - beehive-lab#565: New API call in the Execution Plan to log/trace the executed configuration plans. - beehive-lab#563: Expand the TornadoVM profiler with Level Zero Sysman Energy Metrics. - beehive-lab#559: Refactoring Power Metric handlers for PTX and OpenCL. - beehive-lab#548: Benchmarking improvements. - beehive-lab#549: Prebuilt API tests added using multiple backend-setup. - Add internal tests for monitoring memory management [link](beehive-lab@0644225). Compatibility ============= - beehive-lab#561: Build for OSx 14.6 and OSx 15 fixed. Bug Fixes ============== - beehive-lab#564: Jenkins configuration fixed to run KFusion per backend. - beehive-lab#562: Warmup action from the Execution Plan fixed to run with correct internal IDs. - beehive-lab#557: Shared Execution Plans Context fixed. - beehive-lab#553: OpenCL compiler flags for Intel Integrated GPUs fixed. - beehive-lab#552: Fixed runtime to select any device among multiple SPIR-V devices. - Fixed zero extend arithmetic operations: [link](beehive-lab@ea7b602).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
It was observed that when having more than one SPIR-V devices, the following error was generated depending on the specified device of execution.
This PR proposes a fix.
Problem description
The error above is generated from this function of the
SPIRVTornadoDevice
class:Specifically, the error is triggered by the
getBackend()
function, which attempts to get the backend of the SPIR-V device from the 2D arrayspirvBackends
, which is created in theSPIRVBackendImpl
class.The
spirvBackends
array is initialized in the following way. The number of rows corresponds to the number of SPIR-V dispatch drivers (OpenCL and LevelZero) and each row contains an array that stores the backends of the devices associated with each driver. For the example, on the cyclone server, for the following devices:the contents of the
spirvBackends
array are:When trying to run on device 0:3 (
SPIRV LevelZero - Intel(R) UHD Graphics 770
) the platform and device indices passed in thegetBackend()
function were 0-1. However, since there is no such entry in thespirvBackends
array, the exception was thrown. To get the backend from the array correctly, the platform index should have been 2 instead, so as to follow the same semantics.However, each SPIR-V device instance (OpenCL and LevelZero) has a view of its own dispatch drivers and based on this it sets the platform index for it. Since there is one LevelZero dispatch driver, the index 0 is correct for the device, but it does not match the representation in the
spirvBackends
array which as a universal view of all the drivers.This PR proposes the following. Instead of getting the backend using the platform index, get it based on the SPIR-V device instance. This way, the LevelZero and OpenCL instances of the SPIR-V devices do not need to have a view of all the drivers and it is guaranteed that we will get the backend associated with the specific SPIR-V device.
Backend/s tested
Mark the backends affected by this PR.
OS tested
Mark the OS where this PR is tested.
Did you check on FPGAs?
If it is applicable, check your changes on FPGAs.
How to test the new patch?
The problem was identified by running the following test on the cyclone server:
tornado --jvm="-Dtornado.spirv.version=1.0 -Ds0.t0.device=0:3" --debug -m tornado.examples/uk.ac.manchester.tornado.examples.arrays.ArrayAddInt