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

Add alternative implementation of device timer to SyclTimer class #1872

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

oleksandr-pavlyk
Copy link
Collaborator

This PR adds Python API to submit empty body single task to a queue. dpctl.SyclTimer is modified to acquire device_timer keyword argument with supported values being "queue_barrier" (legacy behavior, a default), and "order_manager".

With "order_manager", timer submits the empty body single tasks (fence tasks) to the queue, using order manager to order them so as to fence timed submissions. For example, execution of the following snippet:

   prior_ops
   with timer(profiling_queue):
        compute_using_the_queue
   subsequent_ops

results in a task graph [prior_tasks] -> [fence_start_task] -> [ compute_tasks] -> [fence_end_task] -> [subsequent_tasks].

Timer uses profiling data from events associated with fence tasks to estimate execution time of compute tasks as measured by the device's timer.

The device_timer="order_manager" is useful to time dpctl.tensor operations which leverage order manager.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

github-actions bot commented Oct 22, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_149 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Oct 22, 2024

Coverage Status

coverage: 87.725% (+0.02%) from 87.705%
when pulling 7752078 on add-empty-task-submission
into dd2812f on master.

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_150 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk changed the title Add empty task submission Add alternative implementation of device timer to SyclTimer class Oct 28, 2024
dpctl/_sycl_timer.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 6, 2024

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_174 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

github-actions bot commented Nov 7, 2024

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_177 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

github-actions bot commented Nov 8, 2024

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_199 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

SyclTimer now supports device_timer keyword argument,
a legacy behavior "queue_barrier", and new one based
on sequential order manager, which inserts an empty task
into the manager to record start and end of block of timed
code.

Docstring of SyclTimer updated.

All data attributes needed for functioning of the timer are
created during class instance construction now.
Check different device_timer values, test argument validation,
and test cumulative timing.
Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_209 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_210 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 34ae129 into master Nov 15, 2024
50 of 51 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the add-empty-task-submission branch November 15, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants