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

Synchronization functions and USM allocations functions release GIL #736

Merged
merged 3 commits into from
Jan 5, 2022

Conversation

oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented Jan 5, 2022

DPCTLQueue_Wait and friends are declared nogil, and their use
is moved into with nogil context.

This allows us to use sycl::host_task to manipulate reference count on a Python object without introducing a deadlock.

Since USM allocation functions are also synchronous and can take some time for
large allocations, we release GIL for them too. We may perhaps revisit this in the future, only release GIL for large enough allocations.

DPCTLQueue_Wait and friends are declared nogil, and their use
is moved into `with nogil` context.

This allows us to use host_task to decrement reference count on
a Python object without introducing a deadlock.
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

@coveralls
Copy link
Collaborator

coveralls commented Jan 5, 2022

Coverage Status

Coverage decreased (-0.04%) to 81.487% when pulling 0ae7844 on wait-releases-GIL into b4b9722 on master.

@diptorupd
Copy link
Contributor

Does it address #170?

diptorupd
diptorupd previously approved these changes Jan 5, 2022
Large USM allocations can be constly, so releasing GIL while
invoking them may be a good idea.
@oleksandr-pavlyk
Copy link
Collaborator Author

The latest batch of changes closes #170

@oleksandr-pavlyk oleksandr-pavlyk changed the title Synchronization function release GIL Synchronization functions and USM allocations functions release GIL Jan 5, 2022
@oleksandr-pavlyk oleksandr-pavlyk merged commit fab1c99 into master Jan 5, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the wait-releases-GIL branch January 5, 2022 20:54
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

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

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