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

[refactor] Removed the getHandleByIndex from the PowerMetric interfac… #559

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

stratika
Copy link
Collaborator

@stratika stratika commented Sep 18, 2024

Description

This PR refactors the interface of PowerMetric.java. This interface exposed three methods:

  • initializePowerLibrary(): responsible for initializing data structures to be used for querying underlying power metrics from the heterogeneous libraries (e.g., CUDA NVML).
  • getHandleByIndex(long[] device): this method was using a device index from the device context in order to load the device pointers into an array.
  • getPowerUsage(long[] powerUsage): this method loads the power metrics in an input array.

The second method performs inner low-level functionality, and is not necessary to be exposed in the device context. This is because the PowerMetric constructor in the OpenCL and PTX implementations accepts as input the device context. So, this method can be removed from the interface and be performed during the initialization (as part of the first method).

Relevance to previous PRs: #377

Problem description

This refactoring will enable the smooth integration of the power functions for the LevelZero implementation and the SPIR-V backend.

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?

To test, you can run:

make BACKEND=opencl
tornado --enableProfiler console -m tornado.examples/uk.ac.manchester.tornado.examples.VectorAddInt --params="100000"

make BACKEND=ptx
tornado --enableProfiler console -m tornado.examples/uk.ac.manchester.tornado.examples.VectorAddInt --params="100000"

…e. This method was used to load the device pointer from a device index that was obtained via the device context. This functionality is now performed during the initialization function.
Copy link
Member

@jjfumero jjfumero left a comment

Choose a reason for hiding this comment

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

LGTM. Unit-tests work.

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

@stratika stratika merged commit 7666c09 into beehive-lab:develop Sep 19, 2024
2 checks passed
@stratika stratika deleted the refactoring/power-metrics branch September 19, 2024 08:16
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 jjfumero mentioned this pull request Sep 30, 2024
8 tasks
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
Projects
Development

Successfully merging this pull request may close these issues.

3 participants